Solved

How to override field value in Crystal Report XI

Posted on 2009-05-12
6
469 Views
Last Modified: 2013-11-07
I am using Crystal Report XI release 2 with vs2005, with an Oracle back end db.  During run time, I may need to override a field value on the report.  So, the report returns a value from the database of "green", but at run time, I need to change the value to "blue."  I would like to do this via vb code.  Thank you.
0
Comment
Question by:KMBrochu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24370941
In the report add a formula

If ({YourField} = 'green') then
    'blue'
else
    {YourField}

Use that instead of the field on the report.

mlmcc
0
 

Author Comment

by:KMBrochu
ID: 24370966
Thank you for your quick response.  I cannot do this on the report via formula, because the conditions completly change during run time...so I have to do it in VB.  
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24371220
You can't do it from VB except by changing the data in the database or passing a modified dataset to the report from VB.

mlmcc
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:KMBrochu
ID: 24398032
I think your second option may work for me.  The report is originally set up with an ODBC connection to a table, but at run time, the selection criteria can change dramatically.  So the table stays the same, but the select portion will change.  Would you be able to provide an example of how to change the selection in VB?  Thank you again.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 24398825
If all you are changing is the selection formula you could use parameters or code like

crRpt.RecordSelectionFormula = "Add the where clause"

mlmcc
0
 

Author Closing Comment

by:KMBrochu
ID: 31580820
Thank you!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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