This commit is contained in:
2025-04-30 18:04:10 +03:30
committed by alibw
commit de7f960603
8 changed files with 160 additions and 0 deletions

21
PdfService/Reporter.cs Normal file
View File

@@ -0,0 +1,21 @@
using Stimulsoft.Report;
using Stimulsoft.Report.Export;
namespace PdfService;
public static class Reporter
{
public static Stream Print(string reportTemplate, object data)
{
var report = new StiReport();
report.LoadFromString(reportTemplate);
report.RegBusinessObject("Data", data);
report.Render(false);
var stream = new MemoryStream();
report.ExportDocument(StiExportFormat.Pdf ,stream);
stream.Position = 0;
return stream;
}
}