Hide pages with no data in group header

Posted by: joakimsinbox on 29 May 2021, 4:20 am EST

  • Posted 29 May 2021, 4:20 am EST - Updated 30 September 2022, 7:40 am EST

    Hi! I have a report with specific times printed in the page header. This report is generated with one page per every 10th minute throughout a day. Each page then has a group header showing data from detail section that is bound to the specific time. Not every of these times has any further data but since each time is data from a data field I get a page generated for all the times.

    Is there a way to exclude the entire page if one of the text boxes in the detail section is empty?

    See my generated report in images with one page containing data worth printing and the other not.

  • Posted 31 May 2021, 1:55 am EST

    Hello,

    You can use the SectionReport events to achieve your requirement as follow:

    public void Detail_Format()
    {
    	if(test=="CENTC")
    		this.Detail.Visible = false;
    	else
    		this.Detail.Visible = true;
    }
    
    
    string test;
    public bool ActiveReport_FetchData(bool eof)
    {
    	test = rpt.Fields["CustomerID"].Value.ToString();
    	return eof;
    }
    
    

    https://www.grapecity.com/activereportsnet/docs/v15/online/report-events.html

    Thanks,

    Mohit

  • Posted 2 June 2021, 7:08 pm EST

    Thanks!

    Am I supposed to replace anything in the snippet? I tried replacing CustomerID with a field from my detail section. Nothing changed in my printed report either before or after this.

  • Posted 3 June 2021, 4:39 am EST

    Hello,

    You need to change the condition in the IF statement so that detail section will be hidden on the certain condition.

    Thanks,

    Mohit

  • Posted 4 June 2021, 1:38 am EST

    Thanks!

    Okey, I made it work. But if I did it right this will only hide the detail section. What I would like to do is to exclude the whole page from the report. Is this possible?

  • Posted 4 June 2021, 5:02 am EST

    Hello,

    There is no direct way to hide the page. You need to hide all the section individually in the report on the certain condition.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels