1662720 - How to find all the fields on main report using Crystal Reports .NET SDK?

SAP Knowledge Base Article - Public

1662720 - How to find all the fields on main report using Crystal Reports .NET SDK?

Symptom

How to find all the fields on main report using Crystal Reports .NET SDK?

Environment

  • Crystal Reports for Visual Studio 2010
  • Crystal Reports 2008

Resolution

Following is the code that can be used to find all the fields on the main report:

private void FindReportObects(ReportDocument reportDocument)
    {
        if (reportDocument.ReportDefinition.ReportObjects.Count > 0)
        {
            Response.Write("<table border=1 cellspacing=2>");
            Response.Write("<tr>");
            Response.Write("<td><b>Report Object Name</b></td>");
            Response.Write("<td><b>Report Kind</b></td>");
            Response.Write("<td><b>Report Object Format</b></td>");
            Response.Write("</tr>");
 
            foreach (ReportObject reportObject in reportDocument.ReportDefinition.ReportObjects)
            {
                Response.Write("<tr>");
                Response.Write("<td>" + reportObject.Name + " </td>");
                Response.Write("<td>" + reportObject.Kind.ToString() + " </td>");
                Response.Write("<td>" + reportObject.ObjectFormat.ToString() + " </td>");
                Response.Write("</tr>");
            }
             Response.Write("</table>");
        }
     }

Keywords

object report text formula blobfield crvs2010 crvs cr net , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio