Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003915 [JEDI VCL] 00 JVCL Components major always 2006-09-19 07:58 2007-01-04 05:33
Reporter ZENsan View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0003915: TJvCustomDBGridExport.GetFieldValue crashes export DoExport function
Description TJvCustomDBGridExport.GetFieldValue crashes export DoExport function.
Also there is one moment:

  Result := True; //!!! Here result id true
  FRunningInstance := True;
  try
    // get running instance
    FWord := GetActiveOleObject(cWordApplication);
  except
    FRunningInstance := False;
    try
      // create new
      FWord := CreateOleObject(cWordApplication);
    except
      FWord := Unassigned;
      HandleException;
// raise EJvExportDBGridException.Create(RsNoWordApplication);
    end;
  end;

  if VarIsEmpty(FWord) then
    Exit;//!!!And here need to set Result to false

This moment is in all DoExport functions.
Additional Information And the second problem is that it will be better to replace GetFieldValue with this function:
function TJvCustomDBGridExport.GetFieldValue(const Field: TField): Widestring;
begin
  if Assigned(Field.OnGetText) and FUseFieldGetText then
  begin
    Result := '';
    Field.OnGetText(Field, Result, True);
  end
  else
  begin
    Result := Field.AsWidestring;
    {Here was Field.Value, but there will be error if Fiels is ftWideMemo or Another field that is ancestor of TMemoField}Conversion to Widestring is more safe - and more usefull, because in Word and Excel we will not lose any Unicde data}
  end;
end;
Tags No tags attached.
Attached Files zip file icon JvDBGridExport.zip [^] (7,803 bytes) 2006-09-26 00:51
zip file icon JvDBGridExport_patch.zip [^] (22,512 bytes) 2006-09-26 07:19
? file icon JvDBGridExport.patch [^] (2,050 bytes) 2006-10-07 09:25

- Relationships

-  Notes
(0010148)
ZENsan (reporter)
2006-09-20 03:04

Where Field.AsWidestring is better to select type of field..
Only when FieldType<>ftInteger,ftFloat...
(0010177)
ZENsan (reporter)
2006-09-26 00:47

This variant of implmenetation I think is better, because when exporting columns into excel - numbers are not stored as text.

function TJvCustomDBGridExport.GetFieldValue(const Field: TField): Variant;
var
  Str: String;
begin
  if Assigned(Field.OnGetText) and FUseFieldGetText then
  begin
    Result := '';
    Field.OnGetText(Field, Str, True);
    Result := Str;
  end
  else
    Result := Field.Value;
end;
(0010183)
ZENsan (reporter)
2006-09-26 06:22

In uploaded source there is some correction of DoExport function. Beacause in the begining Result=True and then after program determines that Word or Excel is not available - There was an Exit, but not Result := False and then Exit..
(0010184)
obones (administrator)
2006-09-26 06:27

Please provide a patch file, it makes integration easier.
(0010185)
ZENsan (reporter)
2006-09-26 06:37
edited on: 2006-09-26 06:42

Can you tel me some Windows utility to generate patch file?
Code Fusion 3.0, PatchWise 3.28 I think is not good for this..

(0010186)
obones (administrator)
2006-09-26 06:52

http://homepages.borland.com/jedi/wiki/index.php?title=Create_a_patch_file [^]

And if you are not already using TortoiseSVN:

http://homepages.borland.com/jedi/wiki/index.php?title=Repository [^]
(0010242)
obones (administrator)
2006-09-29 06:51

Does not look like you used the method described in the wiki, with TortoiseSVN, the patch file is not in the correct format and thus unusable.
(0010254)
ZENsan (reporter)
2006-09-29 08:00

I have used WinMerge utility.. Ok I will try to install Tortoise SVN
(0010291)
ZENsan (reporter)
2006-10-05 10:39

Sorry, but I can't understand how to create patch file with that Tortoise SVN.. I installed it, defined respoitory root and added JVCL folder to it, but how to create atch I don't know. I have no time to investigate this software, because I am very heavy loaded at work :(.
(0010295)
obones (administrator)
2006-10-06 01:37

It's all explained in the links I gave you above. Once you have retrieved the repository via Tortoise, creating the patch is as simple as rigthclicking on the file and choosing "Create patch".
(0010329)
ZENsan (reporter)
2006-10-07 09:26

Problem was, because I didn't completed checkout - so Create patch option was unavailable. This patch is with today's checkout.
(0010372)
ZENsan (reporter)
2006-10-18 10:18

May be I need to correct something?
(0010531)
obones (administrator)
2007-01-04 05:32

Thanks, your patch is now in SVN.
Sorry for the delay.

- Issue History
Date Modified Username Field Change
2006-09-19 07:58 ZENsan New Issue
2006-09-20 03:04 ZENsan Note Added: 0010148
2006-09-26 00:47 ZENsan Note Added: 0010177
2006-09-26 00:51 ZENsan File Added: JvDBGridExport.zip
2006-09-26 06:22 ZENsan Note Added: 0010183
2006-09-26 06:27 obones Note Added: 0010184
2006-09-26 06:37 ZENsan Note Added: 0010185
2006-09-26 06:42 ZENsan Note Edited: 0010185
2006-09-26 06:52 obones Note Added: 0010186
2006-09-26 07:19 ZENsan File Added: JvDBGridExport_patch.zip
2006-09-29 06:51 obones Note Added: 0010242
2006-09-29 06:51 obones Status new => feedback
2006-09-29 08:00 ZENsan Note Added: 0010254
2006-10-05 10:39 ZENsan Note Added: 0010291
2006-10-06 01:37 obones Note Added: 0010295
2006-10-07 09:25 ZENsan File Added: JvDBGridExport.patch
2006-10-07 09:26 ZENsan Note Added: 0010329
2006-10-18 10:18 ZENsan Note Added: 0010372
2007-01-04 05:32 obones Status feedback => resolved
2007-01-04 05:32 obones Fixed in Version => Daily / SVN
2007-01-04 05:32 obones Resolution open => fixed
2007-01-04 05:32 obones Assigned To => obones
2007-01-04 05:32 obones Note Added: 0010531


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker