millenniasp Posted November 12, 2003 Posted November 12, 2003 I have a report that has a parameter field called ClientID the selection formula in Crystal reports is {vwLetterInfo.ClientID} = {?ClientID} I obtain the ClientID from a Textbox in my Web Application How do I pass the parameter to crystal? I am very new to this, so any help would be appreciated. I looked and tried some examples already on this website (and many other websites), but none of them worked (Or I am not understanding them) Here is the code that I have so far (this works as long as I do not try and call a parameter in crystal) Dim myReport1 As New ReportDocument myReport1.Load(RTrim(Request.Params("strName"))) CrystalReportViewer1.ReportSource = myReport1 CrystalReportViewer1.DataBind() Thank you in advanced for any and all advice & help! Quote
millenniasp Posted November 12, 2003 Author Posted November 12, 2003 I worked out the solution. I am posting the code just in case someone has the same problem Dim myReport1 As New ReportDocument Dim paramFields As New ParameterFields Dim param As New ParameterField Dim ParamVal As New ParameterDiscreteValue Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo myReport1.Load(RTrim(Request.Params("strName"))) CrystalReportViewer1.ReportSource = myReport1 For Each tbCurrent In myReport1.Database.Tables tliCurrent = tbCurrent.LogOnInfo With tliCurrent.ConnectionInfo .ServerName = "ServerName" .DatabaseName = "DatabaseName" .UserID = "UserID" .Password = "PWD" End With tbCurrent.ApplyLogOnInfo(tliCurrent) Next param = New ParameterField param.ParameterFieldName = "ClientID" ParamVal = New ParameterDiscreteValue ParamVal.Value = WebForm1.myClientID param.CurrentValues.Add(ParamVal) paramFields = New ParameterFields paramFields.Add(param) CrystalReportViewer1.ParameterFieldInfo = paramFields CrystalReportViewer1.DataBind() Quote
tinJeff Posted May 24, 2006 Posted May 24, 2006 Pass parameter to Crystal Report XI from Visual Basic 6 hi to all! I am developing a program from visual basic 6 and I used the Crystal Report XI for the report. Now, how will i pass a given value from visual basic 6 to crystal report? In my program, the user will input a name. Then,in the CRViewer, the data under that name will be displayed. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.