Posted 7 June 2019, 4:28 am EST
Hello,
The “Page Setup” button on the ribbon behaves the same in all cases and as I mentioned earlier, does not allow to fetch the specified paper size and hence, the corresponding paper details.
Instead, you can create a custom RibbonButton, create a PageSetupDialog instance and use it to perform the required operation of fetching the paper Kind and RawKind. This is done as follows:
Private Sub btnPageSetup_Click(sender As Object, e As EventArgs)
Dim pageSetupDialog As New PageSetupDialog()
pageSetupDialog.PageSettings = New PageSettings()
pageSetupDialog.PrinterSettings = New PrinterSettings()
Dim result As DialogResult = pageSetupDialog.ShowDialog()
If result = DialogResult.OK Then
C1FlexReport1.Layout.PaperSize = pageSetupDialog.PageSettings.PaperSize.Kind
C1FlexReport1.Render()
Console.WriteLine("PaperKind: " & pageSetupDialog.PageSettings.PaperSize.Kind)
Console.WriteLine("RawKind: " & pageSetupDialog.PageSettings.PaperSize.RawKind)
End If
End Sub
A sample showing the same is attached for your reference.
Thanks,
Esha
prj_FlexReport_PageSetup.zip