report with copies

Hello, i have a special Problem:

If i print a Report and the Report has copies (normal 4) then i need a different colored thicker Line on the left (Memo?) on each Report copy.

1 = original no color
2 = copy 1 = Color Blue
3 = copy 2 = Color Red
4 = copy 3 = Color Yellow

i tried width copyname# and it shows the right number of copy but the following doesn't work:
  if (Trim(<CopyName#>) = '0') or (Trim(<CopyName#>) = '1') then begin
    MemoKopienMarkierung.Color := clNone;                                                                                
  end              
  else if Trim(<CopyName#>) = '2' then begin
    MemoKopienMarkierung.Color := clBlue;
  end              
  else if Trim(<CopyName#>) = '3' then begin
    MemoKopienMarkierung.Color := clRed;                                                                              
  end              
  else if Trim(<CopyName#>) = '4' then begin
    MemoKopienMarkierung.Color := clYellow;                                                                              
  end;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:53AM
    it is too late to modify the output of the report memo;s properties.
  • I've thought of me, but how can i do what i need?
  • gordkgordk St.Catherines On. Canada.
    edited 2:53AM
    this will depend upon wether or not you are printing from the preview window or handling from code without previewing.


  • gpigpi
    edited 2:53AM
    Try to use TfrxReport.OnPrintPage event
  • gordk wrote: »
    this will depend upon wether or not you are printing from the preview window or handling from code without previewing.
    I'm printing from the preview window, but if it works ill do it without showing!
  • gpigpi
    edited 2:53AM
    You may change page's content depend of CopyName value in the TfrxReport.OnPrintPage event
  • gpi wrote: »
    You may change page's content depend of CopyName value in the TfrxReport.OnPrintPage event
    Thanks, but i can't find any example. Can you give me an example how can i do that?
  • This works for me. Thanks a lot for ehlping!
    procedure TDlg_Rechnung.frxReportVorschauPrintPage(Page: TfrxReportPage;
      CopyNo: Integer);
    var MyMemoView : TFrxMemoView;
    begin
      inherited;
      MyMemoView := TfrxMemoView(Page.FindObject('KopienMarkierung'));
      if MyMemoView <> nil then begin
        MyMemoView.Text := '';
        if (CopyNo = 0) or (copyNo = 1) then MyMemoView.Color := clNone
        else if CopyNo = 2 then MyMemoView.Color := clBlue
        else if CopyNo = 3 then MyMemoView.Color := clRed
        else if CopyNo = 4 then MyMemoView.Color := clYellow;
      end;
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.