0

I'm using Dynamic DataSet (NewDs) which is connected with datatable(xtbl) but Reportviewer Shows Rows without Text here is my code, Any Problem???

    Dim f4 As New Form4 
    Dim ds2 As New NewDS   ***NewDS=Dataset

    Dim xtbl As New DataTable
    
    xtbl = CType(DgvEmp.DataSource, DataTable)
    ds2.Reset
    ds2.DataSetName = "newTable"
    'xtbl.TableName = "DSxtbl"
    ds2.Tables.Add(xtbl.Copy)
    ds2.Tables(0).TableName="DT"
    Dim rds As New ReportDataSource(ds2.Tables(0).TableName ,ds2.Tables(0) ) 
    f4.reportViewer1.ProcessingMode = ProcessingMode.Local
    f4.ReportViewer1.LocalReport.DataSources.Clear
    f4.ReportViewer1.LocalReport.Refresh
    f4.ReportViewer1.LocalReport.DataSources.Add(rds)
    f4.ReportViewer1.LocalReport.ReportEmbeddedResource="EmployeeBouncer.Report2.rdlc"

    f4.ReportViewer1.LocalReport.Refresh
    f4.ReportViewer1.Refresh
    f4.ReportViewer1.RefreshReport
    
    f4.Show

1 Answers1

0

try with below code

Dim f4 As New Form4 
    Dim ds2 As New NewDS   ***NewDS=Dataset
    Dim xtbl As New DataTable    
    xtbl = CType(DgvEmp.DataSource, DataTable)
    ds2.Tables.Add(xtbl)
f4.ReportViewer1.LocalReport.ReportEmbeddedResource="EmployeeBouncer.Report2.rdlc"
  Dim rds As New ReportDataSource("dt",ds2.Tables(0)) // Dataset name "dt" should be same as in rdlc file.
  f4.reportViewer1.ProcessingMode = ProcessingMode.Local
  f4.ReportViewer1.LocalReport.DataSources.Clear
  f4.ReportViewer1.LocalReport.DataSources.Add(rds)  
  f4.ReportViewer1.LocalReport.Refresh
  f4.ReportViewer1.RefreshReport
 ~~~