Hi TS,
Here's an example of passing a global variable to the report in order to
filter that report. 'globals' is a module that has global scope and has a
string variable in it called 'gl_selectionst ring:
Dim mglobals As New globals
mglobals.gl_sel ectionstring = "{bnlsum.invnum } >= '" & startnumbox.Tex t &
Chr(39) & " and {bnlsum.invnum} <= '" & endnumbox.Text & Chr(39)
gl_browseprintv ar = "f:\imcapps\bnl inv.rpt"
Dim newmdichild As New reportprinter_v iewerparam
newmdichild.Tex t = "BNL Summary Invoice"
newmdichild.Sho w()
reportprinter_v iewerparam is a form that displays the report. In that form,
here's the code for that report:
CrystalReportVi ewer1.Selection Formula = mglobals.gl_sel ectionstring
CrystalReportVi ewer1.ReportSou rce = "f:\imcapps\bnl inv.rpt
HTH,
Bernie Yaeger
"TS" <TS@discussions .microsoft.com> wrote in message
news:5D******** *************** ***********@mic rosoft.com...
Thanks for your response. Can you tell me how the code for this looks
like.
Or do you know of any white papers that can help with that.
"Bernie Yaeger" wrote:
Hi TS,
There are several ways to do this. Perhaps the most straightforward
would
be to pass a parameter to the report and set the report's record
selection
criteria to include only the client names who match the parameter.
HTH,
Bernie Yaeger
"TS" <TS@discussions .microsoft.com> wrote in message
news:68******** *************** ***********@mic rosoft.com... > Hi all,
> In my windows form, I need the user to select a client name from a
> combo
> box
> and click on a button that opens another form having CRViewer showing
> the
> data for that client selected.
> I connected to the SQL database where the cbo box gets the clients
> names
> from and I can see the names in cbo box. I created my CR and put the
> CRViewer
> on another windows form. What's next? I need help with the code.
> Thanks in advance
> --
> TS