Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2005, 01:08 PM
Authorized User
 
Join Date: Jul 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default formula fields at runtime

Hi

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?

Thanks,
Gauri


 
Old March 15th, 2005, 02:58 PM
Authorized User
 
Join Date: Jul 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old March 26th, 2005, 05:00 PM
Registered User
 
Join Date: Dec 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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








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





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