T-Square Posted November 3, 2005 Posted November 3, 2005 I am trying to set up a report where the headers change based on the current page number. However, when I create a test field that is an unstored calculated field consisting solely of Get(PageNumber) and place this on my report, I always get 0 when I preview the report. According to FM Help, this result should only occur when I am not in Preview mode, so I do not know what is wrong. Any ideas? David
mr_vodka Posted November 3, 2005 Posted November 3, 2005 Hi david, I just tried to replicate your issue and I can not replicate it. The unstored calculation works the way it should for me. Try to change it from an unstored to a stored and then once back in browse mode, change it back to unstored. XP Pro SP2
RalphL Posted November 3, 2005 Posted November 3, 2005 (edited) Where are you putting this page number? Headers use data from first record and and Footers use data from last record both use global fields. Edited November 3, 2005 by Guest
T-Square Posted November 3, 2005 Author Posted November 3, 2005 Ralph-- Interesting point about the header and footer. Regardless, I have put the field in every part of the layout: Header, Subsummary, Body, Footer. Each time I get 0. Since it's working for others, I'll have to explore some more to figure out what's odd about my setup. Notes: I've already tried changing the storage back and forth from Stored to Unstored. I've tried changing the context of the calculation, moving it from one table to another. The calculation is of type number. Both John and Ralph's profiles indicate FM8, while I am using 7.03; maybe that's an issue? FM's help just says that it should return 4 if you're on page 4, and 0 if you're not in Preview mode... More (I hope) later, David
mr_vodka Posted November 3, 2005 Posted November 3, 2005 David, I tried it on 7.03 as well as 8. I am still not having problems with it. Maybe you can post a copy of the file and we can try to open it up on our machines and take a look...
T-Square Posted November 3, 2005 Author Posted November 3, 2005 John-- Thanks for the quick clarification. It underscores that the problem is on my end somewhere. Before I upload any files, I'll do some more work on my end. David
T-Square Posted November 4, 2005 Author Posted November 4, 2005 Here's the update: My problem arises from the fact that I am using a multi-file separation model structure, with my reports in one file and my data in another. If I build a simple report in the data file and put the calc field on that self-contained report, the Get function works fine. However, if I use the same field on a layout in the reports file and relate that back to the data file, the calc doesn't update. Furthermore, if I have my localized dummy report up in one window and page along, the remote report's value assumes the value in the dummy. So, it would seem that the Get(PageNumber) function is only evaluated from the perspective of the *data*, not the perspective of the layout, which is frustrating. So, does anyone have a nifty workaround? Cheers, David
Ender Posted November 4, 2005 Posted November 4, 2005 I have confirmed that this problem shows itself when the calc is defined in a table in another file (like your data file.) This happens in FM8 as well. A solution is to define the Get(PageNumber) calc in a local table (in the interface file.) You can create a simple one-field table (with the Get(PageNumber) calc, unstored) and add a cartesian join to the table you are running the report in. Then insert that related calc field onto the report layout.
T-Square Posted November 4, 2005 Author Posted November 4, 2005 Ender-- Good. Thanks for the info. At least this part of the problem is solved. Sadly, the problem that brought this up in the first place isn't. You see, now that I get the calculation to work, I have found that it doesn't reset with the displayed page number, but tallies an absolute page number. What I've been trying to do is create a header that _doesn't_ appear on the first page of each subsection occurrence. I have a signin report with a subsummary that includes general site information and column headings, followed by a roster and spaces to sign. I want column headings on the later pages of a site listing, but not on the first, since the column headings are embedded in the subsummary on the first page. Using a combination of Title Header and Header (suggested to me elsewhere on the Forums) doesn't work because I need the Title header to repeat for each subsection. What I thought I'd try is to have a calculated field that displayed text if the current page number was greater than 1, and nothing if less than 2. This would make the header appear only on pages 2 and up for a site. But the Get(PageNumber) doesn't re-set with the displayed page number. Alas. I think it may be time for me to give up the hope on this one, unless anyone has any crafty ideas... Thanks, David
RalphL Posted November 5, 2005 Posted November 5, 2005 I have a sample file that may be what you need. I need to make a data to use with it.
RalphL Posted November 5, 2005 Posted November 5, 2005 I have used Brian Dunning's 500 names file to Make a database of Members. I have added 2 files to this one to make a 3 tier separation model. Use the file PhoneBook.fp7 to open these files. If you sort and preview you should see the phone book with a name range in the header that gives the first and last name on the page. The script that does this is called Setup. In the BR (Business Rules) file is a script that updates the BR from the Data file. I did not get fancy with creating new records. Phonebook_folder.zip
T-Square Posted November 8, 2005 Author Posted November 8, 2005 Ralph-- I've looked at your example and it's neat, but doesn't do what I'm after. Imagine something like this: Page: 1 Location: First Site Address: 123 Anystreet Name Sign-in -------------------------------- Page: 2 Name Sign-in -------------------------------- ~~~~~~~~~~ ~~~~~~~~~~ Page: 1 Location: Second Site Address: 456 AnotherStreet Name Sign-in -------------------------------- ~~~~~~~~~~ So far, I have not figured out any way to achieve this. Cheers, David
comment Posted November 9, 2005 Posted November 9, 2005 See if the attached gives you some ideas. AltHeader.fp7.zip
Recommended Posts
This topic is 7053 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now