?
Solved

How to override field value in Crystal Report XI

Posted on 2009-05-12
6
Medium Priority
?
482 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
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 

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 1000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

801 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