add a dynamic resultSet in Crystal Reports in eclipse - java

My problem is this. I have Crystal Reports with Java in Eclipse, and I was unable to connect to a database using a JDBC connector IBM but graphically. But now I want to connect to the report by code, to pass data database, and can not find how to do it. Since Crystal Reports for Java does not allow me to use a ResultSet as a data source to generate the report dynamically.
Thanks

Related

Accessing jasper reports through the web

i know that this is a trivial question but this is the best place to ask it. I have a database which is hosted on a website. I have written a Java program that accesses the database and through this program the user can view reports. I used Jasper Reports for this. Now i have a website where the user can log in and would like the user to be able to view the exact same reports but through my website. In other words, what is the equivalent of Jasper Reports for a web page? I know that there is something called JasperReports Server but Im not sure if that is what i am looking for and how is it possible to incorporate into into my html/php site. Can someone please direct me to the right place? Thanks.
You can display Jasper reports using any of the following approaches:
Publish JRXML reports into Jasper server and embed Jasper server into your application using IFrame.
Publish JRXML reports into Jasper server and call those reports in your application using Soap or Restful web services.
Use Jasper API to display jasper reports directly in your application. Refer Jasper reports for Java tutorials for more info.
Thanks,
Srikanth Kattam

Extract/Display SQL from crystal report

Problem:
I have a crystal report file on a computer. I need to know how the crystal report queries a database.
Background:
The crystal report file was created 10+ years ago by a highly paid contractor. No one knows anything about how it was created. We do not have any crystal report authoring software. We don't have any information related to the crystal report file, just the report file.
Question:
If I have a crystal report file here: /file/path/to/myMagicReport.rpt, how can I extract the SQL string used to query the database from the file?
Ideally I would not like to install any software, just extract the information programatically.
I don't think there is a way to programatically extract the SQL query. Unfortunately you will have to either have somebody do it for you or install a version of Crystal Reports.
There is a free trial for Crystal Reports available from SAP here. I would download it, open the report. You can find the SQL query under the Database tab. Please see screenshot.
EDIT:
There is also rpt inspector, which will allow you to get the SQL query. They have a free trial as well here. It may give you all the info you need but probably won't let you make any changes to the report layout, if that's something you had in mind.

Regarding a Plugin for Eclipse to represent the table references on other table in eclipse

I am working on a java project which has it database in db2 and I connect to database through a common ip , I use the database view perspective of eclipse itself and see the table entries s in eclipse database explorer itself, But I was searching for a plugin in eclipse such that When I click on particular table then a screenshot of it referenced table in form of graph is to be get displayed that shows its references in other tables too..!!
You can use IBM Data Studio that is an Eclipse-based application, with many plugins, including the one that you want.
You can download it for free from http://www-01.ibm.com/software/data/db2/express/download.html (Get Free Tools > Data Studio Full Client)
This is a very good tool to work with DB2 from Eclipse.

JasperServer Error - Unable to get next record

I have a very simple report that runs perfectly on in iReports (4.5.0) on my workstation. When I upload it JasperServer CE (4.5.0) I get the following error.
1 - Unable to get next record.
java.lang.Exception: 1 - Unable to get next record.
at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:403)
at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320)
at com.jaspersoft.ireport.jasperserver.ReportRunner.run(ReportRunner.java:70)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
There are other much more complex queries and reports that are running on the JasperServer without problem. The database system is Basis/Pro5 running BBJ (Business Basic Java). I am connected to the database in iReports and JasperServer using the same native JDBC Basis driver (BBjJDBS.jar). JasperServer is running on the same RHEL box as the BBj database. Jasper server is installed as a bundle using both the built in DB and Tomcat. No other known conflicts exist.
The following single table query is designed to get the sum totals of a transaction for a given month. The report has one detail section which just prints the query output.
SELECT
Month(INHI.TRANSACTION_DATE) AS TransMonth,
admin.INHI.ITEM_ID,
admin.INHI.TRANSACTION_TYPE,
SUM(admin.INHI.TRANS_QUANTITY) as TransQty
FROM
admin.INHI
WHERE
admin.INHI.ITEM_ID = 'R-CBSH-3300'
AND (
admin.INHI.TRANSACTION_TYPE = 'B2'
OR admin.INHI.TRANSACTION_TYPE = 'P1')
AND admin.INHI.TRANSACTION_DATE BETWEEN '2012-01-01' AND '2012-03-31'
GROUP BY
Month(INHI.TRANSACTION_DATE),
admin.INHI.ITEM_ID,
admin.INHI.TRANSACTION_TYPE
Order By
admin.INHI.TRANSACTION_TYPE
I have looked all over to try and find additional trouble shooting tips and have ran out of options to try. Any guidance is greatly appreciated.
In my case I was able to get an extended error from the JasperServer web interface which lead me to an Date/Time issue. The crux of the whole problem was the "Order By" clause. Once I removed the order by the query worked fine.
You can also get this error if you pass a closed result set as the data source for the report.
In my case I passed the JasperReportBuilder object around and somewhere I (prematurely) closed the Connection object that the result set was bound to.

Netbeans Database Explorer and Microsoft SQL Server not getting along

I am trying to get a Java desktop application to pull some data from a Microsoft SQL-Server 2008 Database. Netbeans database explorer can generate Entity classes from database tables, but I was unable to get this feature working. Normally, when you conect to a database, you see something like this:
I entered the database URL, username and password, and the connection was established. But when I tried to explore the tables, they were all empty. Instead of the nice tree above, I was just given a list of empty Schemas. Mutlitple user names were tried, all had the same issue. Since there was no schema on the database matching the username, a number of different schemas were displayed for me to choose. Regardless of which one I chose, when I expanded it nothing showed up inside the Table, or the Views.
To verify that the useranema and password did have access to the tables I am interested in, I wrote a short Java method to connect to the database and display the ResultSet for a query. It worked as expected. Why was the netbeans database explorer unable to find the tables?
I was hoping to use this tool to generate Entity classes with Netbeans, but apparently Microsoft SQL erver won't have it. I am using netbeans 7.1; documentation for the database explorer tool is found on db.netbeans.org
Yesterday I had the same problem with JDBC driver from Microsoft. I tried another one, the project jTDS (available on SourceForge). It could solve my problem. Some forums recommend always to use this driver because it is much faster.

Categories

Resources