none
wpf reportviewer ,setting datasource RRS feed

  • Question

  • hi The Reportviewer is Blank although  I have poulated values on it ,pls help me reg this

    hi My code follows

     private void PrepareReport()
            {
                this.mform_components = new System.ComponentModel.Container();
                Microsoft.Reporting.WinForms.ReportDataSource reportDataSource = new Microsoft.Reporting.WinForms.ReportDataSource();
                this.ProductBindingSource = new System.Windows.Forms.BindingSource(this.mform_components);
                ((System.ComponentModel.ISupportInitialize)(this.ProductBindingSource)).BeginInit();


                reportDataSource.Name = "demoCollection";
                reportDataSource.Value = LoadDataSource();

                this._reportViewer.LocalReport.DataSources.Add(reportDataSource);
                //this._reportViewer.LocalReport.ReportEmbeddedResource = "SpartanIMS.Invoice.InvoicePrint.rdlc";
                this._reportViewer.LocalReport.ReportEmbeddedResource = "SpartanIMS.Invoice.Report1.rdlc";
                ((System.ComponentModel.ISupportInitialize)(this.ProductBindingSource)).EndInit();
            }

            #region LoadDataSource
            private object LoadDataSource()
            {
                demoCollection demCollection = new demoBLL().SelectAllDemo();
                return demoCollection;
            }
            #endregion

     private void Window_Loaded(object sender, RoutedEventArgs e)
            {
                try
                {
                    PrepareReport();

                 }

                 catch (Exception ex)
                {
                    throw ex;
                }

    }

                     

    Efforts may fail but don't fail to take effort -------------- sidd

    • Moved by Sheldon _Xiao Tuesday, November 13, 2012 7:24 AM (From:Windows Presentation Foundation (WPF))
    Saturday, November 10, 2012 5:41 AM

All replies

  • Hi sidd123,

    i will move your thread to more approprate forum to get better answer.

    best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, November 13, 2012 7:25 AM