OK Problem Solved.
You have to use the overloaded version of the dataadapter fill command.
ie.
Dim cmdConn As New SqlClient.SqlCommand("proc_GetEventReportData",
NewSqlClient.SqlConnection(strConnection))
cmdConn.Parameters.Add(New SqlClient.SqlParameter("@strIDList",
SqlDbType.NVarChar))
cmdConn.Parameters("@strIDList").Value = mstrUnitList
cmdConn.CommandType = CommandType.StoredProcedure
Dim da As New SqlClient.SqlDataAdapter(cmdConn)
Dim ds As New dsReportEvent
da.Fill(ds, "ReportEvent")
Dim rd As New rptEventReport
rd.SetDataSource(ds)
The big 'break through' was realising that "ReportEvent" was needed.
The documentation alludes to this but leaves the impression that is it
mainly for table verification.
This HAD to be the name of the Element that was inside my typed dateset.
My element was handrolled and not actually a table so it seemed
reasonable to use the default constructor and accept the generated table
name "Table".
Alas no.
Moondog, if your out there, good luck.
regards
Bob
Bob Clegg wrote:
Hi Brian,
Thanks for your reply.
No Joy.
I coded:
Private Sub loadreport(ByRef dsevents As dsReportEvent)
Dim crReportDocument As rptEventReport
crReportDocument = New rptEventReport
Dim ds As DataSet
ds = dsevents 'NOTE here I am still pointing to my original dataset.
Dim dstest As String = ds.GetXml 'dstest shows well formed doc with data
crReportDocument.SetDataSource(ds)
Me.crvMain.ReportSource = crReportDocument
Me.crvMain.Visible = True
End Sub
The test string showed an xml doc with data.
I do have dates in the data.
I'll alter the sproc / dataset / report to give a one integer field rowset
and see if that helps.
If it does then I'll build up from there.
If it is data then this control is not much use.
Is there any 3rd party viewer around that anybody knows of?
Thanks
Bob
"BrianDH" <Br*****@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
Try this.
Dim crReportDocument As rptEventReport
crReportDocument = New rptEventReport
Dim dsevents As DataSet = "get your dataset values"
Dim strTests As String = dsevents.GetXml ' break point here view/test your
DS XML
crReportDocument.SetDataSource(dsevents)
CrystalReportViewer1.ReportSource = crReportDocument
CrystalReportViewer1.Visible = True
If this does not work.
Question: Are you using any formulas? running totals? also date time
fields can give you fits with CR.
hope that helps.
B
"Bob Clegg" wrote:
I am in the same boat as Moondog on the 2nd July.
I have a report designed against a dataset.
Proved the datasset is OK by dropping a datagrid onto the form and it
binds
OK to the data.
But the report is empty (except for headers). My method is similar to
Moondog except the dataset is based on a SProc.
The dataset is instantiated in FormA, passed to a DataHandling class
which
fills it. by executing the SProc
it is then passed to the report form in the constructor.
The constructor then passes it down to a subroutine 'loadreport' which
attempts to bind it to the report viewer
Code is :
Private Sub loadreport(ByRef dsevents As dsReportEvent)
' Called by new(ByRef dsevents As dsReportEvent)
Me.dg1.DataSource = dsevents
Me.dg1.DataMember = "Table"'Datagrid sanity check
mRpt = New rptEventReport 'report class underlying report based on
dsEvents
mRpt.SetDataSource(dsevents)
Me.crvMain.ReportSource = mRpt 'setting the viewer
End Sub
Any help would be appreciated.
Thanks
Bob
--
Please take out the garbage before using reply address.