on 09-03-2008 11:18 PM
We are evaluating crystal report and other reporting tools to use in our application.
The application is going to be developed in Java Swing. From this application, crystal report needs to be displayed. So, Is there possibility we can integrate crystal report with our application. The input data is going to be in XML and output should be in PDF.
We are expecting some thing like this.
Crystal report should provide Java APIs to integrate with our application. API should take XML as an Input data and crystal report template file(.rpt). It should return the output in pdf file.
If this is possible, can you tell me where I can get the sample codes?
Thanks,
Makesh
Have a look at our on-line docs, export tutorial [here|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/JRC_SDK/jrc_java_dg_doc/doc/jrcsdk_java_dg/Tutorials19.html#1586997].
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can:
1. Create a Crystal Report against XML data using the Designer. Then programmatically export that report.
2. Create a Crystal Report using the Desinger. Then programmatically "push" data into the report in XML format and export.
What you can't do currently with the JRC is create a report.
Sincerely,
Ted Ueda
Thank you for clarifying my doubts. I would be interested in case 2.
I want to do the exactly same thing.
First create a report using the designer. Then use the created report(.rpt file) and dynamic XML data to programmatically export the report in pdf format.
Where can I find the sample code for the above case? Most of the codes, I have come across, use only JDBC data source. I don't see any code using XML data source.
The only thing I am interested is how to pass("push") XML data programmatically. If I get any information regarding that, then I can develop my own program for the above case.
Thanks,
Makesh
Snippet for JRC XML "push":
ReportClientDocument rcd = new ReportClientDocument();
/*
* Open and read CR Report and XML Data and Schema Files.
*/
rcd.open("reports/test_xml.rpt", 0);
FileInputStream fin = new FileInputStream("reports/new_test_data.xsd");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
for(;;) {
int count = fin.read(bytes);
if(count < 0)
break;
baos.write(bytes, 0, count);
}
final byte[] xsdBytes = baos.toByteArray();
fin.close();
fin = new FileInputStream("reports/new_test_data.xml");
baos = new ByteArrayOutputStream();
bytes = new byte[1024];
for(;;) {
int count = fin.read(bytes);
if(count < 0)
break;
baos.write(bytes, 0, count);
}
final byte[] xmlBytes = baos.toByteArray();
fin.close();
/*
* Inject XML data into CR Report using IXMLDataSet into
* table "schema1/People".
*/
IXMLDataSet xml_ds = new IXMLDataSet() {
private IByteArray xmlData = null;
public void setXMLData(IByteArray xmlData) {
this.xmlData = xmlData;
}
public IByteArray getXMLData() {
return this.xmlData;
}
private IByteArray xmlSchema = null;
public void setXMLSchema(IByteArray xmlSchema){
this.xmlSchema = xmlSchema;
}
public IByteArray getXMLSchema() {
return this.xmlSchema;
}
};
xml_ds.setXMLData(new IByteArray() {
public void fromString(String arrayValue){}
public String toString() { return ""; }
public byte[] getBytes() { return xmlBytes; }
});
xml_ds.setXMLSchema(new IByteArray() {
public void fromString(String arrayValue){}
public String toString() { return ""; }
public byte[] getBytes() { return xsdBytes; }
});
rcd.getDatabaseController().setDataSource(xml_ds, "schema1/People", "schema1/People");
Sincerely,
Ted Ueda
Thanks,
Makesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.