Solved

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

Posted on 2003-11-05
4
578 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now