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

Refreshing DBMemo Component

edited February 2008 in General
I'm using Delphi 6 and RB 7.04.
I have a component on a subreport that is a graphic that says "Add Note".
when the end user clicks this graphic I'm displaying a modal form that
allows them to add a note to the report.
Below the Add Note button I have a DBMemo field that is connected to a memo
field in my DBISam table.
All of this is working perfectly. My problem is that when someone clicks
"Add Note" and adds the note, and closes the "AddNoteForm" I need the DBMemo
component to be refreshed with the new data they entered into the field
immediately.
as it stands right now i have to re-run my report to see the changes i've
made to the DBMemo.

Any suggestions would be greatly appreciated,
Michael White
Ideal Software

Comments

  • edited February 2008
    Hi Michael,

    Try using something similar to the code we use to refresh the report after
    an AutoSearch value is added. The below code is called from the
    OnDrawCommandClick event.

    ppReport1.Reset;
    ppReport1.Engine.Reset;
    TppDrawText(aDrawCommand).RedrawPage := True;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2008
    Hi Nico,
    Thank you for the reply; however I tried this with no luck.
    If it helps, here is the actual code that i'm trying to use. I have an image
    on the report, the following code is in that image's DrawCommandClick
    procedure.

    AddReportNotes:=tAddReportnotes.Create(Self);
    addreportnotes.ShowModal;
    if addreportnotes.ModalResult = MrOk then
    begin
    ppPawnTransactionReport.Reset;
    ppPawnTransactionReport.Engine.Reset;
    TppDrawText(aDrawCommand).RedrawPage := True;
    end;

    When I click the image in the preview the AddReportNotes form is displayed
    and when I close the form I can see that the pages of the report are being
    redrawn, but the value of the DBMemo component is not being updated with the
    new data from the table.
    The pipeline that feeds this DBMemo component is linked to a query, I've
    tried refreshing the query component prior to the redrawpage command and the
    result was the same. Also, in case this matters for some reason, the DBMemo
    in question is located on a subreport.

    Thank you,
    Michael

  • edited February 2008
    Hi Michael,

    Are you actually changing the data in the field you are accessing? If so,
    you need to be sure you are closing the pipeline and dataset before
    regenerating the report. You might also consider using a regular TppMemo
    object and manually assigning its text based on the value in the DB field.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2008
    Hi Nico,
    I feel like an idiot.
    Once I closed the pipeline and dataset it is working perfectly now.
    Thank you so much.

This discussion has been closed.