This is a migrated thread and some comments may be shown as answers.

PageFooter getting called multiple times per page

3 Answers 21 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 30 Apr 2013, 11:15 PM
We just recently upgraded from Q3 2011 to the Q1 2013 version of the report tool. We are putting a QR code in the footer of each page to identify it when scanned. Since we don't know the page number at the time we generate the QR code we are just increment a counter every time the OnDataBinding Event of the picture box that displays the QR code is called. Before the upgrade this worked. After the upgrade the event is getting fired 4 times for every page and it's messing with our page counts. Any suggestions on how to accomplish what we need to do?

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 02 May 2013, 11:56 AM
Hello,

In general you should use the PageNumber global object in an expression to obtain the current page number. If you want to do something more specific based on the page number value you can pass it as an argument to a user defined function. Please, note as well that the PageNumber and PageCount global objects are only available for the items in the page sections (PageHeader/PageFooter).

Kind regards,
Chavdar
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Jack
Top achievements
Rank 1
answered on 02 May 2013, 12:53 PM
We ended up using a user defined function. This lets us get the page number to the code we are using to generate the QR code. The issue we have now is with the PageCount global object. We are keeping a record of how many pages are in a document (so we can know if they have all been scanned back in) and in a few of our reports the PageCount will read higher than the number of pages the report ends up being. For example I have a user function on a text box in the PageFooter. If I throw a break point on my user function I see that it gets called 8 times. One one of those calls both the PageNumber and the PageCount are 3 so we are creating a record saying this report has 2 pages. On subsequent calls the PageCount is 2. Is there a way to get the final PageCount?
0
Chavdar
Telerik team
answered on 02 May 2013, 01:50 PM
Hello,

Despite how many times the user function has been called the PageCount value should be always the same. Please, check whether you pass correctly the PageCount object to the user function.

Regards,
Chavdar
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Jack
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Jack
Top achievements
Rank 1
Share this question
or