View Issue Details

IDProjectCategoryView StatusLast Update
0001952JEDI VCL00 JVCL Componentspublic2005-08-28 09:03
ReporterRichardLiAssigned Toobones 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.10 
Summary0001952: TJvCSVDataSet Bugs
DescriptionjvCSVData.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;
TagsNo tags attached.

Activities

obones

2005-08-10 02:57

administrator   ~0007761

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.

obones

2005-08-28 09:03

administrator   ~0007864

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.

Issue History

Date Modified Username Field Change
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