This is a migrated thread and some comments may be shown as answers.
help using reporttypesource with report book
1 Answer 22 Views
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 10 Jul 2018, 10:30 AM

      Hi, 

 

I am trying to show multiple reports in a reportbook object in WPF

However , I do not get any ReportSources Collection on my reportbook object , only the reports collection.    When I try to use report instead of TypeReportSource it tells me Report is obsolete and I must use ReportSource .  I have a standard WPF window, with a reportviewer object but now I want to use a reportbook object to show multiple reports.

 

var reportViewerWnd = new ReportBookViewerWnd();
            var report = new Telerik.Reporting.Report();

            var reportBook = new Telerik.Reporting.ReportBook();

            var typeReportSource = new Telerik.Reporting.TypeReportSource();
            typeReportSource.TypeName = "Schedwin.Reports.Tickets.PassengerTickets, Schedwin.Reports.Telerik";
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("ReservationIDX", ReservationIDX));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("ReservationName", ReservationName));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("PaxName", PaxName));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("TicketNo", TicketNo));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("IssuedBy", IssuedBy));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("IssuedDate", IssueDate));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("IssuePlace", IssuePlace));
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("RegionalDBName", DatabaseName));
       
   

            reportBook.Reports.Add(typeReportSource);

            reportViewerWnd.ReportViewer.ReportSource = reportBook;
            reportViewerWnd.Title = "Passenger Ticket";

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 10 Jul 2018, 03:13 PM
Hello Chris,

The ReportBook object has a ReportSources collection as shown in our API reference: ReportBook.ReportSources Property.

If this property is not found in your application it means that you are using an older version of Telerik Reporting. In older versions of the product it is required to add report instances directly to the ReportBook.Reports Property [Obsolete].

Regards,
Nasko
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Asked by
Chris
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or