For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > January 2006 > Set parameter in subreport









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Set parameter in subreport
Carl Tribble

2006-01-31, 8:00 am

I am using Crystal reports in VB .NET 2003 and I have a report with two
subreports. Each subreport has a parameter named "TotalLineMessage". I am
trying to set the value of this parameter with the following code but it
does not work (the report prints fine but the parameter is blank).

Dim r As New Invoice_New
Dim sub1 As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim sub2 As New CrystalDecisions.CrystalReports.Engine.ReportDocument
sub1 = r.OpenSubreport("rptInvoice.rpt")
sub2 = r.OpenSubreport("rptInvoiceCopy.rpt")
sub1.SetDataSource(ds)
sub1.SetParameterValue("TotalLineMessage", TotalLineMessage)
sub2.SetDataSource(ds)
sub2.SetParameterValue("TotalLineMessage", TotalLineMessage)

In the code, TotalLineMessage is a variable that I have confirmed has the
value I want printed.

Thanks,
-Carl


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com