0
votes

I have the report designed with following sections.

Page Header

Group Header#1

   Group Header#1a

   Group Header#1b

Group Header#2

Group Header#3
Group Header#4

Group Footer#4

Group Footer#3

Group Footer#2

Group Footer#1

    Group Footer #1a

    Group Footer #1b  --> this section contain subreport

    Group Footer #1c

In group footer #1b i put a subreport and the subreport linked with main report by some parameter.

The subreport has only an image control which needs to print, but it totally conditional, means there might change data is not coming for subreport so no image will print. For this I do the following :

On subreport I click on File>>Report Options and check the checkbox "suppress printing if no record" then on main report write click on sub report and selected the format report then in Sub report tab check the checkbox "Suppress Blank Subreport"

Also for the section I open the section expert and check the checkbox "Suppress Blank Section".

By doing above work if there is no data or the subreport is blank then section is suppressed but header is still coming from previous record and the print next record.

1

1 Answers

0
votes

As no one replied on my question, and after several R&D I found the solution, Here is the solution: In Page Header I create a Shared Variable and check if it is true then suppress the header else not.

And going through structure of report, In Group Footer#1 there was checkbox 'Reset Page Number After' unchecked that.

In group Group Footer #1a apply a formula on Reset Page Number After and check whether the data for next group i.e. Group Footer #1b is available or not if available then return false for reset page number else true to reset page number, and in same section create another formula where I again create same shared variable as in page header and set that variable to false or true based on data for next section is available or not and drag the formula to section Group Footer #1a.

And in final step for Group Footer #1b which contains sub report I checks whether shared variable is true then set it to false. so that after printing the section header again available for printing.

All above steps solve my problem.