Hello,
When using variable system PageNumber as watermark text, the following problem occurs:
1. Number 1 is displayed on the first page as watermark - This is correct
2. Once again number 1 is displayed on the second page - This should be wrong in my understanding
3. Number 2 is displayed on the third page - Also not correct
Then number 3 on forth page and so on.
Can you please tell me the reason behind this behavior. I produced this behavior using the demo version yon our site.
https://demo.stimulsoft.com/#Js
Thanks in advance
Problem when using PageNumber system variable in watermark text!
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Problem when using PageNumber system variable in watermark text!
Hello,
We need some additional time to investigate the issue, we will let you know about the result.
Thank you.
#5087
We need some additional time to investigate the issue, we will let you know about the result.
Thank you.
#5087
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Problem when using PageNumber system variable in watermark text!
Hello,
The PageNumber is a value whose exact value in textboxes is calculated only after the report is built. Due to the peculiarities of the engine, it may not be correct in other places.
In this case, you can use an additional variable or that task.
Thank you.
The PageNumber is a value whose exact value in textboxes is calculated only after the report is built. Due to the peculiarities of the engine, it may not be correct in other places.
In this case, you can use an additional variable or that task.
Thank you.
- Attachments
-
- ReportSample.mrt
- (4.87 KiB) Downloaded 92 times
Re: Problem when using PageNumber system variable in watermark text!
Hello,
Thank you for the info provided.
I have fixed this issue by adding a custom function to the report :
var count = 0;
var function2 = function(pageNo){
if(pageNo === 1) return count++;
if(pageNo > 1) { count=0; return 1; }
}
and adding the following expression to the watermark text:
{PageNumber+CustomFunction(PageNumber)}
Actually, it is possible to use the custom function with minor modification so that it could be used without PageNumber variable but you have to reset the count variable after the last page else you will face a problem in design mode when you re-preview as the numbering will continue from where it stopped last time you previewed the report. But if you don't know how to get the last page this approach will be appropriate for this issue.
Now the the page numbers in watermark text works as expected in my scenario.
All the best
Thank you for the info provided.
I have fixed this issue by adding a custom function to the report :
var count = 0;
var function2 = function(pageNo){
if(pageNo === 1) return count++;
if(pageNo > 1) { count=0; return 1; }
}
and adding the following expression to the watermark text:
{PageNumber+CustomFunction(PageNumber)}
Actually, it is possible to use the custom function with minor modification so that it could be used without PageNumber variable but you have to reset the count variable after the last page else you will face a problem in design mode when you re-preview as the numbering will continue from where it stopped last time you previewed the report. But if you don't know how to get the last page this approach will be appropriate for this issue.
Now the the page numbers in watermark text works as expected in my scenario.
All the best
Re: Problem when using PageNumber system variable in watermark text!
Hello,
Okay, thank you for sharing your knowledge!
Thank you.
Okay, thank you for sharing your knowledge!
Thank you.