Cannot Hide the First Section on Page 1

Posted by: christoph.seiler on 23 December 2024, 12:43 pm EST

    • Post Options:
    • Link

    Posted 23 December 2024, 12:43 pm EST

    Cannot Hide the First Section on Page 1.

    In Crystal Reports it’s very simple funktion - in Active Reports don’t work or I not understand the Philosopie… On every Page i will print on the Header the “Company - Street - City” and on Right the Logo…

    How can I hide the Pageheader on the first page. In Crystal Reports in write in the the Report the following – “if pagenumber = 1 then true”.

  • Posted 24 December 2024, 2:24 am EST

    Hi Seiler,

    You can use the following code in the Script section of your SectionReport to hide the PageHeader for the first page:

    public int currentPage=0;
    public void PageHeader_Format()
    {
    	currentPage++;
    	if (currentPage == 1)
    	{
    		this.PageHeader.Visible = false;
    	}
    	else
    	{
    		this.PageHeader.Visible = true;
    	}
    }
    

    We have declared a class-level variable currentPage to track the current page number. Inside the PageHeader_Format event handler, the currentPage variable is incremented each time the event is triggered, as the event is fired for each page. If the currentPage equals 1, the PageHeader.Visible property is set to false to hide the header. For all other pages, the PageHeader.Visible property is set to true, ensuring that the header is displayed from the second page onward.

    We hope this helps!

    Attachment: HideHeader.zip

  • Posted 24 December 2024, 5:19 am EST

    Thanks. Works fine😎

    I have build a Pageheadersection1. Now the Company Adress and the Logo is on every Page.

    public int currentPage=0;

    public void PageHeaderSection1_Format()

    {

    currentPage++;

    if (currentPage == 1)

    {

    this.PageHeaderSection1.Visible = false;

    }

    else

    {

    this.PageHeaderSection1.Visible = true;

    }

    }

  • Posted 24 December 2024, 5:22 am EST

    Hi Seiler,

    Glad to help! :blush:

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels