Page Numbers in Custom Reports

Moderators: Moderators, Tech Support

Post Reply
bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Page Numbers in Custom Reports

Post by bobfree »

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

Zorak
Tech Support
Tech Support
Posts: 3015
Joined: Thu May 13, 2004 9:59 am
Location: PowerChurch Software
Contact:

Post by Zorak »

Use the following:

Code: Select all

"Page "+_PAGENO+" of "+_PAGETOTAL

bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Post by bobfree »

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

Zaphod
Program Development
Program Development
Posts: 830
Joined: Tue Sep 02, 2003 12:48 pm
Location: PowerChurch Software
Contact:

Post by Zaphod »

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:

Code: Select all

"Page "+STR(_PAGENO)+" of "+STR(_PAGETOTAL)
You have to convert those numbers to strings so they concatenate properly.
PowerChurch Software Technical Support
(800) 486-1800
http://www.powerchurch.com/

bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Post by bobfree »

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

bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Post by bobfree »

Zaphod
I just looked at my previous post and in the line that says 'Looks like" there should have been 6 or 8 spaces between "Page and 1" and again between
"of and 12". The spaces were remove when I posted the message.
Thanks,
Bob

bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Post by bobfree »

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

Jeff
Program Development
Program Development
Posts: 1225
Joined: Fri Sep 05, 2003 11:43 am
Location: PowerChurch Software
Contact:

Post by Jeff »

You can also use the transform function. The syntax is TRANSFORM(vExpression). It automatically changes any type into a character string. In the case of numeric values, it automatically trims the function.

In your example, it would be "Page "+TRANSFORM(_PAGENO) + " of " + TRANSFORM(_PAGETOTAL)

bobfree
Posts: 32
Joined: Sat Jul 02, 2005 8:06 pm
Location: First Baptist Church, New Hope, AL

Post by bobfree »

Thanks a bunch for the info.

Bob

Zorak
Tech Support
Tech Support
Posts: 3015
Joined: Thu May 13, 2004 9:59 am
Location: PowerChurch Software
Contact:

Post by Zorak »

Sorry for my initial incorrect post!

Post Reply