Niranjan Poddar

Niranjan Poddar

  • 1.1k
  • 648
  • 96.4k

SSRS Local Report(RDLC)

Aug 18 2014 4:39 AM
Report not display .................
Reportviewer used.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath ( "ReportFin.rdlc" );
            DataSet_Test objds = GetData ( "select * from VIEW_ARG_STATISTCS_DTL" );
            ReportDataSource datasource = new ReportDataSource ( "DataSet_Test", objds.Tables[0] );
            ReportViewer1.LocalReport.DataSources.Clear ( );
            ReportViewer1.LocalReport.DataSources.Add ( datasource );
           
        }
    }


 public DataSet_Test GetData (string Query )
    {
        string ConStr = "server=VALUED-786D678H; database=DES_WEB; uid=***; pwd=*****";
        SqlCommand cmd = new SqlCommand ( Query );
        using ( SqlConnection con = new SqlConnection ( ConStr ) )
        {
            using ( SqlDataAdapter da = new SqlDataAdapter ( ) )
            {
                cmd.Connection = con;
                da.SelectCommand = cmd;
                using ( DataSet_Test dsTest = new DataSet_Test ( ) )
                {
                    da.Fill ( dsTest, "DataTable1" );
                    return dsTest;
                }
            }
        }
    }

in source page---
     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <asp:Button ID="btnRetrive" runat="server" Text="Retrive" Width="70px" OnClick="btnRetrive_Click" />
        <rsweb:ReportViewer ID="ReportViewer1" runat="server"></rsweb:ReportViewer>
    </div>
error-data source instance has not been supplied for the data source 'DataSet1'.

Please anyone help me.................
why this error ?


thanks in adv........



Answers (1)