Solved

How to override field value in Crystal Report XI

Posted on 2009-05-12
6
421 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
  • 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now