Hello,
I have created a simple report using the standalone report designer and saved it as a .trdx file.
Here is my code to generate a pdf file:
Reporting.Report report = new Reporting.Report();
Reporting.XmlReportSource xmlReportSource = new Reporting.XmlReportSource();
// simple text box (Test2) in a report header
xmlReportSource.Xml = @"<?xml version='1.0' encoding='utf-8'?>
<Report Width='6.5in' Name='Report2' xmlns='http://schemas.telerik.com/reporting/2012/3.7'>
<Items>
<PageHeaderSection Height='0.200039307276408in' Name='pageHeaderSection1' />
<DetailSection Height='0.299960772196452in' Name='detailSection1' />
<PageFooterSection Height='1in' Name='pageFooterSection1' />
<ReportHeaderSection Height='1in' Name='reportHeaderSection1'>
<Items>
<TextBox Width='1.20000016689301in' Height='0.19999997317791in' Left='2.64583333333333in' Top='0.395833333333333in' Value='Test2' Name='textBox1' />
</Items>
</ReportHeaderSection>
</Items>
<StyleSheet>
<StyleRule>
<Style>
<Padding Left='2pt' Right='2pt' />
</Style>
<Selectors>
<TypeSelector Type='TextItemBase' />
<TypeSelector Type='HtmlTextBox' />
</Selectors>
</StyleRule>
</StyleSheet>
<PageSettings>
<PageSettings PaperKind='Letter' Landscape='False' ColumnCount='1' ColumnSpacing='0in'>
<Margins>
<MarginsU Left='1in' Right='1in' Top='1in' Bottom='1in' />
</Margins>
</PageSettings>
</PageSettings>
</Report>";
report.DataSource = xmlReportSource;
Processing.ReportProcessor reportProcessor = new Processing.ReportProcessor();
Reporting.InstanceReportSource instanceReportSource = new Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;
File.WriteAllBytes(fileName, reportProcessor.RenderReport("PDF", instanceReportSource, null).DocumentBytes);
File created successfully, but it's empty, althogh report designer previews report properly.
What am I doing wrong?
I use Telerik.Reporting, Version=8.2.14.1222
Thanks in advance
Michael