Passing datagridview table to report viewer doesn't work

  • Thread starter Thread starter Amr_Aly
  • Start date Start date
A

Amr_Aly

Guest
Hi everybody ,

I have some code for pagination DGV , It is working properly ..But recently i need to pass the DGV table to a report viewer

After searching on the web i found a snippet to do this job but with some error .. Like the Report viewer show the table header only without data or some columns only,This is my code to passing DGV table to Report viewer

Form8.ReportViewer1.LocalReport.DataSources.Clear()
Form8.ReportViewer1.LocalReport.ReportPath = Path.Combine(Application.StartupPath, "Report1.rdlc")

Dim rds = New ReportDataSource("DataSet1", DataGridView1.DataSource)
Form8.ReportViewer1.LocalReport.DataSources.Add(rds)

'Form8.ReportViewer1.Refresh()
'Form8.ReportViewer1.LocalReport.Refresh()
'Form8.ReportViewer1.RefreshReport()

If Form8.ShowDialog() = DialogResult.OK Then
Else
End If
Form8.Dispose()

I enabled to fix that by filling the DGV again before going to the report viewer , It is OK for a DGV with one page but if i have more than one page the first page only pass

I tried to use the pagination code to solve the issue but i failed ..It has a Clone Datatable called "dtsource" in order to clone a main datatable to make pages to the DGV.

I tried to put it in this line (New ReportDataSource("DataSet1", dtsource)) but i failed also

Any Help,,,,,,,,,,,,, Thanks




Regards From Egypt

Continue reading...
 
Back
Top