Solved

How to Change the value of a Formula of the Report from Delphi

Posted on 2003-11-05
4
584 Views
Last Modified: 2007-12-19
Error:502 Invalid Text or Object Handle
Formulas.SetIndex(1) <PEGetHandleString-Formula Name>


I got the said error when i tried changing the value of my formula from Delphi 7.(Note that I'm using CRW 9.2.2, Delphi 7 and correct VCL).

Crpe1 is from TRCrpe, then i added the ff code in Delphi:
Crpe1.FormulaByName('Formula1').Formula.Text := 'Test';

That line caused the above error to appear. I tried executing Formulas.Count in delphi and was able to get the correct number of formulas in my report. I even tried to get the value of Formulas.IndexOf('Formula1'), and was able to get a value for this.

Pls help. Thanks.
0
Comment
Question by:dctara
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 63 total points
ID: 9686937
Try it this way

Crpe1.Fomulas('Formula1').Text = 'Test';

mlmcc
0
 
LVL 13

Assisted Solution

by:EwaldL
EwaldL earned 62 total points
ID: 9735314
There was a bug once in CR 9's API calls about formulas. As the VCL is only a wrapper around those calls you may want to install the hotfix listed in
http://support.crystaldecisions.com/library/kbase/articles/c2013208.asp

Also, I could imagine that this formula syntax might throw an error as the Delphi's ' ' surrounding the word Text should not become part of the formula. So maybe to keep it easiest you could use a formula that outputs a number and set it to '1' in code instead
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question