This is a migrated thread and some comments may be shown as answers.

Report Header on Page 2, 3, ...

5 Answers 495 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian Coetzer
Top achievements
Rank 2
Ian Coetzer asked on 13 Jun 2008, 01:02 PM
Hi

How can I create a Report Header that only appears on Page 1
And then a Report Header that only appears from page 2 onwards ....

I still need the Page Header for all pages, but essentially Page 2, 3 etc. requires a different header than the one on Page 1.

5 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 16 Jun 2008, 02:48 PM
Hello Ian Coetzer,

You can use ReportHeader section to render header to the first page and PageHeader for the rest pages. Set the PrintOnFirstPage = False for the PageHeader.

Kind regards,
Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ian Coetzer
Top achievements
Rank 2
answered on 17 Jun 2008, 09:09 AM
Hi

Ok, this works, BUT on my first page there is a large space above the report header causing it to start a few centimetres from the top of the first page.

It looks as though this blank space is the same height as the page header which has been set to not start printing on the first page.

How can I solve this?

Thanks
0
Steve
Telerik team
answered on 18 Jun 2008, 08:37 AM
Hello Ian,

Unfortunately this space cannot be removed as the page header is always part of the page layout no matter visible or not.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ian Coetzer
Top achievements
Rank 2
answered on 18 Jun 2008, 11:03 AM
Hi

Can't I create two panels, one for page 1 and another for the rest.
And then somehow detect whether the current page is 1, 2, 3 etc? and based on that set the visibility of the panel as follows:

Page #

1 Panel1.Visible=True; Panel2.Visible=False;
2 Panel1.Visible=False; Panel2.Visible=True;
3 Panel1.Visible=False; Panel2.Visible=True;
4 Panel1.Visible=False; Panel2.Visible=True;
...

This should work nicely if the panels are overlapped to overcome the empty space which is rendered when I set the page header to not print on the first page.

Also a similar technique could then be used to toggle between two panels based on the current page number for the footers.

How can this be achieved in code? can one not intercept the creation / rendering of pages via the report class or report viewer or something?

Bye
0
Steve
Telerik team
answered on 19 Jun 2008, 02:39 PM
Hello Ian,

Unfortunately this would not work as you cannot "write" over the page sections in any way. What might work for your scenario is using group header section that would "simulate" the page header section for your report. Here are sample steps:
1. Add new group and leave the group expression empty.  
2. Set GroupFooterSection property Visible = false and make it as small as possible.
3. Place required items for the <First Page Header> in the GroupFooterSection.
4. Set the PageHeader to be as small as possible and hook up the ItemDataBound eventhandler for the PageHeaderSection
5. Create a private field (flag) isFirstPage in your Report class and set it's value to true.
6. Implement in the ItemDataBound handler something like this:
      private void pageHeaderSection1_ItemDataBound(object sender, System.EventArgs e)
        {
            Telerik.Reporting.Processing.PageSection pageHeader = sender as Telerik.Reporting.Processing.PageSection;
            if (!this.isFirstPage && pageHeader != null)
            {
                pageHeader.Report.Groups[0].GroupHeader.Visible = false;
            }
            this.isFirstPage = false;
        }

Hope this helps.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Ian Coetzer
Top achievements
Rank 2
Answers by
Hrisi
Telerik team
Ian Coetzer
Top achievements
Rank 2
Steve
Telerik team
Share this question
or