View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003335 | JEDI VCL | 00 JVCL Components | public | 2005-12-01 11:45 | 2006-01-21 08:26 |
Reporter | marcgeldon | Assigned To | jfudickar | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.10 | |||
Summary | 0003335: Bug in TJvDBGridCSVExport during Export (with Bug fix) | ||||
Description | Hello! I've got the following problem: if I export a CSV file and tell the component to export the field names in the first line of the new CSV file (property ShowColumnNames = True), it creates a first line something like this: FIELD1;FIELD2;FIELD3;FIELD4;FIELD5; Seems to be correct. But it isn't. The last seperator ";" is wrong. Some programs expect a new field name now and then they throw an exception. Some others ignore that error in the CSV file. I've fixed this issue. Have a look at the additional information. I hope someone can change this very quick in the CVS. Best wishes, Marc Geldon (PRO IT SYSTEMS >>> www.proitsystems.de) | ||||
Additional Information | +++ ORIGINAL SOURCE START (approx. line 982) +++ function TJvDBGridCSVExport.DoExport: Boolean; var I: Integer; ARecNo, lRecCount: Integer; lBookmark: TBookmark; lString, lField: string; begin FDocument.Clear; Result := True; try if ShowColumnName then begin lString := ''; for I := 0 to FColumnCount - 1 do if FRecordColumns[I].Visible then lString := lString + FRecordColumns[I].ColumnName + Separator; FDocument.Add(lString); end; +++ ORIGINAL SOURCE END +++ +++ NEW SOURCE START (changes are in for loop "I := 0 to FColumnCount) +++ function TJvDBGridCSVExport.DoExport: Boolean; var I: Integer; ARecNo, lRecCount: Integer; lBookmark: TBookmark; lString, lField: string; begin FDocument.Clear; Result := True; try if ShowColumnName then begin lString := ''; for I := 0 to FColumnCount - 1 do begin if FRecordColumns[I].Visible then lString := lString + FRecordColumns[I].ColumnName; if (I <> FColumnCount - 1) then lString := lString + Separator; end; FDocument.Add(lString); end; +++ NEW SOURCE END +++ | ||||
Tags | No tags attached. | ||||
|
Additional information: this bug fix is running without problems and we use that stuff in an productive enviroment here. |
|
New source seems to include a new bug: Separator will be added to "IString" even when FRecordCoolums[i] is not visible. |
|
that's correct. So the source should look like this: ++++ SNIP ++++ if ShowColumnName then begin lString := ''; for I := 0 to FColumnCount - 1 do begin if FRecordColumns[I].Visible then begin lString := lString + FRecordColumns[I].ColumnName; if (I <> FColumnCount - 1) then lString := lString + Separator; end; end; FDocument.Add(lString); end; ++++ SNIP ++++ So please don't forget to use this code snip here together with the one above. |
|
Bug with Bugfix. Can anybody add this to CVS? |
|
My fix looks like and is commited: for I := 0 to FColumnCount - 1 do if FRecordColumns[I].Visible then if lString = '' then lString := FRecordColumns[I].ColumnName else lString := Separator + lString + FRecordColumns[I].ColumnName; Please give a short feedback if it works. Greetings Jens |
|
Changed again to: for I := 0 to FColumnCount - 1 do if FRecordColumns[I].Visible then if lString = '' then lString := FRecordColumns[I].ColumnName else lString := lString + Separator + FRecordColumns[I].ColumnName; Waiting for a feedback; |
|
change from 01-11-06 did not work, because first line looked like this: ;;;FIELD1FIELD2FIELD3 |
|
I've downloaded the snapshot from today and now it seems to work. If I find any other problems, I will create a new bug. I think this one here can be closed. |
|
Thanks for the info and sorry for the little bug between |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-12-01 11:45 | marcgeldon | New Issue | |
2005-12-01 11:45 | marcgeldon | Note Added: 0008183 | |
2005-12-04 18:16 | nestor | Note Added: 0008195 | |
2005-12-05 09:03 | marcgeldon | Note Added: 0008196 | |
2005-12-12 15:28 | marcgeldon | Note Added: 0008209 | |
2006-01-11 13:16 | jfudickar | Note Added: 0008370 | |
2006-01-11 13:16 | jfudickar | Assigned To | => jfudickar |
2006-01-11 13:16 | jfudickar | Status | new => feedback |
2006-01-20 10:00 | jfudickar | Note Added: 0008410 | |
2006-01-21 02:55 | marcgeldon | Note Added: 0008417 | |
2006-01-21 03:06 | marcgeldon | Note Added: 0008418 | |
2006-01-21 08:25 | jfudickar | Status | feedback => resolved |
2006-01-21 08:25 | jfudickar | Fixed in Version | => 3.10 |
2006-01-21 08:25 | jfudickar | Resolution | open => fixed |
2006-01-21 08:25 | jfudickar | Note Added: 0008419 |