Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing field info at runtime

Status
Not open for further replies.

Yazster

Programmer
Sep 20, 2000
175
CA
Hi,
I'm using Crystal Reports V4.6.1. with VB.

I've designed a report, which includes text fields, and saved it in .RPT format. I'm running this report through VB using the ActiveX Control.

My question is this: Can I modify information on the report at runtime through VB before printing it? For example, if I have a text field that contains a user's name, can I modify it through code? Header info, footer info, etc... The reports I'm creating are customized and the information will change for every recipient.

Any help would be greatly appreciated.
 
How would I add these literal values? I tried entering a string in the "formula text" window of the "edit formula" menu, and got a "There is an error in the formula" message.

Also, once I have the literal, I can access them through the activex control that comes with VB5?

Thanks.
 
To put a literal text string into a formula, put the string in Quotes (single or double):

'Default String'


You can then override that string by passing a new string to the formula from VB5. Something like this:

rptMyReport.Formulas(0) = "FormulaName='new text'" Ken Hamady
 
Tried out what you said and it worked perfectly.

Thanks Ken!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top