typo above----> customer formula = CUSTOM formula
Main Topics
Browse All TopicsI am using Crystal reports XI - SP2 and .NET 1.1 (C#).
A windows service written in .NET generates and text exports about 20000 reports on a nightly basis.
The problem I am facing is with the text exported version.
In the Page Header section I am using the Special field "Page Number" to dispya the ... page number.
However, in the text file, this is what I see in some of the files, at random -
PAGE # 16 1
where as this really should have been
PAGE # 1
The header in the last page of the report displays the page number as
PAGE # 1616
where as this really should have been
PAGE # 16
The report has a total of 16 pages.
So it seems like, the report is for some strange reason also displaying the total number of pages just before the Page number field.
I am unable to replicate this error on a regular basis, that is, it shows up at times, and works OK at other times.
Any help would be greatly appreciated
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Have you tried removing the field and adding it back in again? I looks like you have the "Total Page Count" field appended to the "Page Number" field.
Failing that try creating a Formula like this:
shared numbervar pages;
pages:=pages+1;
pages
Add it to the page header and you should see it show the page number. It just basically increments a user defined varible called "pages" every time it is displayed.
Hope this helps.
Jon
Jon,
Thank you for responding. We have over 200 reports which are generated using a set of parameters to a total of 20000+ exported files - so it is not an issue of having placed TotalPageCount by accident.
I have tried a few things including shared variables, placing the special field Page Number in a text field and also in a formula field.
But for some reason the page count shows up randomly in any of these cases
Does the default printer change? or could it? Crystal uses the default printer to help in the rendering of the report thus if the default printer changes it could affect how a report looks. For instance if you change to a dot matrix printer you might get that result for a bold field since bold is done by printing the text twice.
mlmcc
Tried the following with NO PRINTER Option selected, but the problem presists -
1:
Declared a shared & incremented in the PageHEader section. Same variable refered in a separate formula field as "Page# " + cstr(@SharedPageNum)
2:
Page number(spl field) directly inserted in to the PAGE # text field with required spaces in between.
I also tried the reports by adding the same n/w printer on the server (where reports run) as the one that I designed the reports from my desktop. Didn't help.
I did take the field out and from what I could tell, it did not print the Total Page count then. But since it anyway occurs at random, I will give it another try.
I had also posted this issue on BusinessObjects support forums. Did not get any response. Do you know if there is way to get any support from them without having to pay for it (I will leave that as the last option)
If it helps, this is the formula I am using to print the Page number in the Page Header now -
(where page is a shared variable that I increment in the page header)
StringVar Page_Num;
NumberVar page_len := length(split(cstr(shared numbervar page),".")[1]);
StringVar page_no :=split(cstr(shared numbervar page),".")[1];
StringVar PageNum := split(page_no,",")[1];
if(page_len > 4) then
PageNum := PageNum & split(page_no,",")[2];
(
select page_len
case 1 :
Page_Num := split("PAGE # ;",";")[1] + ltrim(right(PageNum,1))
case 2 :
Page_Num := split("PAGE # ;",";")[1] + ltrim(right(PageNum,2))
case 3 :
Page_Num := split("PAGE # ;",";")[1] + ltrim(right(PageNum,3))
default :
Page_Num := split("PAGE # ;",";")[1] + ltrim(right(PageNum,4))
);
Appreciate your help
I can try it that way, but the issue is not with the value of this variable. If I print the value elsewhere in the report (other than the Page header section) it displays the correct value. Even in the Page header the value itself is correct in the .rpt export. The problem shows up only in Text export
Samit
Change this one in a similar way
StringVar Page_Num;
shared numbervar page;
NumberVar page_len := length(split(cstr(page),".
StringVar page_no :=split(cstr(page),".")[1]
StringVar PageNum := split(page_no,",")[1];
Since page is a number why are you converting to a string? What is the SPLIT for?
mlmcc
Business Accounts
Answer for Membership
by: CRXIuser2005Posted on 2006-09-08 at 08:13:05ID: 17480317
IS this ONE field...or is this a customer formula that someone has created for page numbers?
If it a formula..can you post the formula?
Thanks
MikeV