or
Order tempOrder =
new
Order(
"12345"
,
"Mr Test"
);
Telerik.Reporting.Report report =
new
Telerik.Reporting.Report();
report.DataSource = tempOrder;
System.Collections.Hashtable deviceInfo =
new
System.Collections.Hashtable();
UriReportSource reportSource =
new
UriReportSource();
reportSource.Uri = @
"E:\Program Files (x86)\Telerik\Reporting Q2 2014\Report Designer\Examples\Order.trdx"
;
Telerik.Reporting.Processing.ReportProcessor reportProcessor =
new
Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport(
"PDF"
, reportSource, deviceInfo);
string
fileName = result.DocumentName +
"."
+ result.Extension;
string
path = System.IO.Path.GetTempPath();
string
filePath = System.IO.Path.Combine(path, fileName);
using
(System.IO.FileStream fs =
new
System.IO.FileStream(filePath, System.IO.FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
}
@{
var reportSource = new UriReportSource() {
Uri = Url.Content("EligibilitySummary.trdx")
};
reportSource.Parameters.Add(new Parameter("clientID", Clients.GetByAuthenticatedUser().ClientID));
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl(Url.Content("/api/reports/"))
.TemplateUrl(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.618.html"))
.ReportSource(reportSource)
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false));
}