Print Page | Close Window

Modifying a formula field in code

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15266
Printed Date: 03 May 2024 at 8:01am


Topic: Modifying a formula field in code
Posted By: billev
Subject: Modifying a formula field in code
Date Posted: 01 Jan 2012 at 5:57pm
I have a formula in my report called Dummy which is equal to a string called "dummy".
 
In code I Say:
MyReport.DataDefinition.FormulaFields("Dummy").text = "Smarty"
 
When I run the report, I get the error "The remaining text does not appear to be part of the formula."
 
Any help would be appreciated.
 
visual studio 2005 and Crystal that came with it.
 
Thanks, Bill V.


-------------
Thanks,

Bill V



Replies:
Posted By: asam
Date Posted: 25 Jan 2012 at 4:12am
Here is what I have used successfully:  this.DataDefinition.FormulaFields["line2"].Text = "'Yes'";
(Note the [] and single quotes inside double quotes)!

 

 




Print Page | Close Window