Hello all,
I am working with the crystal reports package that is included with VS 2003. I am able to create my main report easily enough and have added my subreport object. The problem is that I need to be able to specify at run-time what the arguments for the subreport are. For the main report I use:
This works nicely for the main report, however, the subreport doesn't have a recordselectionformula option. I tried to type-cast it like:
But I get an invalid cast. I don't understand why this is, since all the subreport is, is a report document.
Any ideas on this would be greatly appreciated!
Anyway, thanks in advance to everyone!
Happy New Years!
Kevin
- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.
I am working with the crystal reports package that is included with VS 2003. I am able to create my main report easily enough and have added my subreport object. The problem is that I need to be able to specify at run-time what the arguments for the subreport are. For the main report I use:
Code:
cr1.SetDatabaseLogon("USER", "PASSWORD");
cr1.RecordSelectionFormula =
"{LINE_ITEMS.PA_ID} = " + glb_PA_ID + " AND {LINE_ITEMS.BID} = " + glb_BillID;
This works nicely for the main report, however, the subreport doesn't have a recordselectionformula option. I tried to type-cast it like:
Code:
((ReportDocument)(cr1.Section4.ReportObjects["SubReport1"])).RecordSelectionFormula = "..."
But I get an invalid cast. I don't understand why this is, since all the subreport is, is a report document.
Any ideas on this would be greatly appreciated!
Anyway, thanks in advance to everyone!
Happy New Years!
Kevin
- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.