Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Used Memo Lines

edited August 2001 in General
How can I tell (Programatically) how many Lines are used in a Memo field
since there isn't a LineCount or something to that nature?

Comments

  • edited August 2001
    I had to do something like this to get at the memo lines after generation.
    What are you going to do with this count?

    uses
    ppDrwCmd;
    ...
    private
    { Private declarations }
    FDrawCommand: TppDrawText;
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.DFM}

    uses
    ppTypes;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    FDrawCommand := nil;

    ppReport1.Print;
    end;

    procedure TForm1.ppDetailBand1AfterPrint(Sender: TObject);
    begin
    ShowMessage(IntToStr(FDrawCommand.WrappedText.Count));
    end;

    procedure TForm1.ppDBMemo1DrawCommandCreate(Sender, aDrawCommand: TObject);
    begin
    if (FDrawCommand = nil) then
    FDrawCommand := TppDrawText(aDrawCommand);

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Add the lines to TppRichText.Lines.

    I'm having all kind of problems printing this report.

    I've mentioned in other posting and you have also been trying to help. I
    have a report with three subreports. The last subreport conains columns
    traversing LeftToRight.

    In your most recent reply I can't Print columns LeftToRight and KeepTogether
    (very disappointing) so I'm trying another approach using a memo component.

    This works fine except that it causes the printer to print in a continuous
    loop. So another approach is to take the lines in a memo component and add
    them to the TextString and see how that works.

    Gary


  • edited August 2001
    Yeah, left to right traversal wasn't part of the initial engine design, so
    there are some assumptions in the engine that make it difficult to
    incorporate stretching controls into this layout scheme. We would have to
    rebuild the current engine from the ground up in order for it to be more
    flexible in how bands generate.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.