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

Print a memo w/o a pipeline?

edited August 2002 in General
Is there a simple way to print a reprot that just has a memo without
using a pipleline?

I have a common case where I want to print a memo or a string list that
I have in memory.

Thanks,

Allen.

Comments

  • edited August 2002
    Yes. Simply do not connect a pipeline. Place the memo in the detail band and
    use the detail band's before print event to load the contents into the memo.
    The detail band will only be printed once if there is no pipeline connected.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited September 2002
    I am trying to accomplish the same thing without success. Depending on how
    much data is in the memo field, the detail band BeforePrint event gets fired
    more than once. If I have a small amount of data, it fires one time. If
    the data in my memo field is larger than one column on the report, it fires
    twice. If the data rolls into page two, when I click the next pagein
    preview mode, the BeforePrint fires again giving me an endless report.

    What am I doing wrong? Thanks in advance.

    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited September 2002
    The BeforePrint event will fire every time the band atempts to print. It
    will fire even when the band won't fit on a page. If it prints over multiple
    pages, then it will fire on every page. To solve your problem, you need to
    not use the Detail.BeforePrint event. You need to set the memo lines by
    using the memo's OnPrint event to assign the memo lines.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    I put the following line of code in the OnPrint event of the memo:

    MemoOnReport.Lines := MemoOnForm.Lines;

    It seems to work until the memo runs into the second page. Hitting the next
    page button in preview mode toggles the text on the status bar between "Page
    1 of 1" and "Page 0 of 1". If I hit the last page button, it runs for a
    long time and eventually produces a second page.

    Ultimately, I want to add some spaces to each line in the memo field, so my
    code will look something like this:

    for Line := 0 to MemoOnForm.Lines.Count - 1 do
    begin
    strMemoLine := ' ' + MemoOnForm.Lines[Line];
    MemoOnReport.Lines.Append(strMemoLine);
    end;

    The above code also produces strange results. Sometimes I get parts of the
    memo more than once on the report.

    On another topic, I changed the report icon property. The first time I run
    the report it defaults to the standard icon and does not display mine.
    Subsequent runs of the report display the icon correct icon.

    Thanks very much for your assistance.

  • edited September 2002
    Use a JITPipeline. Set the record count to 1. Connect a DBMemo to the
    JITpipeline field. In the JIT's OnGetFieldValue, configure the memo text
    value how you would like it based on the conditions that you have for the
    memo. For the cases in which you do not want to show the memo, simply set
    the memo's visibility to false in the detail band's BeforePrint event.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    I'm still not putting all the pieces together to make this report work. I
    have re-added the JITPipeline, set the record count to 1, and connected a
    DBMemo to the pipeline field. After looking at some examples, I'm still
    uncertain what to put in the JIT's OnGetFieldValue event.

    Can you give me a little more hand-holding as to what the function would
    look like assuming that I want to append a space to the front of every line
    on my form's memo field?

    Thanks for your patience, Jim. I truly appreciate the quick help you have
    been providing.

  • edited September 2002
    I have emailed you a sample project.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.