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

Is it possible to do multiple reports on tabs in a single Telerik report?

11 Answers 608 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 04 Nov 2013, 09:40 PM
Hi.  Fairly new to Telerik, using Telerik Q3 2012 on a Win 7 64 bit machine running Visual Studios 2010.  Is it possible to put a tab grid on the report canvas so that multiple reports can be created, each on it's own tab, but all in a single Telerik report?
Thanks,
Kevin

11 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 07 Nov 2013, 01:08 PM
Hi Kevin,

The report definition can contain only reporting items, and the ReportViewer control purpose is just to display that report document and provide means to interact with it. You can place a separate ReportViewer in distinct tabs or display multiple reports at once gathered in a ReportBook. An example of ReportBook can be found in the online demos and the local demos, placed by default under C:\Program Files (x86)\Telerik\Reporting <VERSION>\Examples.

Let us know if you have any further questions.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Mustafa
Top achievements
Rank 1
answered on 27 Nov 2013, 07:33 AM
Hi Stef,

I looked over ReportBook example and I want to use Telerik Designer(.trdx) reports.  Is it possible? If so how can i implement it ?

i tried my chance like that but it didn't worked :)
this.Reports.Add(new UriReportSource() { Uri = @"C:\Users\mustafa\Documents\Visual Studio 2012\Projects\OnlineKursKayit\OnlineKursKayit\ReportBook\ReportBook.cs" });

Thanks
Mustafa
0
Nasko
Telerik team
answered on 29 Nov 2013, 04:05 PM
Hello Mustafa,

Yes, you can use .trdx files with ReportBook. You should deserialize the .trdx files and add the report instances to ReportBook. For more information see the Serializing Report Definition in XML help article.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Mustafa
Top achievements
Rank 1
answered on 09 Dec 2013, 01:06 PM
Hi Nasko,
Thanks for reply,
I couldn't manage to do that, would you please give an example code part or a sample project?

Regards,
Mustafa
0
Nasko
Telerik team
answered on 12 Dec 2013, 12:15 PM
Hello Mustafa,

The following sample code demonstrates how to combine trdx reports in a single ReportBook instance:
public class ReportBook : Telerik.Reporting.ReportBook
{
    public ReportBook()
    {
        Report report1 = DeserializeReport(@"Report1.trdx");
        this.Reports.Add(report1);
  
        Report report2 = DeserializeReport(@"Report2.trdx");
        this.Reports.Add(report2);  
    }
  
    public Report DeserializeReport(string path)
    {
        System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
        settings.IgnoreWhitespace = true;
  
        using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(path, settings))
        {
            Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
            Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
 
            return report;
        }
    }
}


Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Mustafa
Top achievements
Rank 1
answered on 06 Jan 2014, 12:25 PM
Hi Nasko

I've tried your solution for days.I took "Format of the initialization string does not conform to specification starting at index 0" error . Finally I fixed it. But now; toggle document map button is not active. Instead of it, first report shown in first page, second report shown in second page

And also SubReport path normally "C:\Users\mustafa\Desktop\Reports(trdx)\SubReport.trdx" but in running time it give an error that
"An error has occurred while processing SubReport 'subReport1': 'C:\Program Files (x86)\IIS Express\SubReport.trdx' file can not found."

Have you an idea about these two problems?

Thanks,
Mustafa
0
Stef
Telerik team
answered on 09 Jan 2014, 11:36 AM
Hello Mustafa,

Each report in the ReportBook starts on a new page. You can still use the Document Map feature by specifying the DocumentMap property for each report in the book.
About paths to sub reports, double-check if the URI of the UriReportSource is set to an absolute path. If not the path will be resolved based on the start application. You can edit paths at run-time as well, by obtaining the SubReport item and resetting its ReportSource e.g.:
Report report1 = DeserializeReport(@"Report1.trdx");
var subreport = report1.Items.Find("subReport1",true)[0] as SubReport;
(subreport.ReportSource as UriReportSource).Uri = newUri;
 this.Reports.Add(report1);

Let us know if you have any further questions.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Mustafa
Top achievements
Rank 1
answered on 09 Jan 2014, 12:09 PM
Hi Stef,
Thanks for subreport solution, it works very well.

But I don't know why, Toggle Document Map Button is inactive

http://i40.tinypic.com/7148ie.png (capture of the screen )
0
Mustafa
Top achievements
Rank 1
answered on 09 Jan 2014, 12:10 PM
Hi Stef,
Thanks for subreport solution, it works very well.

But I don't know why, Toggle Document Map Button is inactive

http://i40.tinypic.com/7148ie.png (capture of the screen )

Regards,
Mustafa
0
Stef
Telerik team
answered on 09 Jan 2014, 12:57 PM
Hello Mustafa,

Check if you have set each report's DocumentMap property to a string that will be displayed beside and used for navigation within the viewer.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Mustafa
Top achievements
Rank 1
answered on 15 Jan 2014, 07:57 AM
Hi Stef,
Thanks for your answers. They all worked and  you helped me a lot.
Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 1
Answers by
Stef
Telerik team
Mustafa
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or