Jump to content

BIRT Developer Center Download


Photo
- - - - -

Producing Multiple Report from one Report


  • Please log in to reply
8 replies to this topic

#1 Birtboogie

Birtboogie

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 07 March 2017 - 04:46 AM

Hi,

 

BIRT Newbie here,

 

I am looking to be able to produce multiple reports from one report data source.

 

The data source is XML and would need to print a separate report for each customer ID.

 

can anyone help?

 

Thanks,

 

Mark



#2 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1105 posts

Posted 07 March 2017 - 09:46 AM

Are you using commercial, or open source BIRT?  What version?

 

You'll need a driver report that can burst (create additional) reports.  Have you seen these DevShares?

 

For commercial:

http://developer.act...ting-with-birt/

 

For open source:

http://developer.act...t-using-script/


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#3 jsekhon

jsekhon

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 10 March 2017 - 10:55 AM

Did not work.



#4 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1105 posts

Posted 10 March 2017 - 04:10 PM

Did not work.

 

Can you provide more details?

 

What did not work?  What version are you using?  What did you try?


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#5 jsekhon

jsekhon

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 14 March 2017 - 03:54 PM

Using Birt Luna 4.4.0.

 

I used the same example with changed the paths . No bursted reports where generated.

 

importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("c:\Burstreportfoldersfiles\burstdetail.rptdesign"); 
 
var ntask = re.createRunAndRenderTask(des);
ntask.setParameterValue("CustomerNumber", parseInt(this.getRowData().getColumnValue(0)) );
var options = new PDFRenderOption();
var outputfile = "c:\Burstingexample" + this.getRowData().getColumnValue(0) + ".pdf";
options.setOutputFileName(outputfile);
options.setOutputFormat("pdf");
ntask.setRenderOption(options);
ntask.run();
ntask.close();


#6 jsekhon

jsekhon

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 20 March 2017 - 10:34 AM

Clement can you suggest what can I do to get it working.



#7 pricher

pricher

    Senior Member

  • Members
  • 716 posts

Posted 20 March 2017 - 11:08 AM

Hi,

 

Couple of things you can try:

 

1. Use forward slashes instead of backslashes in the openReportDesign method and the outputFile variable:

2. Remove the parseInt method in the setParameterValue method

 

The following script works for me:

importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("c:/xfer/burstdetail.rptdesign"); 

var ntask = re.createRunAndRenderTask(des);
ntask.setParameterValue("CustomerNumber", this.getRowData().getColumnValue(0));
var options = new PDFRenderOption();
var outputfile = "c:/xfer/test" + this.getRowData().getColumnValue(0) + ".pdf";
options.setOutputFileName(outputfile);
options.setOutputFormat("pdf");
ntask.setRenderOption(options);
ntask.run();
ntask.close();

Hope this helps,

 

P.


Pierre Richer

Solutions Consultant, Analytics & Reporting

OpenText

 


#8 Virgil

Virgil

    Administrator

  • Administrators
  • 1028 posts

Posted 24 March 2017 - 07:30 AM

I also had to change the CustomerNumber from String to Int in the detail report to get it to work.


Virgil Dodson 
BIRT Evangelism | OpenText Analytics and Reporting
http://developer.actuate.com


#9 jsekhon

jsekhon

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 24 March 2017 - 08:22 AM

Thanks. It worked.