Hello,
I'm currently dynamically generating a Telerik Report in PDF format into a new window by writing the bytes to the response as seen below.
BusinessClass:
Telerik.Reporting.Report report = GenerateInspection(formDTO,
"DCF"
, lastSection);
Telerik.Reporting.Processing.ReportProcessor processor =
new
Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.InstanceReportSource irs =
new
Telerik.Reporting.InstanceReportSource();
irs.ReportDocument = report;
Telerik.Reporting.Processing.RenderingResult result = processor.RenderReport(
"PDF"
, irs,
null
);
return
result;
And in the controller:
InspectionRules ir =
new
InspectionRules();
//my business class
var result = ir.GetReport(id, WebSettings.GetDCFConnectionString, site);
this
.Response.Clear();
this
.Response.ContentType = result.MimeType;
this
.Response.Cache.SetCacheability(HttpCacheability.Private);
this
.Response.Expires = -1;
this
.Response.Buffer =
true
;
this
.Response.BinaryWrite(result.DocumentBytes);
this
.Response.End();
return
View();
This is producing a nice PDF report in a new window. However requirements now dictate for me to have additional UI elements around and in some case overlayed the report. My question is what is the best way to go about this? Do I need the HTML 5 Report Viewer? Is there a simple solution? I must have a portion that on hover overlays a div over the report with controls in it. Note that in my view/test below the <h1> does not display. Thanks for any help or suggestions!
My View:
@{
Layout = null;
}
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
name
=
"viewport"
content
=
"width=device-width"
/>
<
title
>Inspection Report</
title
>
</
head
>
<
body
>
<
div
id
=
"reportViewer1"
class
=
"k-widget"
>
loading...
</
div
>
<
div
>
<
h1
>THIS IS A TEST</
h1
>
</
div
>
</
body
>
</
html
>