Hi there -
I am using VB 2010 with 2013 Q3 reporting to generate a quick app that creates a report from a dataset created at runtime.
I followed the "best practices" in creating the solution; my UI app that contains the report viewer and a second project that contain the reports.
I create a dataset, datatable and manually add rows. I followed previous examples to assign the created dataset to the report, however when I view the report, no rows are displayed.
The datatable contains two columns named BinTextValue and BinBarcodeValue. On the report, the text fields value property is =Fields.[BinTextValue] and =Fields.[BinBarcodeValue].
Below is the code I am using to generate the dataset and set the datasource to the report. Please let me know what I am missing.
Thanks
Bob
Private Sub printBinLabels()
Dim rpt As New BarcodeReport
Dim rDS As New Telerik.Reporting.ObjectDataSource
rDS.DataSource = getBinLabels()
rDS.DataMember = "BinLabels"
' Print the labels
Dim report As New Report
report.DataSource = rDS
Dim reportSource As New InstanceReportSource
reportSource.ReportDocument = report
rpt.ReportViewer1.ReportSource = reportSource
rpt.ReportViewer1.RefreshReport()
rpt.ShowDialog()
End Sub
Private Function getBinLabels() As DataSet
Dim ds As New DataSet
ds.DataSetName = "BarCodeLabels"
Dim dt As New DataTable("BinLabels")
dt.Columns.Add("BinTextValue", GetType(String))
dt.Columns.Add("BinBarcodeValue", GetType(String))
For Each line In BinNumbersTextBox.Text.Split(CChar(vbCrLf))
If line.Trim.Length > 0 Then
dt.Rows.Add(line.ToString, line.Replace("-", ""))
End If
Next
ds.Tables.Add(dt)
Return ds
End Function
I am using VB 2010 with 2013 Q3 reporting to generate a quick app that creates a report from a dataset created at runtime.
I followed the "best practices" in creating the solution; my UI app that contains the report viewer and a second project that contain the reports.
I create a dataset, datatable and manually add rows. I followed previous examples to assign the created dataset to the report, however when I view the report, no rows are displayed.
The datatable contains two columns named BinTextValue and BinBarcodeValue. On the report, the text fields value property is =Fields.[BinTextValue] and =Fields.[BinBarcodeValue].
Below is the code I am using to generate the dataset and set the datasource to the report. Please let me know what I am missing.
Thanks
Bob
Private Sub printBinLabels()
Dim rpt As New BarcodeReport
Dim rDS As New Telerik.Reporting.ObjectDataSource
rDS.DataSource = getBinLabels()
rDS.DataMember = "BinLabels"
' Print the labels
Dim report As New Report
report.DataSource = rDS
Dim reportSource As New InstanceReportSource
reportSource.ReportDocument = report
rpt.ReportViewer1.ReportSource = reportSource
rpt.ReportViewer1.RefreshReport()
rpt.ShowDialog()
End Sub
Private Function getBinLabels() As DataSet
Dim ds As New DataSet
ds.DataSetName = "BarCodeLabels"
Dim dt As New DataTable("BinLabels")
dt.Columns.Add("BinTextValue", GetType(String))
dt.Columns.Add("BinBarcodeValue", GetType(String))
For Each line In BinNumbersTextBox.Text.Split(CChar(vbCrLf))
If line.Trim.Length > 0 Then
dt.Rows.Add(line.ToString, line.Replace("-", ""))
End If
Next
ds.Tables.Add(dt)
Return ds
End Function