Reply
Fri 24 Dec, 2010 12:05 am
i have used a dataset ctrl (Mydataset.xsd) for a CrystalReport
and have passed procedure to it rather than a query..
now it works properly with one procedure only, but i need to pass 6 different procedures for displaying details on report.....and that does not works!!!!
folling is the code that is working ...
frmShowReport_Load()
Dim conn As SqlConnection
Dim da As New SqlDataAdapter()
Dim cmd As New SqlCommand()
Dim myDs As New Mydataset
Dim cmd As New SqlCommand()
Dim rpt As New MyReport() 'The report you created.
conn = New SqlConnection("server = servername2;database =db;uid = abc;pwd=abc")
Dim param0(0 To 0) As SqlParameter
param0(0) = New SqlParameter("@Factuur_ID", SqlDbType.Int)
param0(0).Value =1234
With cmd
.Connection = conn
.CommandType = CommandType.StoredProcedure
.CommandText = "up_parmsel_rapport"
End With
If Not (param0 Is Nothing) Then
For Each sqlParm0 As SqlParameter In param0
cmd.Parameters.Add(sqlParm0)
Next
End If
da.SelectCommand = cmd
da.Fill(myDs, "up_parmsel_rapport")
MsgBox(myDs.Tables("up_parmsel_rapport").Rows.Count())
rpt.SetDataSource(myDs.Tables("up_parmsel_rapport"))
rpt.Load("Report full address/Path")
CrystalReportViewer1.ReportSource = rpt
End Sub
now what shall i do to call another procedure
.................plz Help in stuck here...
I'm not sure (and you really should be checking at a SQL or Crystal Reports forums site), but I think the is nothing part is incorrect -- you might want something more like is null. This is a guess; I haven't worked on this stuff in a while.