This is a migrated thread and some comments may be shown as answers.

Help me use ReportBook?

2 Answers 110 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 29 Jun 2011, 05:38 PM
   private void btnInHDGTGT_Click(object sender, RoutedEventArgs e)
        {
                //this is create ReportBook
                ReportBook book = new ReportBook();


                //create ReportViewer add to control Wpf of WinReport.xaml
                WinReport WinReport = new WinReport();

                //foreach in grvOrder get order (master) => orderDetails
                foreach (Order order in grvOrder.Items)
                {
                    //Create list orderDetails
                    List<OrderDetail> listOrderDetails = new List<OrderDetail>();
                    foreach (OrderDetail OrderDetail in order.OrderDetails)
                    {
                        //add all orderdetails to listOrderDetails
                        listOrderDetails.Add(OrderDetail);
                    }

                    //this is a template of report RptOrderGTGTDemo.cs ==> container information orderDetails show report
                    RptOrderGTGTDemo RptOrderGTGT = new RptOrderGTGTDemo();
                  
                    //add source to report item
                    RptOrderGTGT.Report.DataSource = listOrderDetails;
                    
                    //add multiple report item to reportbook
                    book.Reports.Add(RptOrderGTGT);
                }
               
            //out of foreach add report to ReportViewer
                WinReport.rptReport.Report = book;
                WinReport.ShowDialog();
            }
----------------------
an error : System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.ReportViewer.Wpf.ReportViewerModel.Print()
   at Telerik.ReportViewer.Wpf.ReportViewerModel.PrintReportCommandImpl.Execute(Object parameter)
   at Telerik.ReportViewer.Wpf.ReportViewerModel.Command.System.Windows.Input.ICommand.Execute(Object parameter)
thanks!
         

2 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 01 Jul 2011, 03:56 PM
Hi Peter,

How to create a report book is elaborated in the following help resource:Report book

We were not able to reproduce the problem if we try to create our own custom reports. We would appreciate if you provide us with a sample report that shows this problem.

Thank you in advance!

Kind regards,
Hristo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
answered on 01 Jul 2011, 04:07 PM
thanks! i will sent you demo...later
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Peter
Top achievements
Rank 1
Share this question
or