cancel
Showing results for 
Search instead for 
Did you mean: 

How can I know with RAS (SDK Crystal Report) which database fields are used in a report?

Former Member
0 Kudos

I have tried using UseCount of DatabaseFieldDefinition, but always return 1.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188030
Active Contributor
0 Kudos

See this KB

1645989 - How to determine the database field information of all of the fields in a table using the ...

You would need your SAP account credentials id to see this kb.

- Bhushan

Senior Engineer

SAP Active Global Support

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Getting started and moving ahead with Crystal Reports .NET applications.

Former Member
0 Kudos

I can´t see the link.

Can you please tell me how to fix this?

former_member188030
Active Contributor
0 Kudos

Here is the basic code to list all DB fields from report.

// To return all of the fields in a specified table.
        Tables boTables = boReportClientDocument.DatabaseController.Database.Tables;

        CrystalDecisions.ReportAppServer.DataDefModel.Table boTable = (CrystalDecisions.ReportAppServer.DataDefModel.Table) boTables.FindTableByAlias(tableName);

                    // Get all of the fields for the specified table.
            Fields boFields = boTable.DataFields;

for (int i = 0; i < boFields.Count; i++)
{
                    DBField boDBField = (DBField) boFields[i];

                    Response.Write(boDBField.get_DisplayName(CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, 0));

}

  

Thanks,

Bhushan                

Former Member
0 Kudos

thanks for your answer, but i need is to know the datafields that are used.

former_member183750
Active Contributor
0 Kudos

I think we'll need more info on what it is you want. E.g.; you say:

i need is to know the datafields that are used

This will give you the names of the fields:

Response.Write(boDBField.get_DisplayName(CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, 0));

If you do not want names of fields, what is it yo are looking for?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

I need is to know if the datafields are used in report, if are used in formula, summary, parameters, labels, graphs, ... and so to discriminate of the datafields without use. I don't need to know if are used in formula, sumary, ... only if used.