Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1414
PageOrientation being ignored - I think I have the answer...
posted

To All,

I created a complex 'put-it-here' report that did not have any grids in it.  Therefore, I had to create a report object and execute the Publish method on that object once the report was generated.  One problem.  Although I set the PaperOrientation directly in code like the following:

report.Preferences.Printing.PaperOrientation = Infragistics.Documents.Report.Preferences.Printing.PaperOrientation.Landscape;

It did not seem to have an affect.  The report orientation was always portrait.

So, after quite some time I started thinking.

Thinking...

Yup, you have to PageOrient the section like the following:

//Define Section, section orientation, and section margins to permit binding of NavMC10576.

Infragistics.Documents.Report.Section.ISection section = report.AddSection();

section.PageOrientation = PageOrientation.Landscape;

section.PageMargins.Top = Convert.ToSingle(14);

section.PageMargins.Left = Convert.ToSingle(42);

section.PageMargins.Right = Convert.ToSingle(14);

section.PageMargins.Bottom = Convert.ToSingle(14);

 

Again, I don't think even Infragistics knows how powerful this library is.  You have complete control over your print output.  You can use the exact same data as that which may populate a form or grid - ie. you don't have to hope some external XML file is created and used properly.  Amazing.