Get current page number while printing

Hi everyone,

i created a report in Xojo with some report controls. One of them, called „TitleLabel“, should be only visible on pages > 1. A ReportLabel has an Visible Property. So how can I get the current page number in ReportLabels BeforePrinting-Event to set it invisible?

// Pseudo-Code Me.Visible = PageNumber > 1

To print a document, I use .NextPage.

The line before is: PageNumber = PageNumber + 1

Emile, I think the OP talks about xojo Reports, not about printing a Graphics ?

Yes, you are right. I’m talking about Xojo Reports. It’s a bit weird, I added this code to the BeforePrinting-Event of a ReportLabel:

[code]Dim currentPage As New ReportPageNumberLabel("")
Me.Text = "Page " + currentPage.Text // This works pretty fine on the printed report.

// following code runs, but won’t return the Page number
// always returns “##PageNumber##” instead of “1” (look at the debugger)
Dim i As String = currentPage.Text
Me.Visible = I > 1[/code]

If this is a very difficult question, can at least one of the Xojo developers say something about it? That would be very helpful.
I would also like to know if you can change the size of a report during runtime via code (e.g. Report.Width = 8.25)?