Using Crystal 8.5 and VB6 -- need to get a list of fields available to the report 
Author Message
 Using Crystal 8.5 and VB6 -- need to get a list of fields available to the report


I've written a front-end to Crystal 8.5 using VB6.  At one point it allows
the user to select fields to be used in the record selection formula.
Currently the list of fields the user can select from is generated by
looping through the report fields and selecting the ones that are in the
database and are also present in the detail section of the report.  Here is
the looping code:
    'Add only the detail fields that are on the report to the arrays.
    ReDim asReportFields(0)
    ReDim aiReportFieldTypes(0)
    For iCount = 1 To oMWReport.moCRReport.Sections("D").ReportObjects.Count
        'Always clear previous references to avoid orphaned objects.
        Set goCRReportObj = Nothing
        Set goCRReportObj =
        If goCRReportObj.Kind = crFieldObject Then
            Set goCRFieldObj = Nothing
            Set goCRFieldObj = goCRReportObj
            If goCRFieldObj.Field.Kind = crDatabaseField Then
                Set goCRFieldDef = Nothing
                Set goCRFieldDef = goCRFieldObj.Field
                ReDim Preserve asReportFields(UBound(asReportFields) + 1)
                ReDim Preserve aiReportFieldTypes(UBound(aiReportFieldTypes)
+ 1)
                asReportFields(UBound(asReportFields)) = goCRFieldDef.Name
                aiReportFieldTypes(UBound(aiReportFieldTypes)) =
            End If
        End If

What I'm looking for is something similar to the above code, but that does
not limit the fields to those in the detail section of the report.  Nor does
it just grab all fields in the database.  I'd like to get the fields from
the database and be able to tell what fields are key fields that point to
other tables, etc.  and then get all the fields from all the linked tables.

So does anyone out there know how to tell if a field is a key field to
another table?


Sat, 16 Jul 2005 04:00:42 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Using Crystal Reports 8.5 to Report Fields From Public Contacts Folder on Exchange 5.5 Server

2. Exporting To PDF, RTF using VB6 (SP4) Crystal 8.5

3. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

4. Getting started with Crystal Reports 8.5

5. Crystal Reports 8.5 - printing data as a comma separated list

6. Crystal Reports 8.5 Runtime File List for VB packaging

7. Crystal Reports 8.5 Parameter Fields

8. Crystal Reports 8.5 date range parameter field - record selection that includes null date range

9. Time Field Calculations - Crystal 8.5 - Help

10. Diary field is truncated when previewing a Crystal Reports 8.5

11. Crystal 8.5 and Dynamic Field Objects

12. Crystal Reports 8.5 Truncates Varchar fields larger then 255 characters


Powered by phpBB® Forum Software