cancel
Showing results for 
Search instead for 
Did you mean: 

Use XML as data input for Crystal Report for Eclipse

Former Member
0 Kudos

Hi,

I am completely new to crystal report and please kindly forgive me if I ask some stupid questions.

Actually, I have searched the forum for the topic and found some related threads, but I still want to

have some responses from crystal report experts on this issue.

Our developer tool is IBM RAD 7.0 and it has crystal reports tools installed in it. I want to use

crystal report to solve one of our business solutions. I have the following questions about the

feasbility of this solution:

(1). I need to specify data at runtime during report generation. I think using fixed data source

(for example, SQL query or Stored Procedure) may not fit our needs. I think if crystal report

can accept XML as input to generate reports at runtime, then it will be perfect. Can CR

use XML as data source as input?

(2). Actually, one of our business requirements is to generate a letter. Can CR do a report

layout such that a letter format can be achieved? If yes, would you let me know the

report layout name?

(3). We need to export the report into PDF format, I know CR can do PDF output. But can

CR be controlled to export this into bytes stream? Or the PDF must be saved into a

physical file?

(4) If I need to learn more about CR, which book will you recommend?

Thanks in advance for your advice,

Raymond

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Crystal Reports can use an XML datasource as input to the report. It is under the XML data connectivity in Crystal Reports Database dialog.

There are no letter templates in Crystal Reports but there would be no reason why you couldn't do a letter, the capability is there.

Exporting to byte stream can be done via one of the reporting SDK's available. For more information, have a look at the SDK Library at http://www.sdn.sap.com

For learning more about Crystal Reports have a look at the Crystal Reports portal on SDN (see link above).

Former Member
0 Kudos

I had tested the use of XML as data input for CR4E. That works fine. But this is only possible, when the report source was created programatically with JSP or developed with BO XI SP2 and then imported to CR4E. For creating an extern report you need additional a XSD-file. XML and XSD does not contain forbidden characters for the native XML-driver ( f. e. use table_field1 as element for table1.field1)

Former Member
0 Kudos

Sorry to jump on another thread, but how exactly do you use a XML file as a data source.

I am new-ish to XML so I might be missing something fundamental in the XML file design when using

it as a data source.

Our developers have supplied me with an example of a XML that they produce.

I have performed the following steps, where am I going wrong:

Data Source Explorer -- Right Click on XML Data Source -- New -- Entered a "Test1" --

Next -- Browsed to my XML file (tried local and URL) -- Finish.

I then right click on "Test1" and click Connect. It appears connected and I can ping it,

but thats about it. There is no structure branching off it, I cant drag it into the Report Data window. Nothing.

So either I am missing something, or its just down to my XML file not being compatible.

Would someone beable to give me the correct steps for designing a report off a XML file, and/or point

me in the direction of how to correctly create the XML data source.

Please dont just say, Google will tell me, as I a know this and have spent a short while looking, as I am sure most of you know there are xml files and then there are XML files. And

Google has been resonsible for most of my learning, but I am a little under pressure to get this working,

and have a short time to produce results.

Thanks all and have a good weekend.

Darren

ted_ueda
Employee
Employee
0 Kudos

Hello Darren,

I would start off with this blog:

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12990] [original link is broken] [original link is broken] [original link is broken];

that describes how to report off of an XML in Crystal Reports for Eclipse.

and this document:

[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90faaea7-8e1e-2b10-e6a7-ea82e11d9e8b]

that describes the schema for the XML that Crystal accepts.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Thanks Ted,

Will have a read through those and see how I go.

Cheers

Darren

Edited by: Darren Jackson on Apr 24, 2009 2:50 PM

OK had a brief look and tried the inline XML snippet. Straight away eclipse complained

Failed to load the database connector 'crdb_xml.dll'.

Is this because I am solely using CR4Ev2 and do not have CR2008?

I am trying to go to :

http://www.businessobjects.com/products/downloadcenter/crystalreports.asp

as the PDF suggest to download the Native XML drivers, but as usual SAP and BO links dont play nice.

Will continue playing around.

Cheers

ted_ueda
Employee
Employee
0 Kudos

Hello Darren,

The 'crdb_xml.dll' is a name for the Crystal native XML driver - it represents the actual DLL name in CR.NET and CR Designer, but is just a name when using XML in Crystal Reports Java (CRJ). For CRJ, the actual driver isn't a dll but java-based.

You should have XCMConnector.jar file in your runtime libs - that hold the XML driver with the required libs.

SIncerely,

Ted Ueda

Former Member
0 Kudos

Ted,

Thanks for clearing that up, I understand now.

I have looked through my runtime libs and cannot find that XCMConnector.jar file.

