Showing posts with label textbox. Show all posts
Showing posts with label textbox. Show all posts

Monday, March 19, 2012

Crystal Reports

hai

how to get the textbox value from a form to the crystalreport.I have two textbox

form1-------> TextBox1

crystal report ---->TextBox2

i want to assign the values of the textbox2 in the crystal report by the value of the Textbox1.Any body know the solution plz help me.you try using parameter field in crystal report and you can pass value to it from form.|||hai,

Thank you very much for ur information.If ur having any example code please sent it to me.|||Read about parameters in CR help file

Thursday, March 8, 2012

Crystal Report (using stored procedures - parameter passing)

i have created a crystal report using a stored procedure. in the web form im passing a parameter thru a textbox. but that value is not passing properly.

Dim myCMD As New SqlCommand("select_all_infor", myConn)
myCMD.CommandType = CommandType.StoredProcedure
Dim parr As New SqlClient.SqlParameter("@.Pid", SqlDbType.Int)
parr.Direction = ParameterDirection.Input
parr.Value = TextBox1.Text
myCommand.Parameters.Add(parr)
myCommand.Parameters.Add("@.Pid", TextBox1.Text)

Dim myDA As New SqlDataAdapter
myDA.SelectCommand = myCMD

Dim myDS As New myDS
myDA.Fill(myDS)

Dim myRPT As New fromSP_REPORT

myRPT.SetDataSource(myDS)

CrystalReportViewer1.ReportSource = myRPT

this is what i've written. Im not sure about connecting to a dataset. Pls correct me.

it's giving this error:

Procedure 'select_all_infor' expects parameter '@.Pid', which was not supplied.try to use this.

crReportDocument.SetParameterValue(0,(object) "first parameter");
crReportDocument.SetParameterValue(1,(object) "second parameter");