Jump to content
We've recently updated our Privacy Statement, available here ×

Connection / Data Source Expression for subreport


evelina

Recommended Posts

I want to use different datasources for main report and for subreport. As far as I have read this could be configured by
specifying Connection Expression / Data Source Expression in the subreport properties.
I have tried the following expressions:
1. For connection expression
a) java.sql.DriverManager.getConnection("jdbc:mysql://localhost/mydatabase?user=root&password=root")
I have recieved the exception:

Error evaluating expression
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/mydatabase?user=root&password=root

b) it.businesslogic.ireport.util.Misc.getConnection("MySQL")

I have recieved the exception:
Error evaluating expression
Caused by: groovy.lang.MissingPropertyException: No such property: it for class: MainReport2_1261053872640_197936 

2. For Data Source expression
a) com.jaspersoft.ireport.designer.utils.Misc.getDataSource("MySql")
I have got no exceptions though the subreport was not displayed at all
b) it.businesslogic.ireport.util.Misc.getJRDataSource("MySQL")
I have recieved the exception:
Error evaluating expression
Caused by: groovy.lang.MissingPropertyException: No such property: it for class: MainReport2_1261058321687_913089

I use iReport 3.6.1, Java: 1.6.0_06; Windows XP.
mysql-connector-java-5.1.10-bin.jar is listed in the classpath.

 

Could you please advice?

Link to comment
Share on other sites

  • 2 months later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I am having he exact same problem here in ireports 3.7.1. When I select "Use a  connection expression" with $P{REPORT_CONNECTION} (just to test), the report and subreport work fine. But if I try to specify the connection of the subreport with any of the options that evelina tried, the subreport is empty, even if the strings for getJRDataSource and getConnection are in fact the same as for the master report.

I am wondering where the it.businesslogic.ireport.util.Misc class should reside.  I guess the error means iReports can't find it.

Did you find out a solution evelina? Or does anyone else have one?

Cheers,

Dolf.



Post Edited by dolfandringa at 02/21/2010 21:58
Link to comment
Share on other sites

  • 2 years later...
  • 1 year later...
  • 10 months later...
  • 7 years 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...