Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 15th, 2005, 01:08 PM
Authorized User
Join Date: Jul 2004
Location: , WI, USA.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default formula fields at runtime


I want to pass a string to a formula field on the report. Everytime I try to run the report, it says - 'The remaining text doesnot appear to be part of the formula. If I pass the strings - "Yes" or "No", it displays True or False without any error.

Following is my code

Dim myFormulas As FormulaFieldDefinitions

        Dim FormulaField5 As FormulaFieldDefinition
        myFormulas = Me.rpt.DataDefinition.FormulaFields

        FormulaField5 = myFormulas.Item(0)

        Dim strPlayer As String
        strPlayer = "Player11"

        FormulaField5.Text = strPlayer


How should I modify the code to make the report accept the string?


Reply With Quote
  #2 (permalink)  
Old March 15th, 2005, 02:58 PM
Authorized User
Join Date: Jul 2004
Location: , WI, USA.
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts

Solved the problem.
The string should have a single quote too. i.e. strPlayer = "'Player11'"

Reply With Quote
  #3 (permalink)  
Old March 26th, 2005, 05:00 PM
Registered User
Join Date: Dec 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Should be written like this.
Me.Rpt.DataDefinition.FormulaFields.Item(0).Text = """" & strPlayer & """"

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i filter d repot fields at runtime... nikks9 Crystal Reports 1 June 9th, 2006 05:41 AM
Formula Fields in Records Problem berniehunt Crystal Reports 1 April 14th, 2006 06:52 PM
Create formula at runtime for sections... SergeyC. Crystal Reports 0 November 9th, 2005 06:24 AM
CRW 8.5, 356 formula fields on rpt sections Lydia BOOK: Professional Crystal Reports for VS.NET 0 May 23rd, 2005 06:23 PM
How to suppress the duplicated fields? (formula) winnie1778 Crystal Reports 0 October 18th, 2003 05:56 AM

All times are GMT -4. The time now is 05:55 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.