При экспорте отчета в пдф используется следующий код:
Код: Выделить всё
private ReportContent GetPdfReport(StiReport stiReportWithoutRender)
{
var result = new ReportContent()
{
FileName = stiReportWithoutRender.ReportName + ".pdf",
MimeType = "application/pdf"
};
using (var stream = new MemoryStream())
{
var settings = new StiPdfExportSettings();
settings.ImageResolution = 100;
settings.ImageResolutionMode = StiImageResolutionMode.Auto;
settings.ImageQuality = 1F;
settings.ImageCompressionMethod = StiPdfImageCompressionMethod.Flate;
var service = new StiPdfExportService();
service.ExportPdf(stiReportWithoutRender, stream, settings);
result.Content = stream.ToArray();
}
return result;
}
...
public class ReportContent
{
public string MimeType { get; set; }
public string FileName { get; set; }
public byte[] Content { get; set; }
public byte[] TemplateContent { get; set; }
public byte[] SerializedData { get; set; }
public byte PageCount { get; set; }
}