Passing many datasets to jasper reports

Hello,
I have a dashboard in my solution with a few powergrids on the one form, I have been asked to create a simple pdf of the same to send as email. The querys are all different and quite complex and I would prefer not to recreate the sql in Jasper Reports, can I pass the datasets as parameters and then use them in my report somehow?

Don’t know about jasper, but in Velocity you can pass as many datasources (datasets, foundsets, arrays, objects) as you want in a context simply putting them all in the context object:

var context = { fs1: aFoundset, fs2: anotherFoundset, ds: aDataSet, ds2: anotherDataSet, array: anArray, obj: anObject, etc... };
var pdf = plugins.VelocityReport.getPDFReport(template, context);

Then in your html template you use #foreach or $ object notation (and . notation for related values) to output the data.

wvitpr:
Hello,
I have a dashboard in my solution with a few powergrids on the one form, I have been asked to create a simple pdf of the same to send as email. The querys are all different and quite complex and I would prefer not to recreate the sql in Jasper Reports, can I pass the datasets as parameters and then use them in my report somehow?

Hi,

Yes you can. In this case you would create a subreport for each powergrid and pass the corresponding datasets in as a parameter which is then passed in to the subform. It’s a bit of struggle to get it right the first time but after that it’s a piece of cake.

Kind regards,