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.
[HttpGet]
public IActionResult Get(string reportName, string format = "pdf")
{
var report = new StiReport();
report.Load(Path.Combine("Reports", reportName + ".mrt"));
report.Render(false);
var stream = new MemoryStream();
switch (format)
{
case "pdf":
report.ExportDocument(StiExportFormat.Pdf, stream);
return File(stream.ToArray(), "application/pdf");
case "excel":
report.ExportDocument(StiExportFormat.Excel2007, stream);
return File(stream.ToArray(), "application/vnd.ms-excel");
default:
return Content($"Format [{format}] is not supported!");
}
}[HttpGet] Get(reportName, format) — an API endpoint taking the template name and desired format.ExportDocument(format, stream) + File(bytes, mime) — render, then return the document with the right content type.