11 Answers, 1 is accepted
We have already received and logged a number of similar request so I hope we will soon have the chance to work on this.
Regards,
Svetoslav
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
![](/forums/images/avatarimages/default.gif)
We haven't had the time to work on this functionality yet, and it is still in our TODO list.
Sorry for the temporary inconvenience.
All the best,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
![](/forums/images/avatarimages/default.gif)
what is the continuation of this topic?
Jola
You can combine multiple reports into a single document or to combine multiple instances of the same report with different settings into a single document for preview, print and export. In both cases, the solution would be to create a ReportBook.
For more information, please check the following articles:
- Report Book report template
- How to: Create a Report Book at run-time
An example is provided in ReportBook.cs file located in product installation folder (C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Examples\CSharp\ReportLibrary\ReportBook).
Best Regards,
Silviya
Progress Telerik
![](/forums/images/avatarimages/default.gif)
I don't have this example on my computer: (C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Examples\CSharp\ReportLibrary\ReportBook). Is there any way to get this example?
I have not practise in configuring ReportViewer.html. I need strict example, then I can work further. Would you help?
Greetings,
Jola
![](/forums/images/avatarimages/default.gif)
I have finally found a place in report resolver, where I can replace report source of single report with ReportBook.
But, what I have no idea, how to approach, is:
how can I get parameters of report in that place?
One of the report parameter is set to multivalue=true and I transmit int[].
For each of this array element, I want to generate report using same report file, but just with particular int parameter.
I hope for your help.
Jola
![](/forums/images/avatarimages/default.gif)
Hi, will you help me finally?
Using your advices, I menaged this:
01.
protected
override
ReportSource ResolveReport(
string
report)
02.
{
03.
var massReportParams = report.Split(
'|'
);
04.
report = massReportParams[0];
05.
06.
if
(report.StartsWith(_startsWithValue))
07.
{
08.
report = massReportParams[0].Replace(_startsWithValue, _customReportsPath);
09.
}
10.
11.
var book =
new
ReportBook();
12.
for
(var i = 0; i <
int
.Parse(massReportParams[1]); i++)
13.
{
14.
var resolvedReport =
base
.ResolveReport(report);
15.
book.ReportSources.Add(resolvedReport);
16.
}
17.
return
new
InstanceReportSource { ReportDocument = book };
18.
}
And
$("#reportViewer1")
.telerik_ReportViewer({
serviceUrl: "api/reports",
templateUrl: 'ReportViewer/templates/telerikReportViewerTemplate-FA.html',
reportSource: {
report: reportName + "|5"
},
And, now, goint into my report, I can create 5 same reports at once.
What I need is:
Read somewhere, (I thought in ReportViewer.html), report parameter name = 'myParameter1_MassReporting"
which is set (in trdx) as multiValue = true, the count of selected items of this parameter. And this value, named parameter1ItemsSelectedCount, put instead of the hardcoded 5 (report: reportName + "|5").
Then, I get as many reports printed, as many items of this multiValue parameter I selected.
The next, I want to put values of selected items into report parameter named myParameter1, which has multiValue set to false.
Each of the report instance should get particular value of seleted item.
Whould you help me this time?
Jola
Our examples are shipped with the installation of Telerik Reporting: Installing Telerik Reporting (step 2). YOu might have changed the default installation path. Please check where the Telerik Reporting is installed on your machine.
The parameters for the report book can be passed with the report source object as a string because inside a custom report resolver you will get only a reportId argument. To make this clear let's look at an example.
Let say we have one Dashboard report and we need to create a report book with two instances if this report with two different parameter values. For example, to provide 2001 as a value of the first report and 2002 as a value of the second report. Then in HTML5 report viewer pass all of the information in reportSource.report like:
<script type=
"text/javascript"
>
$(
"#reportViewer1"
)
.telerik_ReportViewer({
serviceUrl:
"/api/reports/"
,
reportSource: {
report:
"RestService1.Reports.MyReportBook, RestService1@2001@2002"
,
parameters: { }
}
});
</script>
if
(reportId.StartsWith(
"RestService1.Reports.MyReportBook, RestService1"
))
{
// parse the string to retrieve the parameter values
String[] instring = reportId.Split(
'@'
);
var reportName = instring[0];
// RestService1.Reports.MyReportBook, RestService1
var param1 = instring[1];
// "2001"
var param2 = instring[2];
// "2002"
// Creating a new report book
var reportBook =
new
MyReportBook();
//Note: Adding the reports as UriReportSource
//Add first report
var firstReportSource =
new
UriReportSource();
firstReportSource.Uri =
"Reports\\Dashboard.trdp"
;
firstReportSource.Parameters.Add(
"ReportYear"
, param1);
reportBook.ReportSources.Add(firstReportSource);
//Add second report
var secondReportSource =
new
UriReportSource();
secondReportSource.Uri =
"Reports\\Dashboard.trdp"
;
secondReportSource.Parameters.Add(
"ReportYear"
, param2);
reportBook.ReportSources.Add(secondReportSource);
//Return the new instance
var result =
new
InstanceReportSource { ReportDocument = reportBook };
return
new
Telerik.Reporting.InstanceReportSource { ReportDocument = reportBook };
}
else
...
Note that the parameter values passed directly from the viewer's ReportSource are applied to the report automatically by the Reporting Engine (by matching parameters' names) and cannot be accessed in the report resolver. Therefore, when creating ReportBook in a Custom Report Resolver it is necessary to pass the parameter values as part of the viewer's reportSource.report property.
I hope this helps.
Best Regards,
Silviya
Progress Telerik
![](/forums/images/avatarimages/default.gif)
Thank you for your answer. This example I understand well, and it works.
(Although I thought, it is not necessary to pass the parameters to resolver, but only the count of parameters and then in reportViewer fill the parameters.
But the main problem is: you have all the time static examples.
What I need and described one by one is:
1). I need to write a reportViewer function, in which I obtain my multiValue myParameter1 and I return the count of it. (THIS I DO NOT KNOW HOW TO APROACH)
2). I pass this count to resolver and for this count I produce this count of report instances. (this point I can do)
3). Again in reportViewer, parameter editor, I pass the particular multiValues to particular report instances. (this I potentially can do).
As result, I get the count number of same report generated, each one has its own parameter.
You static example does not solve my problem.
Jola Krawczyk
Indeed, often we provide static examples as they most clearly demonstrate the functionality of the reporting tool, e.g. there is less additional logic that is not relevant to the product.
Consider also sending a runnable project that demonstrates the scenario so that we can try to come up with a more particular example.
Neli
Progress Telerik