I also downloaded a fresh version of Eclipse with CR4Ev2.0.1 incase my version (1 >> 2 >> 2.0.1)

has missed something in an upgrade and I was still getting the same error, and I also cannot find any

reference to that jar file. (Although I do admit I might have missed it or just not looked in the correct place) (I looked in Java Build Path -- Libraries)

If for some reason I am missing it from my system whats the best way of getting it.

Hopefully my ignorance will help others

Cheers

Darren

Former Member
0 Kudos

Not to worry,

I have found what you are talking about. "XMLConnector.jar"

For the rest of you who might be interested I found this by going

Java Build Path >> Libraries >> Add Library >> Crystal Reports XML Driver Library

Its amazing what you can find when you just get upset and start randomly clicking

Will post an update once I have tested this.

ted_ueda
Employee
Employee
0 Kudos

Hello Darren,

It should be in the CRJ Runtime package that you can find a URL for here:

We should have done better in highlighting the required libs.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Thanks for the help Ted

Works like a charm now.

Or atleast my very very simple XML report works.

Now I just need to play around and see what I can do and what I cant.

I just want to make sure I understand how this works.

1) I start of with a XML file (or URL or other data source as explained in your BLOG)

2) I then have to create blank report which will have its data source set to my XML file.

This report (rpt file) will always have its data source set to the original XML location

    • Can this be dynamically changed, or does a new rpt file need to be created each time

(or atleast I will have to re-run "CreateXMLInlineSchemaReport" from your BLOG)

3) I can now use this rpt file as I would any other rpt file but its data source will be the original XML file

- If I update or change the XML file, the report will dynamically reflect these changes.

4) To change the data source, I need to recreate a new rpt file as per point 2. Which will now be blank.

5) Filtering.... if I want to filter the XML data do I use normal parameters. If I want to filter the data before

I pull it do I need to change anything. In otherwords if I have a XML file with 1000 records, but I only want say

5 of them, how do I only pull those 5 without first pulling the whole 1000 records. Hope that makes sense.

As I said I am very new to this so some things still fly over my head, but I do play around abit so hopefully

will find what I am looking for.

Cheers

Darren

PS any other links to info on creating and running reports of XML data sources would be greatly appriciated

ted_ueda
Employee
Employee
0 Kudos

As of now, creating a XML report is much easier if you have Crystal Reports 2008 Designer.

The blog mentioned earlier is a workaround for the CR4E product impedance mismatch with the Eclipse Database Explorer.

So further comments:

You can switch XML datasource by changing the connection info properties before running the document. So if the report remains unchanged but you just want a different datasource for the report, it'll be just doing replaceConnection as you would with any other data source type.

Filtering - if you want to do it within the CRJ report engine, then you'd just parametrize your report and define report selection formulas (i.e., all the data will be imported, then the data will be filtered in the CRJ report engine).

If you want to filter at the data source side, that would depend - if your datasource is SOAP, then you'll have to configure the parameters for the SOAP request (here CR 2008 Designer is much simpler, since it'll parse the WSDL for you). If it's a XML source with filtering defined via URL, then you'd specify the URL GET parameters in the, um, URL.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hi Ted,

My I know what's your resolution to Former Member 's issue below? As I can not see any thing in your comment:

Data Source Explorer -- Right Click on XML Data Source -- New -- Entered a "Test1" --

Next -- Browsed to my XML file (tried local and URL) -- Finish.

I then right click on "Test1" and click Connect. It appears connected and I can ping it,

but thats about it. There is no structure branching off it, I cant drag it into the Report Data window. Nothing.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi all,

I've currently got Crystal Reports working properly in my Java Web project, which is using an XML Datasource if I include XMLConnector.jar in my WEB-INF/lib folder. However, we don't want to have to include this rather large jar in our project as it contains many jars that we already have.

I tried to extract out the jars inside XMLConnector.jar into my WEB-INF/lib folder, but now I get the same exception as noted above:

com.crystaldecisions.reports.common.QueryEngineException: Error loading database connector. The class 'com.crystaldecisions.reports.queryengine.driverImpl.DriverLoader' could not be accessed.

....

Caused by: com.businessobjects.reports.jdbinterface.common.DBException: Failed to load the database connector 'crdb_xml.dll'.

Is there a way to diassociate the contents inside this jar, or if you can help me locate the exact libraries that are required to properly load XML datasources, and any settings I need to change.

Thanks,

Peter

Former Member
0 Kudos

HI.

I am having the same problem with the missing DLL for xml reports, but I cannot find the XMLConnector.jar anywhere.

I am using Eclipse 3.6.0.

The Crystal plugin for Eclipse (2.0.6.r916) was downloaded and added manually into Eclipse (unzipped into the folder).

Where can I find the XMLConnector.jar?

Thanks.