Thursday, December 6, 2012

“Page Orientation” Property

When a report is created from a view that has more than seven fields, the report is rendered with landscape orientation, such as the example shown below. When a report has less than seven fields, the report is rendered in portrait orientation.

Report created from 'Customers' grid view oriented as landscape.

The report orientation can also be forced to render portrait or landscape by using the “Page Orientation” property.

Let’s change the Customers report displayed above to be presented in portrait orientation.

Start the Project Designer. In the Project Explorer, switch to the Controllers tab. Double-click on Customers / Views / grid1 node.

View 'grid1' of Customers controller.

Change the following:

Property New Value
Page Orientation Portrait

Press OK to save. On the toolbar, press Browse.

Navigate to the Customers page. On the action bar, press Report | PDF Document.

Printing a PDF Report from Customers grid view.

Open the PDF file that was saved to your hard drive. The report will be in portrait orientation.

Report created from 'Customers' grid view oriented as portrait.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com