• I have a little problem of setting the pagenumbers in the footer.

    I would like to have a footer looking like this:

    Blok 1(left alligned) Blok 2 (right aligned)
    Blok3(left aligned) Blok 4 (right aligned)

    Here Blok 3 is page numbering (# of ##)

    Blok 1 and Blok 3 need to be in a smaller font.

    I tried the code below but it produces this:

    # ##
    Blok1
    Blok2
    Blok3
    of


    So it produces 5 lines instead of 2 with the numbers of the pages on the first line.

    Anybody?


    procedure TFreeReportRTF.CreateFooter;
    var
    par : TParagraph;
    txt1, txt2 : TWPCharAttr;
    begin
    inherited;
    RTFDoc.ActiveText := RTFDoc.HeaderFooter.Get(wpIsFooter, wpraOnAllPages);
    RTFDoc.ASet(WPAT_BorderFlags, WPBRD_DRaw_top);

    FillChar(txt1,SizeOf(txt1),0);
    RTFDoc.ActiveText.RTFProps.AttrInterface.SetFontSize(txt1,8);

    FillChar(txt2,SizeOf(txt2),0);
    RTFDoc.ActiveText.RTFProps.AttrInterface.SetFontSize(txt1,10);

    //blok 1
    par := rtfdoc.ActiveText.AppendPar();
    par.align := paralLeft;
    par.Insert( maxint,'Blok1',txt1);

    //blok 2
    par := rtfdoc.ActiveText.AppendPar();
    par.align := paralRight;
    par.insert(maxint,'Blok 2',txt2);

    //blok 3
    par := rtfdoc.ActiveText.AppendPar();
    par.align := paralLeft;
    par.Insert( maxint,'Blok 3',txt1);
    par := rtfdoc.ActiveText.AppendPar();

    //blok 4
    par := rtfdoc.ActiveText.AppendPar();
    par.align := paralRight;
    par.Insert( maxint,'Pagina ',txt2);
    RTFDoc.InputTextField(wpoPageNumber);
    par.Insert( maxint,' van ',txt2);
    RTFDoc.InputTextField(wpoNumPages);


    RTFDoc.ActiveText := RTFDoc.BodyText;
    end;