Cloud
Cloud-Dienstleistung für schnelle und effektive Analyse und Visualisierung von Daten für Ihr Business ohne eigene Applikationen zu erstellen oder zu programmieren.
StiNetCoreReportResponse class that implements the methods for report exporting and printing. These methods take the input of all the necessary parameters to configure exporting and printing the report.StiNetCoreReportResponse class contains methods to export report in any format and print report to PDF and HTML. For example, implementing it for one report in order to compare them. Add two links for each print mode and three links for various export formats:
<div class="row">
<div class="col-md-4">
<h2>Print to PDF</h2>
<p>@Html.ActionLink("Print", "PrintPdf")</p>
</div>
<div class="col-md-4">
<h2>Print to HTML</h2>
<p>@Html.ActionLink("Print", "PrintHtml")</p>
</div>
</div>
<hr />
<div class="row">
<div class="col-md-4">
<h2>Export to PDF</h2>
<p>@Html.ActionLink("Export", "ExportPdf")</p>
</div>
<div class="col-md-4">
<h2>Export to HTML</h2>
<p>@Html.ActionLink("Export", "ExportHtml")</p>
</div>
<div class="col-md-4">
<h2>Export to Excel</h2>
<p>@Html.ActionLink("Export", "ExportXls")</p>
</div>
</div>
GetReport() method was used. This method loads the report template, loads the XML data file and registers this data for loaded report:
private StiReport GetReport()
{
var reportPath = StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt");
var report = new StiReport();
report.Load(reportPath);
return report;
}
PrintPdf and PrintHtml:
public IActionResult PrintPdf()
{
var report = this.GetReport();
return StiNetCoreReportResponse.PrintAsPdf(report);
}
public IActionResult PrintHtml()
{
var report = this.GetReport();
return StiNetCoreReportResponse.PrintAsHtml(report);
}
ExportPdf, ExportHtml, and ExportXls. These export formats are taken for example. Also, the methods of exporting a report (and printing) can take, as input, export settings and other necessary parameters:
public IActionResult ExportPdf()
{
var report = this.GetReport();
return StiNetCoreReportResponse.ResponseAsPdf(report);
}
public IActionResult ExportHtml()
{
var report = this.GetReport();
return StiNetCoreReportResponse.ResponseAsHtml(report);
}
public IActionResult ExportXls()
{
var report = this.GetReport();
return StiNetCoreReportResponse.ResponseAsXls(report);
}