It's possible to change page orientation in script?

edited 6:48PM in FastReport VCL 5
Hi everyone.

I have a report, on which are GroupHeader.
GroupHeader has Child band.
Child have one component a DBCross .

Before print a group header I prepare data, which will I print on Child band in DBCross component.

Depending on the amount of data, in DBCross component are less or more columns.

And here is my problem.

I would like change page orientation, depending on the count of colums.
For example:

if CountOfColumns > 14 then
page.orientation := poLandscape
else
page.orientation := poPortiaint;


I placed this code in event onBeforePrint of GroupHeader component.

Unfortunately, I see that this don't work.

It's possible to change page orientation in this way?


Thanks for answer!
Piotr





Comments

  • gpigpi
    edited 6:48PM
    You may change page's orientation before preparing of report or in the main procedure of the script

Leave a Comment