Posted 13 July 2022, 3:08 am EST
Hi, here the code.
In the report the a4 format is set, in the PDF the dimension is set to 280x396mm.
Any suggest?
Regards
C1FlexReport report = new();
report.Load(filePathName, reportName);
foreach (DataSource dataSource in report.DataSources)
{
dataSource.DataProvider = DataProvider.OLEDB;
dataSource.RecordSource = recordSource ?? string.Empty;
dataSource.RecordSourceType = recordSourceType ?? RecordSourceType.Auto;
}
SetupConnectionString(report, oleDbConnectionString);
await report.GenerateAsync();
await report.RenderAsync();
PdfFilter filter = new()
{
Stream = new MemoryStream(),
DocumentInfo = new DocumentInfo
{
Author = "MANDO",
CreationTime = DateTime.Now,
RevisionTime = DateTime.Now,
Creator = "MANDO",
Title = toPdfFileName
},
PageSettings = new C1PageSettings
{
Landscape = false,
PaperSize = PaperKind.A4
},
FileName = toPdfFileName,
PdfACompatible = true,
Preview = true
};
await report.RenderToFilterAsync(filter);
return ((MemoryStream)filter.Stream).ToArray();