I am looking for the way to insert page numbers in custom reports in the form of "Page __ of__". I can get the individual page number without any problems but have not been able to get the Page__of__ to display.
Any help will be appreciated.
Bob Freeman
Page Numbers in Custom Reports
Moderators: Moderators, Tech Support
-
- Tech Support
- Posts: 3015
- Joined: Thu May 13, 2004 9:59 am
- Location: PowerChurch Software
- Contact:
Use the following:
Code: Select all
"Page "+_PAGENO+" of "+_PAGETOTAL
I agree that the expression provided should do the trick. However, I am getting an error when using it. I can get any one part of the expression to run and produce the proper information but when I combine them into the complete expression I get the following:
PROGRAM: QM_RTYPE
Line: 3000
Error: 107
Message: Operator/operand type mismatch.
Further help will be greatly appreciated.
Bob Freeman
PROGRAM: QM_RTYPE
Line: 3000
Error: 107
Message: Operator/operand type mismatch.
Further help will be greatly appreciated.
Bob Freeman
-
- Program Development
- Posts: 830
- Joined: Tue Sep 02, 2003 12:48 pm
- Location: PowerChurch Software
- Contact:
Sorry - you're getting that message because you're trying to add numbers to letters, and math doesn't work that way, unless it's algebra.
What you need is:
You have to convert those numbers to strings so they concatenate properly.
What you need is:
Code: Select all
"Page "+STR(_PAGENO)+" of "+STR(_PAGETOTAL)
Thanks Zaphod you are right on!
Conversion of numbers to strings is indeed necessary for them to work in the expression. The expression that you provided does provide the results I am looking for. However, I do still have a format problem if you could steer me in the right direction. It seems that in each case where the string command is issued there are 6 or 8 spaces added in the displayed information.
Looks like - Page 1 of 12.
I thought I might be able to correct this with the TRIM command but could never get it just right. It appears to process in the expression, but the spaces are still be there.
Thanks,
Bob Freeman
Conversion of numbers to strings is indeed necessary for them to work in the expression. The expression that you provided does provide the results I am looking for. However, I do still have a format problem if you could steer me in the right direction. It seems that in each case where the string command is issued there are 6 or 8 spaces added in the displayed information.
Looks like - Page 1 of 12.
I thought I might be able to correct this with the TRIM command but could never get it just right. It appears to process in the expression, but the spaces are still be there.
Thanks,
Bob Freeman
Zaphod
I have been doing some more research and have now got the solution to my problem. I made some changes to the expression you provided and now have the correct data in the correct format.
Following is the revised format of the expression:
"Page "+LTRIM(STR(_PAGENO))+" of "+LTRIM(STR(_PAGETOTAL))
Thanks again for your assistance.
Bob Freeman
I have been doing some more research and have now got the solution to my problem. I made some changes to the expression you provided and now have the correct data in the correct format.
Following is the revised format of the expression:
"Page "+LTRIM(STR(_PAGENO))+" of "+LTRIM(STR(_PAGETOTAL))
Thanks again for your assistance.
Bob Freeman