Jump to content
JasperReports Library 7.0 is now available ×

Subreport data to be either Connection or DataSour


csplrj

Recommended Posts

I have created the master report with subreport inside it. I want the subreport connection/datasource expression to be dynamic

i.e. I should be able to use the Connection or DataSource as per the Parameters value so that When i am working with Ireport then it wil use Connection and when i am coding it it will use DataSource

 

So I wrote

$P{RunMode}.intValue()==1?$P{REPORT_CONNECTION}:new JRBeanCollectionDataSource($P{subReportParam})

 

But it throws error saying Incompatible conditional operand Types during compiling

 

I think the error is as we have o choose either datasourceexpression or connectionexpression

 

I think we need some way to specify the expression which will convey whether to use datasourceexpression or connectionexpression

 

Is there any way out

 

Thanks in advance

 

CSJakharia

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