Quantcast
Channel: Visual Studio Report Controls Forum
Viewing all articles
Browse latest Browse all 519

wpf reportviewer ,setting datasource

$
0
0

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


Viewing all articles
Browse latest Browse all 519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>