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!

Crystal 8.5 reference a text object 1

Status
Not open for further replies.

RBSTR

Programmer
Nov 10, 2005
71
GB
Hi
I have a Crystal 8.5 report called by a VB6 programme.
In my code I set the text at run time that is to be displayed in text objects on the report header, for example:
Set crxText = .Sections(2).ReportObjects(13)
crxText.SetText strCustomerName
If, however, I insert another text object into this section on the report design in Crystal then my object reference may change - leading to needing to do a code change - for example the above reference may become .Sections(2).ReportObjects(14)
How can I reference the text objects in VB6 without using the index?
I have seen in Crystal XI a object name property on text objects but can not seem to find something similar on my Crystal 8.5 reports (and I am not in a position at the moment to upgrade these 8.5 reports to Crystal XI).
Many thanks in advance.

 
Wow! Crystal 8.5 and the RDC.

Easiest way I can think of is to create a formula, then place that formula in the text box. Then change the formula at run time.

Alternatively, have some dummy text in the text box, then run through all the text boxes in that section until you find the correct one.

Not sure about the licensing of that though. 8.5 still had a separate Report Creation API and this may have excluded this call. You'll see a popup when you run your app in VB. nothing once compiled though.

Andrew Baines
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top