Set New Page property on GroupHeader in FastReport #2

Can someone help me how to set new page on or off on pagebreak condition? It is not turning on or off when I execute the code.

Thanks 

procedure TFrmRptMnuFastR.frxReport_budactBeforePrint(
  Sender: TfrxReportComponent);
var memo : tfrxGroupHeader;
    component : TfrxComponent;
begin

    case CmBxSortBy.ItemIndex of
      0 : begin
             component := frxreport_es_k_9.FindObject('GroupHeader1');
             memo := component as TfrxGroupheader;
             memo.Condition := 'frxDBDataset_budact."PLINE"';
             if pagebreak then
                 memo.StartNewPage := true
             else
                memo.StartNewPage := false;
         end;
      1 : begin
             component := frxreport_es_k_9.FindObject('GroupHeader1');
             memo := component as TfrxGroupheader;
             memo.Condition := 'frxDBDataset_budact."PLINE"';
             if pagebreak then
                 memo.StartNewPage := true
             else
                memo.StartNewPage := false;
          end;
    end;  // case (CmBxSortBy.ItemIndex)

end;
0
Minh
5/25/2015 4:58:54 AM
embarcadero.delphi.reporting 487 articles. 0 followers. Follow

1 Replies
1796 Views

Similar Articles

[PageSpeed] 39

Hi,

You can set this property one time only - before group printing. So if 
group is printing now there are will not any results of changing this 
property.

You should change it before "onBeforePrint" of GroupHeader because on 
moment of "onBeforePrint" it is  already initialised.

25.05.2015 7:58, Minh Ho wrote:
> Can someone help me how to set new page on or off on pagebreak condition? It is not turning on or off when I execute the code.
>
> Thanks
>
> procedure TFrmRptMnuFastR.frxReport_budactBeforePrint(
>    Sender: TfrxReportComponent);
> var memo : tfrxGroupHeader;
>      component : TfrxComponent;
> begin
>
>      case CmBxSortBy.ItemIndex of
>        0 : begin
>               component := frxreport_es_k_9.FindObject('GroupHeader1');
>               memo := component as TfrxGroupheader;
>               memo.Condition := 'frxDBDataset_budact."PLINE"';
>               if pagebreak then
>                   memo.StartNewPage := true
>               else
>                  memo.StartNewPage := false;
>           end;
>        1 : begin
>               component := frxreport_es_k_9.FindObject('GroupHeader1');
>               memo := component as TfrxGroupheader;
>               memo.Condition := 'frxDBDataset_budact."PLINE"';
>               if pagebreak then
>                   memo.StartNewPage := true
>               else
>                  memo.StartNewPage := false;
>            end;
>      end;  // case (CmBxSortBy.ItemIndex)
>
> end;
>

-- 
Best regards,
  Michael Philippenko  mailto:michael@fast-report.com
  Fast Reports - reporting must be Fast!
  http://www.fast-report.com
0
Michael
5/26/2015 12:08:11 PM
Reply: