Code is below, any help is greatly appreciated.
private Telerik.Reporting.Report GetPlainReport(bool showPageCountFooter = true)
{
Telerik.Reporting.
Report report = new Telerik.Reporting.Report();
report.PageSettings.Landscape =
false;
report.PageSettings.Margins.Bottom =
new Telerik.Reporting.Drawing.Unit(2.5D, Telerik.Reporting.Drawing.UnitType.Cm);
report.PageSettings.Margins.Left =
new Telerik.Reporting.Drawing.Unit(2.5D, Telerik.Reporting.Drawing.UnitType.Cm);
report.PageSettings.Margins.Right =
new Telerik.Reporting.Drawing.Unit(2.5D, Telerik.Reporting.Drawing.UnitType.Cm);
report.PageSettings.Margins.Top =
new Telerik.Reporting.Drawing.Unit(2.5D, Telerik.Reporting.Drawing.UnitType.Cm);
report.PageSettings.PaperKind = System.Drawing.Printing.
PaperKind.A4;
Telerik.Reporting.
PageHeaderSection header = new Telerik.Reporting.PageHeaderSection();
header.Height =
new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
Telerik.Reporting.
TextBox txtTitle = new Telerik.Reporting.TextBox();
txtTitle.Location =
new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm));
txtTitle.Name =
"htmlTitle";
txtTitle.Style.Font.Bold =
true;
txtTitle.Style.Font.Name =
"Arial";
txtTitle.Style.Font.Size =
new Telerik.Reporting.Drawing.Unit(16D, Telerik.Reporting.Drawing.UnitType.Point);
txtTitle.Style.TextAlign = Telerik.Reporting.Drawing.
HorizontalAlign.Left;
txtTitle.Size =
new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(16D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm));
txtTitle.Value =
"{Parameters.Title.Value}";
header.Items.Add(txtTitle);
Telerik.Reporting.
DetailSection body = new Telerik.Reporting.DetailSection();
body.Height =
new Telerik.Reporting.Drawing.Unit(22.5D, Telerik.Reporting.Drawing.UnitType.Cm);
Telerik.Reporting.
HtmlTextBox htmlBody = new Telerik.Reporting.HtmlTextBox();
htmlBody.Location =
new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm));
htmlBody.Name =
"htmlBody";
htmlBody.Size =
new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(16D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(22.5D, Telerik.Reporting.Drawing.UnitType.Cm));
htmlBody.Value =
"{Parameters.Body.Value}";
body.Items.Add(htmlBody);
Telerik.Reporting.
PageFooterSection footer = new Telerik.Reporting.PageFooterSection();
footer.Height =
new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
if (showPageCountFooter)
{
Telerik.Reporting.
TextBox txtFooter = new Telerik.Reporting.TextBox();
txtFooter.Location =
new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm));
txtFooter.Name =
"htmlFooter";
txtFooter.Style.TextAlign = Telerik.Reporting.Drawing.
HorizontalAlign.Right;
txtFooter.Size =
new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(16D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm));
txtFooter.Value =
"=PageNumber + ' / ' + PageCount";
footer.Items.Add(txtFooter);
}
report.Items.AddRange(
new Telerik.Reporting.ReportItemBase[] { header, body, footer });
report.ReportParameters.Add(
new Telerik.Reporting.ReportParameter("Title", Telerik.Reporting.ReportParameterType.String, null));
report.ReportParameters.Add(
new Telerik.Reporting.ReportParameter("Body", Telerik.Reporting.ReportParameterType.String, null));
return report;
}