Change Landscape Orientation in Code
I am using Fast-Report.NET 1.5.3 with Visual Basic Express 2010.
I am creating a custom preview form using the FR PreviewControl and a custom page setup dialog. After the report is shown in my custom preview form, I am attempting to change its landscape orientation with code similar to the following:
Private Sub ChangeOrientation(ByVal LandscapeOrientation As Boolean) 'LandscapeOrientation is a boolean passed from my custom page setup dialog
Dim pg As FastReport.ReportPage = MyReport.Pages(0)
pg.Landscape = LandscapeOrientation
MyReport.Show()
End Sub
When pg.Landscape is False and my code changes it to True, the report changes to landscape in the PreviewControl as expected. However, when pg.Landscape is True and I change it to False, the report does not change to portrait. I checked the Landscape property on the report and confirmed that it was reset to False. It seems that i need something else to force the display to refresh.
When i use the built-in page setup dialog, the report always toggles from Landscape to Portrait, as expected.
Am I missing something?
Thanks,
Paul
I am creating a custom preview form using the FR PreviewControl and a custom page setup dialog. After the report is shown in my custom preview form, I am attempting to change its landscape orientation with code similar to the following:
Private Sub ChangeOrientation(ByVal LandscapeOrientation As Boolean) 'LandscapeOrientation is a boolean passed from my custom page setup dialog
Dim pg As FastReport.ReportPage = MyReport.Pages(0)
pg.Landscape = LandscapeOrientation
MyReport.Show()
End Sub
When pg.Landscape is False and my code changes it to True, the report changes to landscape in the PreviewControl as expected. However, when pg.Landscape is True and I change it to False, the report does not change to portrait. I checked the Landscape property on the report and confirmed that it was reset to False. It seems that i need something else to force the display to refresh.
When i use the built-in page setup dialog, the report always toggles from Landscape to Portrait, as expected.
Am I missing something?
Thanks,
Paul
Comments
And I recommend you to update FastReport .NET.