Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports subreport/C#

Status
Not open for further replies.

kmfna

MIS
Sep 26, 2003
306
US
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:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top