Jump to content
JasperReports Library 7.0 is now available ×

How use two different DataSource(DB and Map)?


Recommended Posts

By: Gabriele - gabrielesh

How use two different DataSource(DB and Map)?

2006-02-19 12:32

I have a datasource (from connection) that populate a detail report with a query.

 

In the summary I have a crosstab.

I would like populate the crosstab with a customDataSource, a Map.

Can I Do this? How?

 

I use this code for detail:

JasperPrint jasperPrint = JasperFillManager.fillReport(reportName, parm, connection);

 

Thanks, Gabriele

 

 

 

 

By: Gabriele - gabrielesh

RE: How use two different DataSource(DB and Map)?

2006-02-21 06:54

Thanks.

 

If I have a myCustomMapDataSource, I can pass it as parameter, and then cast it in the <dataSourceExpression> ?

 

 

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: How use two different DataSource(DB and M

2006-02-21 07:30

It should work as long as you don't instantiate the sub dataset twice (not your case I think, the crosstab being in the summary).

 

 

 

 

By: Lucian Chirita - lucianc

RE: How use two different DataSource(DB and M

2006-02-20 09:35

You can use a sub dataset for this.

 

Declare a sub dataset having the fields of the custom/map datasource in the report and link it to the crosstab dataset like this:

<crosstabDataset>

<dataset>

<datasetRun subDataset="name of the sub dataset">

<dataSourceExpression>

new MapDataSource($P{CrosstabDataMap})

</dataSourceExpression>

</datasetRun>

</dataset>

</crosstabDataset>

 

I assumed that you would send the map containing the crosstab data as a parameter to the report.

 

 

HTH,

Lucian

 

 

 

 

By: Gabriele - gabrielesh

RE: How use two different DataSource(DB and M

2006-02-22 07:52

I try this solution:

I have:

java.lang.NoClassDefFoundError: CrossTabReportDataSource

 

NESTED BY :

[22/02/06 16.51.04:133 CET] 77d0d646 SystemErr R net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :

Source text : new CrossTabReportDataSource($P{categorie})

 

where categorie is a Report Parameter (a TreeMap).

I have to define this parameter also in crossTab-parameter?

 

 

 

 

By: Gabriele - gabrielesh

RE: How use two different DataSource(DB and Map)?

2006-02-22 08:01

Sorry.

I solved.

 

the package was wrong!!!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...