vb.Net 2003 & Crystal Report data source = Dataset question 
Author Message
 vb.Net 2003 & Crystal Report data source = Dataset question

I am trying to develop a Crystal Report using a ADO.Net DataSet.  I
populated a dataset, and created the XML file using the
ds.WriteXmlSchema method.  I created a new Crystal Report, adding the
XML file under More Data Sources in the Database Expert.  The field
explorer listed the fields in the data set.  I designed the report.  I
then bind a populated ds to the report using Report.SetDataSource(ds).
 I also pass the report 2 parameters.  The report shows the parameters
but does not list the rows in the dataset.

I am using vb.Net 2003, Crystal Reports version 9.1.5000.0.

The code follows:
                Dim sales As New SJ
                Dim PFD As ParameterFieldDefinition
                Dim PValues As ParameterValues
                Dim Parm As ParameterDiscreteValue

                With oRequest
                    .CommandType = CommandType.Text
                    .Command = "SELECT * FROM AcctHist" & _
                       " JOIN company ON AC_CompCode = Comp_Code" & _
                       " JOIN Cont ON AC_ContNo = CN_ContNo" & _
                       " WHERE AC_CompCode = '" & mCompCode & _
                        "' AND AC_YYMM = '" & mYYMM & "'"
                        " ORDER BY CN_CustCode, AC_ContNO, AC_RD, " &
_
                        "AC_SubType, AC_LiftNo"
                    .TableName = "AcctHist"
                    .TableFill = "Fill"
                    .Transactional = False
                End With
                ds = GetData.GetDS(oRequest)
                Dim sss As Integer = ds.Tables(0).Rows.Count
                'XmlFile.CreateXmlFile("SalesJournal.ds", ds)

                PValues = New ParameterValues
                PFD =
sales.DataDefinition.ParameterFields.Item("CompCode")
                Parm = New ParameterDiscreteValue
                Parm.Value = mCompCode
                PValues.Add(Parm)
                PFD.ApplyCurrentValues(PValues)

                PFD =
sales.DataDefinition.ParameterFields.Item("YYMM")
                Parm = New ParameterDiscreteValue
                Parm.Value = mYYMM
                PValues.Add(Parm)
                PFD.ApplyCurrentValues(PValues)
                sales.SetDataSource(ds)
                CrystalReportViewer1.ReportSource = sales
                sales.Close()
                sales.Dispose()

The dataset has 33 rows.  Any ideas on why the rows are not listed on
the report.



Mon, 12 Dec 2005 11:12:20 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB .Net 2003 Standard or VS .Net 2003 Pro for Smart Devices

2. Visual Studio .NET 2003 and Crystal Report Deploy

3. Crystal Reports and asp.net (2003) help...

4. Help:Migrating reports from VB.Beta to VB.Net 2003

5. Difference between VB NET and VB NET 2003

6. VB.NET 2003 and Code Reports

7. MS Report - Things of interest to VB .NET Developers - January 27, 2003

8. vb.net 2002 or vb.net 2003 beta

9. Passing Dataset to Crystal Report in VB.Net

10. How can I add formula fields to a Crystal 9.x report with vb.2003

11. Sorting in Vb.net crystal reports dataset

12. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

 

 
Powered by phpBB® Forum Software