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

Couldn't find the ReportBook control in TelerikReporting Q1 2014

1 Answer 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kunal Bagga
Top achievements
Rank 1
Kunal Bagga asked on 07 May 2014, 04:01 AM
I am using 8.0.14.225 version of Telerik.Reporting Dll. For one of our requirements we need to use Telerik Report Books. I couldn't find the ReportBook control in my report tool box and I couldn't find the Telerik.Reporting.ReportBook dll in the folder where I installed my Telerik. For your convenience, I have attached my recent ToolBox list. Can you guys help me with this

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 09 May 2014, 03:06 PM
Hello Kunal,

The Report Book is not a report item and as such it doesn't have a corresponding Toolbox item. In order to use it you have to create a new report book object in your application, add reports to the object's report collection, and then display it in the Report Viewer.

You can gather multiple reports in a Report Book, which will be displayed and processed as a single document at once. The Report Book online documentation can be found here: Report Book help. There you can find general information on how to use a Report Book, what is its purpose and some specific things like paging and passing parameters. There is also a section describing how to use the Report Book at run-time. This is the part that can be useful when the component is used within your application.

In the following code snippet a Report Book is created and a report is assigned to it and this is done in the application. The developer has the option to modify the report definitions/data sources etc., before adding it to the Report Book:

Using a class containing the report definition:
var reportBook = new ReportBook();
     
var report1 = new MyReport();
reportBook.Reports.Add(report1);

Using xml report definition (.trdx):
var reportBook = new ReportBook();
     
var report1 = DeserializeReport("MyReport.trdx");
reportBook.Reports.Add(report1);
    
//where the DeserializeReport method's definition is:
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;
    }
}

Then you can display the Report Book item by assigning it to a Report Viewer as you'd do with any normal report:
var instanceReportSource = new InstanceReportSource();
instanceReportSource.ReportDocument = reportBook;
this.ReportViewer1.ReportSource = instanceReportSource;

Additionally, you may find useful the Report Book demo located in the C:\Program Files (x86)\Telerik\Reporting <version>\Examples\CSharp\ReportLibrary\ReportBook folder on your machine.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Kunal Bagga
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or