Solved

How to override field value in Crystal Report XI

Posted on 2009-05-12
6
477 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 101

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 101

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 101

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

687 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