Cloud
Облачный сервис для быстрого и эффективного анализа и визуализации данных для вашего бизнеса без необходимости создания своих приложений и программирования.
StiNetCoreReportResponse class. This class implements the static methods for dashboard exporting and printing that take the input of all the necessary parameters for configuration. For example, add a link for print 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>
<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 Excel</h2>
<p>@Html.ActionLink("Export", "ExportExcel")</p>
</div>
<div class="col-md-4">
<h2>Export to Image</h2>
<p>@Html.ActionLink("Export", "ExportImage")</p>
</div>
</div>
GetDashboard() method was used. This method creates the new dashboard object and loads the dashboard template from the file:
private StiReport GetDashboard()
{
var reportPath = StiNetCoreHelper.MapPath(this, "Dashboards/DashboardChristmas.mrt");
var report = StiReport.CreateNewDashboard();
report.Load(reportPath);
return report;
}
PrintPdf method:
public IActionResult PrintPdf()
{
var report = this.GetDashboard();
return StiNetCoreReportResponse.PrintAsPdf(report);
}
ExportPdf, ExportExcel, and ExportImage. These export formats are taken for example. Also, the methods of exporting a dashboard (and printing) can take, as input, export settings and other necessary parameters:
public IActionResult ExportPdf()
{
var report = this.GetDashboard();
return StiNetCoreReportResponse.ResponseAsPdf(report);
}
public IActionResult ExportExcel()
{
var report = this.GetDashboard();
return StiNetCoreReportResponse.ResponseAsExcel2007(report);
}
public IActionResult ExportImage()
{
var report = this.GetDashboard();
return StiNetCoreReportResponse.ResponseAsPng(report);
}