Please see your other post where I responded with the below formula. Not sure if you have changed your desired result.
whileprintingrecords;
stringvar x;
stringvar y := x;
numbervar rpt;
x := {Employee.Last Name}[1];
if
x=y then
rpt := rpt+1;
if
pagenumber = 1 then
x else
replicatestring(chr(9), 6*(pagenumber-rpt))+x
The above formula placed in the page footer would show the same letter on repeating pages but not tabbed over while new letters would be tabbed over.
Hi LB. Thanks for responding. This is great. However, I was wondering now if there is a way the letter would tab over to the right and change to reflect the first letter of the user's last name as each page turns...? Thanks so much for your help on this.
How is what I suggested different from what you are looking for? Or did you mean you wanted the letter to appear at the right margin of the page footer?
I need it so when the letter changes (because the page number changed) even if it's the same letter, the next one would still tab over. For example, if page 2 is "A" and page 3 still has an "A", the second A would tab over to the right because the page changed. The tabs are going to be located at the bottom of a page with landscape layout.
Question: if I want to change the number of spaces the letter tabs over to the right to two spaces, do I just change the 9 in the formula to 2? Or would I change the 6 to a 2?
So I changed the formula to the following... I need one more help, please if you could. How can I force the letter to start at the very beginning of the line once the space allotted for the field has been used?
The letter goes to the next line. I had formatted the field to have Exact line spacing instead of multiple, and the letters still bleeds to the next line. Thanks for your patience and help.
whileprintingrecords;
stringvar x;
x := {Employee.Last Name}[1];
if pagenumber = 1 then
x else
replicatestring(chr(32), 3*pagenumber)+x
Create a {@reset} formula and place it in the page header. Replace the number 31 with the pagenumber you see when the second formula is just about to wrap to the next line.
//{@reset} for page header:
whileprintingrecords;
stringvar p;
numbervar i;
if remainder(i,31)=0 then(
i := 0;
p := "";
);
//{@initial} for page footer:
whileprintingrecords;
stringvar x;
numbervar i := i + 1;
stringvar p;
x := {Employee.Last Name}[1];
if i = 1 then
p := x else
p := replicatestring(chr(9),i-1)+x;
p
Note that chr(9) is the ANSI character for tab and cannot be replaced.
Just to confirm and to make sure i did it correctly. I created a formula field named "reset" and put the formula below that you provided in the field's Formula Editor. Then I dropped that "reset" field any where in the Page header.
whileprintingrecords;
stringvar p;
numbervar i;
if remainder(i,31)=0 then(
i := 0;
p := "";
);
THEN
I created another formula field named "initial" and put the following formula below that you provided in the field's Formula Editor. That field is placed in the Page Footer.
whileprintingrecords;
stringvar x;
numbervar i := i + 1;
stringvar p;
x := {Employee.Last Name}[1];
if i = 1 then
p := x else
p := replicatestring(chr(9),i-1)+x;
p
Is what I did correct because it did not work for me and the letter in "initial" field is no longer tabbing to the right as the page changes.
Did you remove previous formulas? I did test this and it worked perfectly for me.
Did you verify the point at which the formula tries to wrap in the page footer to see whether 31 needs to be replaced by some other pagenumber in the reset formula?
I did delete previous formulas. I created the fields again.
How do I verify the point at which the formula tries to wrap in the page footer? I tried changing the 31 to the smallest number possible and up to 3000, and no luck. When I click the next page arrow, the letter changes to reflect the first letter of the user's last name, but no longer tabs or move to the right.
The letters no longer move to the right. Do you know why it could be? Even the other formula you provided, the letters do not move to the right anymore. I've triple checked the formula, and they are correct.
I've also made sure the reset formula is in the page header and not the report header.
Also, the report is grouped by user's zip code- would that affect the formula and deter it from working properly? I've tried lots of times, but still not able to get it to worked...
Below is the formula I used. The letters do not move at all to the right even if the page number changes... so the field doesn't even wrap. I did try changing the 31 from 1 to 300, and it still didn't do anything.
Formula entered in field "reset" (placed in page header):
whileprintingrecords;
stringvar p;
numbervar i;
if remainder(i,1)=0 then(
i := 0;
p := "";
);
Formula entered in field "initial" (placed in page footer):
whileprintingrecords;
stringvar x;
numbervar i := i + 1;
stringvar p;
x := {User.name_last}[1];
if i = 1 then
p := x else
p := replicatestring(chr(9),i-1)+x;
p
The reset formula is the problem. You need to replace the “1” in the remainder function with the pagenumber just before the formula wraps in the page footer. Place the pagenumber function in the page footer. Start out with some number like 50 in the reset formula, so that it won’t wrap before the initials reach the right margin. Then page through the report until the next page causes the formula to wrap. Then go back one page and check the pagenumber. It will probably be something like 31 (depends upon your font, of course). Plug that number into the reset formula so that the remainder function looks like this:
If Remainder(i,yourpagenumberbeforewrapping)=0 then (
Hi LB. Just want to give you an update. It finally worked! I had to fudge with the size of the field and font formats, but it works. Thanks so much for your help on this!!! Very much appreciated for your help and patience.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.