Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
I'm having a problem in a Crystal Reports application where I am getting no fields in the Fields property on a DatabaseTable Object. Fields.Count returns zero for every table. This is only happening on one of our user's computers. It's working fine for all the developers in the office. We cannot see anything that is different. I'm also wondering if I am doing something that is fundamentally wrong. The documentation says for the Fields property "One object exists in the collection for every database field accessed by the report" but we are seeing one object for every field that exists in the database for each table, not just the ones that are accessed by the report (which BTW is really what we want). We are using CR runtime version 11.5. Seems to do the same with 11.0. Any ideas would be appreciated. Here is the code we're using (Delphi):
    procedure TfrmPCMSCrystalReportViewer.BuildColumnList;
    { Populate slColumns with the list of column. 
      For each table in the report, add every column. }
      I, J: Integer;
      Tbl: DatabaseTable;
      with crReport1.Database do begin
        for I := 1 to Tables.Count do begin
          Tbl := Tables[I];
          //process each column in table
          for J := 1 to Tbl.Fields.Count do   
            //add column to list
        end; //for
      end; //with
Posted 22-Jun-12 13:26pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 480
1 mhegazy94 460
2 Ravi Bhavnani 190
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,135
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,619
4 Gihan Liyanage 2,797

Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 22 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100