View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002899 | JEDI VCL | 00 JVCL Components | public | 2005-04-22 05:51 | 2006-04-05 01:18 |
| Reporter | robycar | Assigned To | obones | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.00 | ||||
| Target Version | Fixed in Version | 3.30 | |||
| Summary | 0002899: TJvgExportExcel always create file even if SaveToFileName is empty | ||||
| Description | Even if TJvgExportExcel.SaveToFilename property is empty a file named ".xls" will be always created. Original Code: if ExtractFileExt(FSaveToFileName) = '' then FSaveToFileName := ChangeFileExt(FSaveToFileName, '.xls'); DeleteFileEx(FSaveToFileName); if FSaveToFileName <> '' then XL.WorkBooks[XL.WorkBooks.Count].SaveAs(FSaveToFileName); Simple Solution if FSaveToFileName <> '' then begin if ExtractFileExt(FSaveToFileName) = '' then FSaveToFileName := ChangeFileExt(FSaveToFileName, '.xls'); DeleteFileEx(FSaveToFileName); XL.WorkBooks[XL.WorkBooks.Count].SaveAs(FSaveToFileName); end; A Better solution may ensure that FSaveToFileName is a valid file name. e.g. a file whose name withouth extension is not an empty string: if ExtractFileName(FSaveToFileName) <> '' then begin if ExtractFileExt(FSaveToFileName) = '' then FSaveToFileName := ChangeFileExt(FSaveToFileName, '.xls'); DeleteFileEx(FSaveToFileName); XL.WorkBooks[XL.WorkBooks.Count].SaveAs(FSaveToFileName); end; | ||||
| Additional Information | Filename: \jvcl\run\JvgExportComponents.pas Class: TJvgExportExcel Method: Execute Line Position: 457 - 462 | ||||
| Tags | No tags attached. | ||||
|
|
Wouldn't it be better to not create the xls-Data if there is no filename? |
|
|
This is ready to be comitted in CVS, basically if the filename is empty, it's not saved. |
|
|
This is now in CVS |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2005-04-22 05:51 | robycar | New Issue | |
| 2005-04-23 01:43 | AHUser | Note Added: 0007053 | |
| 2006-03-30 07:49 | obones | Note Added: 0008765 | |
| 2006-03-30 07:49 | obones | Status | new => confirmed |
| 2006-04-05 01:18 | obones | Status | confirmed => resolved |
| 2006-04-05 01:18 | obones | Resolution | open => fixed |
| 2006-04-05 01:18 | obones | Assigned To | => obones |
| 2006-04-05 01:18 | obones | Note Added: 0008927 |