Crystal Reports on the web

Looking at the huge number of links, my code snippets and samples that I've accumulated during my journey with Crystal Reports and Report Server (RAS), I've realized that something should be done with all that. So, for all who are struggling with similar problems I've faced while pursuing that elusive goal of putting Crystal Reports on the web, I will put as much information here as I can ...

Monday, June 21, 2004

Currently Used Database fields on the report

Similar problem is how to retrieve all fields that are used on the report:

//'---------------------------------------------------------
//
// GetCurrentlyUsedDatabaseFields
//

// ICollection
// Get all used db fields from the report.
//

//'---------------------------------------------------------
private ICollection GetCurrentlyUsedDatabaseFields()
{
SortedList sortedlist = new SortedList();
string strShortFieldName;
Fields fields = _reportClientDocument.DataDefinition.ResultFields;
foreach(Field field in fields)
{
if(field.Kind == CrFieldKindEnum.crFieldKindDBField)
{
char period = '.';
int periodIndex = field.FormulaForm.IndexOf(period);
// parse out table and field name
strShortFieldName = field.FormulaForm.Substring(periodIndex+1, field.FormulaForm.Length-(periodIndex+2));
sortedlist.Add(field.FormulaForm, strShortFieldName);
}
}
return sortedlist;
}

2 Comments:

  • At 1:27 PM, Blogger Johnny said…

    Glad to see someone is carrying on the war against erm something.

    I used CR for a while but gave it up and went back to Java.

    I really enjoyed how CSP was really ASP with their proprietary tags. hehe, Cheers!

     
  • At 10:07 AM, Blogger Branka said…

    Well, version 9 that I'm using is ASP all over - I think that CSP tags were experiment in one of the older version... Problem is missing documentation for .NET now...

     

Post a Comment

<< Home