I'm trying to set parameters with print multiple in one go with different headings in rdlc report with VB.NET
I have the code below.
I tried with the code below which came out the result only COPY1
Please Guide me
Thanks
Thanks
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub original()
Dim table As New DataTable()
table.Columns.Add("value", GetType(String))
table.Columns.Add("price", GetType(String))
table.Columns.Add("quantity", GetType(Double))
table.Rows.Add("test1", "10", "20")
table.Rows.Add("test2", "10", "20")
Dim reportDataSource1 = New ReportDataSource("DataSet1", table)
Me.ReportViewer1.LocalReport.DataSources.Clear()
Dim reportParameters As New ReportParameterCollection()
reportParameters.Add(New ReportParameter("paramHeader", "ORIGINAL"))
Me.ReportViewer1.LocalReport.SetParameters(reportParameters)
Me.ReportViewer1.LocalReport.DataSources.Add(reportDataSource1)
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Datatable_in_ReportViewer.Report1.rdlc"
Me.ReportViewer1.RefreshReport()
End Sub
Private Sub copy1()
Dim table As New DataTable()
table.Columns.Add("value", GetType(String))
table.Columns.Add("price", GetType(String))
table.Columns.Add("quantity", GetType(Double))
table.Rows.Add("test1", "10", "20")
table.Rows.Add("test2", "10", "20")
Dim reportDataSource1 = New ReportDataSource("DataSet1", table)
Me.ReportViewer1.LocalReport.DataSources.Clear()
Dim reportParameters As New ReportParameterCollection()
reportParameters.Add(New ReportParameter("paramHeader", "COPY1"))
Me.ReportViewer1.LocalReport.SetParameters(reportParameters)
Me.ReportViewer1.LocalReport.DataSources.Add(reportDataSource1)
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Datatable_in_ReportViewer.Report1.rdlc"
Me.ReportViewer1.RefreshReport()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
original()
copy1()
End Sub
End Class
Parameter only have single value, you overwrite the second time you add.
Instead, you can try add a new column
Copysto group two data in same table, with valueORIGINALandCopy1You will need to edit the .rdlc report table and group it by the new column
Copys