• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

How to override field value in Crystal Report XI

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
KMBrochu
Asked:
KMBrochu
  • 3
  • 3
1 Solution
 
mlmccCommented:
In the report add a formula

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

Use that instead of the field on the report.

mlmcc
0
 
KMBrochuAuthor Commented:
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
 
mlmccCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
KMBrochuAuthor Commented:
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
 
mlmccCommented:
If all you are changing is the selection formula you could use parameters or code like

crRpt.RecordSelectionFormula = "Add the where clause"

mlmcc
0
 
KMBrochuAuthor Commented:
Thank you!
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now