Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I added a 2nd Subreport to my Crystal Reports and after that I get this error, When I remove the 2nd Subreport it works fine.

I use below code to set datasources for the subreports.

CreateFeePaidXML()

and
CreateAdditionalFeeXML()


both are functions which return datasets.

This is the formula, which works fine before I add the 2nd subreport.

IIF ({PaidFee.paidamount} = 0,'' ,TOText({PaidFee.paiddate},"dd-MMM-yyyy") )


What I have tried:

VB
frmRptViewer.CrystalReportViewer1.ReportSource = rpt
                       rpt.Subreports(0).DataSourceConnections.Clear()
                       rpt.Subreports(0).SetDataSource(CreateFeePaidXML())
                       rpt.Subreports(1).DataSourceConnections.Clear()
                       rpt.Subreports(1).SetDataSource(CreateAdditionalFeeXML())
                       frmRptViewer.ShowDialog()
Posted
Updated 5-Sep-19 11:00am
v2
Comments
[no name] 5-Sep-19 3:49am    
When I removed the Formula field from the other subreport (which was giving error), now after that the subreport(1) show blank report.
[no name] 5-Sep-19 4:07am    
Resolved the problem, swapped subreports indexes fixed the problem
rpt.Subreports(1).SetDataSource(CreateFeePaidXML())
rpt.Subreports(0).SetDataSource(CreateAdditionalFeeXML())

but still I thought the report I added first will have o index and the later will have 1 but its not.

I still dont know how to check subreports indexes.

1 solution

As you mentioned in the comments, you have found a solution. Adding this so it no longer shows up unanswered.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900