I'm trying to write a library that will convert/export a crystal RPT report to PDF, but is having problems accessing the data.
Background In our case there is no database to access, the system simply produces a CSV where the RPT must extract its data from.
This is done by using "Microsoft Access Text Driver" ODBC pointing to the "Current Directory".
(When exporting a RPT to PDF with no data access data it works fine.)
Environment Microsoft Windows Server 2008 64bit.
The environment the system run in can consume java libraries, thus our interest in using java (despite my obvious unfamiliarity with java beyond the simple if and for statements).
Problem Running the below code I get "Error finding JNDI name (CSV_DSN)". I understand that it is failing to find connection to CSV_DSN and thus will try to use JNDI.
I then try to set up a JNDI connection using the CRJavaHelper but then get "com.businessobjects.reports.datamodel.DFException: The database connector cannot be changed when the connection is open."
(I've tried setting up a JDBC ODBC (bridge?) then referencing it with JNDI - hoping it will solve the problem, but after spending 2 days reading up on JNDI I did not manage to accomplish this. Most samples being for hosted environments).
Request / Plea Please help me in getting the below to work.
An explanation on why it is going wrong, maybe a pointer in the right direction would also be much appreciated.
Thank you in advance,
Joined: Dec 02, 2011
I've posted the same question at "SAP Community Network" for if my problem is on the Crystal Report side. (here)
Marius Coetzee wrote:I now tried to retrieve the data and assign it to the table, but get an AssertionError when trying to assign the ResultSet to the report...
What does that AssertionError say?
Joined: Dec 02, 2011
Thank you Jan for replying.
It looks like I got it to work with the (non refactored) code below.
The AssertionError did not give me additional information, which I also thought was funny. But I did figure out it only did it when I was using JUnit to test it (not blaming JUnit, I'm almost 100% sure it was something I did).