Tuesday, February 14, 2012

Crystl32.ocx with vb .net

Hi all,

I've created the report with Seagate crystal reports with the source to the database through a stored procedure (with ODBC). The stored procedure contains input parameter that I want to sent it to this report from .Net through Crystal report Control Crystl32.ocx.
I installed this control into .net but I don't how can I pass the parameter which I'm writing into textbox to report that contains stored procedure as a data source.

== Some code with Crystl32.ocx that I'm using to call the report:

With cr2
.ReportFileName = Application.StartupPath + "\klient_info.rpt"
.RetrieveDataFiles()
.DiscardSavedData = True
.ParameterFields(1) = "@.KlientID;" & TextBox2.Text & ";False"
.WindowState = crptMaximized
.Action = 0

End With

With the code above I'm passing into crytal report @.klientID - what I'm writting into textbox2. But the problem is that I don't want crystal report to prompt again for inserting input parameter.

Thanks,
ProBani.With the code above I'm passing into crytal report @.klientID - what I'm writting into textbox2. But the problem is that I don't want crystal report to prompt again for inserting input parameter.

are you sure that you only have one input parameter and that it is ParameterFields(1). My guess is that Crystal either expect another paramter or that the one your inputting isn't correct. That's why you get prompted to input another param.

No comments:

Post a Comment