Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Change pg hdr for 1st pg printing grp ftr (2000sr1a)

    How can I detect the occurence of a forced page break? I want to make a change to the page header for the pages printing the Group1 footer. The Group1 footer has forcenewpage set to before and after, but putting code behind the onformat event of the Group1 footer doesn't change the page header for the first page heading of the group1 footer (but works for subsequent pages). I can't quite understand this as the report engine must have hit the group1 footer to force the new page, so there must be something detectable happening. I can't use the onpage event, as it would happen too late, and there's no way I can think of to find out that the next page will not group2footer, or will contain group1 footer. I can't use the willcontinue property for detail or group2, as I have each group2 being kept together, and if I use it for group1 footer I have the same result as using the group1 footer onformat event. Surely there must be some way to do this.

    Thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change pg hdr for 1st pg printing grp ftr (2000sr1a)

    I don't know if this is the best manner but it works.
    In the detail section of the report, put a textbox, invisible, with control source =1 (include the equal sign).
    Set the Running Sum property to Over Group.
    In the On Format event of the header of your group, you can test the value of this textbox. If it is 1 you are on the first page of your group and you can take action to change what you want.
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Change pg hdr for 1st pg printing grp ftr (2000sr1a)

    There are samples that demonstrate techniques for this either in the Solutions9.mdb ,which should be on your Office CD, or in the sample database you can download from Microsoft at RptSmp00.exe
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Change pg hdr for 1st pg printing grp ftr (2000sr1a)

    Sorry, must be being really stupid here. Charlotte, I can't find solutions9.mdb on either of my office cd's, and can't find anything in the rptsmp to help either, although did find a useful example of creating an index, which I shall have to look at more carefully (BTW, how would I have found out that the answer might have lain in either of these places - I'd obviously tried online help and newsgroup and KB searches before I posted here, with no hits).

    Francois, I don't think I can have explained properly what I need to do.

    I have a PAGE header, repeating on every page, then Group2 header, repeating on everypage (group2 usually spans about 50-70 pages), then Group1header, detail and group1footer, all kept together and usually spanning about a third of a page, then the Group2footer, which starts on a new page and spans 10 pages.

    What I would like to do is change the PAGE header for the first page on which the Group2footer is being printed. Any format event associated with the group doesn't seem to fire at the right time to prevent the first page of the group footer containing the unmodified page header.

    If it helps to put this in context, the report is a list of families in a region. Group1 is the family group, with Group1footer containing a number of rows with UID's and families filled in for handwritten additions to each family, and each group2 is a subregion (one field team), with group2header being column headings for all pages, and group2footer being 10 pages each with 10 new slots for family members for completely new families to that subregion. The page header contains the name of the region, the subregion, a page count, and the first and last households on that page. This last feature didn't work properly for the group footer, so I want to hide it with a box in the page headers of every page the group footer is printed on (or actually replace it with a box saying New Family X). As I've said, I can get this to work for pages 2-10 of each group footer, but not page 1.

    Clear as mud, I know. Hope someone can understand.

    At this rate, with only 45 subregions, I'll be reaching for the Tippex soon.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Solutions9.mdb download

    Sorry, it may have been on the developer's tools disk. You can download it but it is NOT easy to wade through all the levels and changes in the MS site to find the place to download it from. I truly hate the MSDN site, and it seems to get worse with every "improvement". You can download it at this page, at least until they change the site again. <img src=/S/aflame.gif border=0 alt=aflame width=15 height=15>

    How would you have found out about the samples? I've been using them for so long, I can't remember. I guess you have to rely on the Lounge. <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>
    Charlotte

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change pg hdr for 1st pg printing grp ftr (2000sr1a)

    Mark,

    Maybe I have found something, but you'll have to test it with your data and see if my thought are correct.
    In the page header I create a unbound textbox named Flag.
    In the code I create two functions to set the Flag textbox to 0 or to 1.
    I add a new group with the same field as the outer group with only a footer.
    This footer has no force new page, and I create a unbound textbox with controlsource =SetFlagZero().
    Make this footer as small as possible.
    In the other footer with a force new page, I create also a unbound textbox but with controlsource =SetFlagOne().
    Place this textbox so that it is the last textbox that is printed in the footer.
    In the on Print of the header I test Flag and make set the Visible property of the other textboxes like I want.
    As these two functions don't return a value (but set the flag), they won't be printed. The Flan can also be invisible.
    As the flag is set by function at print, it is possible that if you browse in the preview window, the flag in not set as it has to be, but printing should be fine.
    Like you say, Clear as mud, but I attach a sample mdb.
    Attached Files Attached Files
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •