Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 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

23 Experts available now in Live!

Get 1:1 Help Now