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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystl32.ocx with vb .net

Status
Not open for further replies.

ProBani

Programmer
Mar 21, 2005
48
YU
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.
 
instead parameterfields(0) use

.storedparameter(0) = & Trim$(TextBox2.Text)

assuming that TextBox2.Text is a string containing the ID for the client.

This functions with CR 8.5. Don't know if has been changed in newer versions.
 
The OCX doesn't give you a lot of control or information about parameters in the report. Officially it is a redundant control and you should migrate to the CRAXDRT (RDC) object.

That is a heap better to use.

The official BO line is you should forget about the RDC and use the RAS object. So check that out as well.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top