TppVariable.Compute
Hi
I have many TppVariable in my templates. In my program user can modify (only
for temporary print) value of ppDbtext, TppCustomText and so on.
My problem is that I call directly TppVariable.Compute when user change text
in TppDbText and everything look Ok, but my TppVariable displays old value.
Yes, I am sure that TppVariable.value is correct but I see old value.
Please help me what method I must call after Compute.
I have Delphi 7 ent. with RB 7.03
Regards
Daniel
I have many TppVariable in my templates. In my program user can modify (only
for temporary print) value of ppDbtext, TppCustomText and so on.
My problem is that I call directly TppVariable.Compute when user change text
in TppDbText and everything look Ok, but my TppVariable displays old value.
Yes, I am sure that TppVariable.value is correct but I see old value.
Please help me what method I must call after Compute.
I have Delphi 7 ent. with RB 7.03
Regards
Daniel
This discussion has been closed.
Comments
See RBuilder\Soruce\ppVar.pas. The TppVariable.Compute method fires the
OnCalc event. This should only be done when the report is generating.
You can try setting the TppVariable.Value property but I do not see that it
calls its internal InvalidateDesignControl method when this occurs. You
could try adding that line.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Yes, I know. But the COMPUTE method is public - so I can use this method.
I want that compute fires oncalc but I also want to see on the report the
NEW value of ppVariable.
it
Yes, I call InvalidateDesignControl from TppPrintable but nothing changed.
I saw that in first line in InvalidateDesignControl, FDesignControl is nil
and method do nothing.
Thank You Nard, but I still want your help, please.
Regards
Daniel
If a TppPrintable component is being displayed in the report designer, then
its DesignControl will not be nil.
InvalidateDesignControl is protected and therefore can be called from any
TppPrintable descendant.
Search ppCtrls.pas and you will see that this is the method that is called
by components when a property is modified that requires the component to be
redrawn in the report designer.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
then
Why report designer ? My user already have designed template of report. He
want to edit values on preview form...
Every components I can edit and also write theirs values into database. With
tppVariable I can do that.
You can try to call TppVariable.Compute on preview when You know that value
of his data was changed
(I do that after user changes value in ppdbtext).
Its very nice that TppVariable has new value - the question is how I can
display its new value ?
Sorry for my english...
be
You never mentioned that you were trying to do this from the report preview.
This is not something that RB was designed to do, I have never tried to do
it and do not know whether it is possible.
If you want to regnerate the report, you can call Viewer.RegenerateReport.
If you would like to create a simple example using DBDemos that demonstrates
what you are trying to do, you can email to support@digital-metaphors.com
and we can check it out here in the Delphi debugger. Just create a report
that contains a single DBText and a single TppVariable.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
preview.
Sorry, I just forget that.
I can show You what my extension is useable - if everything will be OK then
user can edit values like in Excel...
Yes, I was called that method and over hundred of others. Just You can help
me.
demonstrates
Yes I will create example. I will send that in next week because I have a
very lot of work in Varsaw...
Regards
Daniel
P.S.
You and others can email to me at: - dSochacki@NO.SPAM.rekord.com.pl
Remove NO.SPAM of course.