Version

Setting PageOrientation when publishing a Report

When publishing a PDF or XPS document, the Orientation of the page can be set by the PageOrientation property. When the Report.Publish() method is used, the PageOrientation needs to be directly set on each Section ISection() that you add to the Report.

In Visual Basic:

Dim r As Infragistics.Documents.Reports.Report.Report = New Report()
'Adding a section to the Report
Dim s As Infragistics.Documents.Reports.Report.Section.ISection = r.AddSection()
s.PageOrientation = PageOrientation.Portrait
'Adding Text to the Section
Dim t As Infragistics.Documents.Reports.Report.Text.IText = s.AddText()
t.AddContent(”Test Text”)
Dim theFile As String = c:\test.pdf”
r.Publish(theFile, FileFormat.PDF)

In C#:

Infragistics.Documents.Reports.Report.Report r = new Report();
//Adding a section to the Report
Infragistics.Documents.Reports.Report.Section.ISection s = r.AddSection();
 s.PageOrientation = PageOrientation.Portrait;
 //Adding Text to the Section
 Infragistics.Documents.Reports.Report.Text.IText t = s.AddText();
 t.AddContent(”Test Text”);
 string theFile = @”c:\test.pdf”;
 r.Publish(theFile, FileFormat.PDF);