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

Can User change field/text values during preview?

edited March 2006 in General
Hi,
Delphi 7 RB 9.03

I am using RB to print out a letter to a customer. But the operator
needs to mark (X) a box or type in a comment to the user ON THE PREVIEW
screen. They need to see what they typed and then they can print it.
How can I accomplish this?
I was able to click the title of the field with the
OnDrawCommandClick and move a value to the field but it would not show
on the preview. How do I get it to redo the preview with the new data
entered or moved to that title during the OnDrawCommandClick (or draw
that field again) so it shows? Example 153 did not help what I wanted
to do. Thank you.
--
Louis Beck
Vital Records Product Manager
(864)232-2666 x 1-3502#
Piedmont Center East Suite 508
37 Villa Road
Greenville, SC 29615
louis@qsinc.com

Comments

  • edited March 2006
    Hi Louis,

    Take a look at the following example of refreshing a report after the data
    has been changed using the OnDrawCommandClick event. I believe it sets the
    DrawCommand.RedrawPage property to True to give this effect.

    http://www.digital-metaphors.com/tips/RefreshReportAfterDataChange.zip

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2006
    Hi Nico,
    Yes that works nicely, but is there a way to do that entirely in RAP?
    (Do I need to be in the RAP subgroup?)

  • edited March 2006
    Hi Louis,

    The TppDrawCommand.RedrawPage property has been added into RAP and should
    function correctly. Have you tried this code in RAP? What problems have
    you encountered?

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2006
    Nico,

    I have the following code in my Rap even on the report builder CALC tab.
    The showmessage displays the xxxxxx's but the field does not change?
    RB 9.03 Delphi 7.

    Procedure label1OnDrawCommandClick(ADrawCommand : TObject)

    label1.text:= 'xxxxxx';
    label1.caption:= 'xxxxxx';
    showmessage(label1.text);

    TPPdrawcommand.redrawpage := True;
    TppDrawText(aDrawCommand).RedrawPage := True;

    ...It compiles fine, But label does not change.





  • edited March 2006
    Nico,
    Does the Rap code support this type of commands:
    TPPDrawtext(aDrawCommand)ReDrawPage := True;
    What am I missing? Do I have the wrong concept completely? Thanks.

  • edited March 2006
    Louis,

    Unfortunately for this to work correctly you will need to reset the report
    engine after you alter the text of the label and although the engine
    property is available in RAP, the reset method is not. You will need to
    create a pass-thru function to call Report.Engine.Reset before setting
    TppDrawCommand.RedrawPage to True.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2006
    Thank you. I will create a pass through function to do this.

This discussion has been closed.