Jump to content
JasperReports Library 7.0 is now available ×

How to get an XML report in desired format


seshasaib

Recommended Posts

Hi,

 

I am usng JR 1.2.5 and able to generate reports in all formats provided. But i have an issue with xml format where in it is giving me the same .jrxml file as the output if i want to generate an xml report and is there any way to get the xml file in the dedired format in the same tree dtructure that i am looking for.

 

Regards,

Sesha Sai.B

Link to comment
Share on other sites

  • 1 month later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi seshasaib,

I have a similar requirement and the default xml layout report is definitely not production ready. Could you please let me know if you figured out a way to generate the jasper report in desired XML format.

 

Any help is greately appreciated.

 

Thanks,

srinu.

Link to comment
Share on other sites

Hi,

 

I find this hard to believe, because every time I use the JRXmlExporter, it produces XML in my desired format. It is even production ready, as far as I can tell.

 

Now the question is, should we modify the JRXmlExporter to support seshasaib desired XML format or the one that srinu would like to see?

 

My guess is that the JRXmlExporter will just stay the way it is and those of you who wish the generated XML would look any different always have the option of creating your own implementations of XML exporters, maybe even reusing much of the existing one.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Hi Teodor,

 

This is wat i am doing inorder to generate a xml report.

 

 

 

JRXmlExporter jrXmlExporter = new JRXmlExporter();

jrXmlExporter.setParameter(JRExporterParameter.JASPER_PRINT,print);

jrXmlExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"c:/test_report.xml");

jrXmlExporter.exportReport();

 

And the output is an xml file where the content is exactly that of a JRXML file.

 

Say suppose if i want to get an xml in this fashion

 

DEAN->HOD->Professor->Students.

 

Inthe above example i would like to c Dean as the root element of the xml file in output but it is showing me the <jasperPrint> as the root element. I cant show this report to my boss rt8 saying this is the xml format of report.

 

Is there any other parameter that i am missing to pass it.

 

Looking ahead for ur reply.

 

Thanks and regards,

Sesha sai.

Post edited by: seshasaib, at: 2006/10/19 05:08

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...