Page 1 of 2

How to skip page header by condition?

Posted: Wed Jan 07, 2009 10:37 am
by _Alex_74_
Hallo,

i've a very simple question: I will split my page header in two headers, the one will be printed on each page, the second "TSection2" only if the group header "GroupHeaderSection1" (every group header begins on a new page: NewPageBefore=TRUE) is not printed, because this Group Header will duplicate the same information as second page header and formatted together with more additionally information.

How I can do skipping by condition?

Thanks in advice!

How to skip page header by condition?

Posted: Thu Jan 08, 2009 3:33 am
by Edward
Hi Alex,

If I understand you in the proper way, then it is possible to set the following properties for the GroupHeader band:

PrintOnAllPages=true, NewPageBefore = true, SkipFirtst = true;

There is no need in PageHeader band in that case at all.

Thank you.

How to skip page header by condition?

Posted: Thu Jan 08, 2009 5:30 am
by _Alex_74_
Hi Edward,

if I undestand correct, you mean what I need are TWO "Group Header"'s, where the second header (from top of the page to down) simulates my second "Page Header"?
So for example I have GroupHeader1 and GroupHeaders2. But SkipFirst for the second Header does not really help - it skips only on the first page of the whole report.
What I probably need is the property ans settings like: "SkipPrint = GroupHeader1.Printed";

Thanks.

How to skip page header by condition?

Posted: Thu Jan 08, 2009 11:08 am
by _Alex_74_
Allright, I’ve founded two different solutions.

Both solutions use events.
The second one uses some additional invisible element and is most elegant :)

1. In GroupHeader1: define event "Get Value" as "this.GroupHeader2.Enabled=false;" ==> this definitively suppress the output of GroupHeader2 below GroupHeader1 along the same page.
2. Add some invisible element (named CHECKER), i.e. transparent line with Size=0 and Width=0 on some DataBand, i.e. MainSection : Data below the GroupHeader2.
3. In CHECKER: define event "Get Value" as "this.GroupHeader2.Enabled=true;" ==>
this enables the output of GroupHeader2 again, i.e. on the following page.

Now the output looks as reqired.

How to skip page header by condition?

Posted: Thu Jan 08, 2009 12:28 pm
by Edward
Hi Alex,

Thank you for this information.

Please let us know if any help is required.

Thank you.

How to skip page header by condition?

Posted: Thu Jan 08, 2009 5:32 pm
by _Alex_74_
Hi Edward,

this solution is only a "workaround" for me, because it depend on internally generated code, code execution order and order of events, maybe it depends also of report creational order.

More logically and intuitive ill be properties like "PrintedOnPage" and "SkipOnPage" or "PrintOnPage", so we can create code like "GH2.SkipOnPage=GH1.PrintedOnPage". Such properties must be evaluated on each page or specifically pages (defined by report creator).

Thanks.

How to skip page header by condition?

Posted: Wed Jan 14, 2009 2:18 pm
by Edward
Hi Alex,

Maybe it is possible to check Enabled property of appropriate band? Suggested properties by you are also is not easy to understand at once :)

What do you think?

Thank you.

How to skip page header by condition?

Posted: Tue Jan 20, 2009 3:23 am
by _Alex_74_
Hallo Edward,

Checking the 'Enabled' property was my first attempt. But the problem is, once disabled, the element is always deactivated for the rest of time, and can't enable himself anymore - so we must use event of someone other element to enable it again, as showed in my example - the things become complicated.

Generally I find the conditional model easily to understand as event model. Particularly if condition appears per page, because of event will be only an attempt to emulate this 'page'-condition.

In the conditional model you wrote only direct condition when to enable/disable element on current page, or some other conditions. Condition can be more complex and it will be very difficult to use events. Moreover, it will also continue the same 'conditional'-appearance, already implemented in report engine.

Thanks.

How to skip page header by condition?

Posted: Fri Jan 23, 2009 10:31 am
by Edward
Hi Alex,

Yes, you are right. Conditions is the best approach and this feature has been already implemented.

Please open attached file in the Demo.exe sample application.

Thank you.

How to skip page header by condition?

Posted: Wed Jan 28, 2009 9:25 am
by _Alex_74_
Hallo Edward,

it's true, conditions are already implemented. The problem is not a definition of condition itself, it is how to specify some "page"-condition for element dependent on behaviour of some other element.

By the way, try to reproduce with simple condition what I describe above in this topic and have already solved by using of events.

Thanks.