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!

Storing report field names and formulas in an array 1

Status
Not open for further replies.

RWWAMS

Technical User
Jan 3, 2003
104
US
Hi everyone, I'm using VB 6.0 pro, Crystal Reports 8.5 dev and the data is in an Access 2000 database.

I have a report already built and now I working on my parameter interface in vb. The details section of the report contains a running total, several database fields and a formula. All are visible. It is a pretty simple report. I am attempting to store all the fields names (table and field name) and formulas in an array. I am struggling with the syntax. Here is the approach I would expect to work:


Dim crpFIELD As CRAXDRT.FieldObject
I = 1
For Each crpFIELD In REPORT.Sections("D").ReportObjects
If (crpFIELD.Kind = crFieldObject) Then
Set crpFIELD = REPORT.Sections("D").ReportObjects(I)
FIELDS_ARRAY(I) = crpFIELD.Name
I = I + 1
End If
Next


When stepping through the code above, crpFIELD.NAME = "Field1", "Field2", ... I'm looking for {table.fieldname} or {formulaname}.

Any pointers or advice would be greatly appreciated.
Regards.
 
Try:

FIELDS_ARRAY(I) = crpFIELD.Field.Name

That'll do it...

-dave
 
Vidru - you're the best! Thank you very much. Worked like a charm.

Thanks again,
Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top