Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
1952 00 JVCL Components feature always 2004-07-09 11:59 2005-08-28 09:03
RichardLi  
obones  
normal  
resolved  
fixed  
none    
none 3.10  
0001952: TJvCSVDataSet Bugs
jvCSVData.pas unit, TJvCustomCsvDataSet.CopyFromDataset has bug.
'DataSet.Fields.FieldByNumber(I+1)' will not work if you have calculated fields.
To correct this, you can change it to 'DataSet.Fields[I]'.

Additional, TJvCsvDataSet can only copy data from a known Dataset. Use code bellow, you can copy data from any dataset and save to csv file.

  for I := 0 to adataset.FieldCount - 1 do // Iterate
  begin
    case adataset.Fields[I].DataType of
      ftString,ftGuid:
        CsvFieldDef := adataset.Fields[I].FieldName + ':$' + inttostr(adataset.Fields[I].Size);
      ftBytes, ftVarBytes, ftAutoInc, ftWord, ftSmallint, ftInteger:
        CsvFieldDef := adataset.Fields[I].FieldName + ':%';
      ftDate, ftTime, ftDateTime:
        CsvFieldDef := adataset.Fields[I].FieldName + ':@';
      ftFloat, ftCurrency, ftBCD:
        CsvFieldDef := adataset.Fields[I].FieldName + ':&';
      ftBoolean:
        CsvFieldDef := adataset.Fields[I].FieldName + ':!';
    end;
    if aCsvDataset.CsvFieldDef = '' then
       aCsvDataset.CsvFieldDef := CsvFieldDef
    else
       aCsvDataset.CsvFieldDef := aCsvDataset.CsvFieldDef + ','+ CsvFieldDef;
  end;
Issue History
2004-07-09 11:59 RichardLi New Issue
2005-08-10 02:57 obones Note Added: 0007761
2005-08-10 02:57 obones Status new => feedback
2005-08-28 09:03 obones Status feedback => resolved
2005-08-28 09:03 obones Resolution open => fixed
2005-08-28 09:03 obones Assigned To => obones
2005-08-28 09:03 obones Note Added: 0007864

Notes
(0007761)
obones   
2005-08-10 02:57   
The first part about the calculated field is in CVS.
Could you have a look in the latest source and provide more indications for the second part? Especially line numbers and description.
(0007864)
obones   
2005-08-28 09:03   
No answers in a timely manner, this is considered resolved.
As to the second part, please post a new issue should you be able to.