BugFix: Cannot convert Null to WideString

renerene Prague, Czech Republic, Europe
edited August 2005 in FastReport 3.0
Hi,
few days ago I decided to write my own modification of TfrxMemoView with Unicode support. Yesterday comes very good news, that FR v3.16 supports Unicode. So I made an upgrade and everything (old functions) seems to be OK, but not the Unicode feature.

Problem: As I am using an Oracle 9i database. when switching OCI session into some 8bit character settings, everything is OK. When switching session into Unicode charset, report is not prepared and exception is raised. This exception is raised in unit frxDBSet.pas by:
function TfrxDBDataset.GetDisplayText(Index: String): WideString;
in section that provides assignment of Value:
{$IFDEF Delphi5}
        if (TField(Fields.Objects[i]) is TWideStringField) then
          s := TField(Fields.Objects[i]).Value
        else
{$ENDIF}

Solution: Bugfix of this problem is in proper retyping:
{$IFDEF Delphi5}
        if (TField(Fields.Objects[i]) is TWideStringField) then
//          s := TField(Fields.Objects[i]).Value // - RM 22.08.2005
          s := TWideStringField(Fields.Objects[i]).Value // + RM 22.08.2005
        else
{$ENDIF}

Now it is working well and all my reports are running with Unicode supports.
Big thanks for this feature and greetings to FR development team.

Rene

PS: I suppose that somebody from FR team will correct me if I made some mistake.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.