Refreshing DBMemo Component
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
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
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I feel like an idiot.
Once I closed the pipeline and dataset it is working perfectly now.
Thank you so much.