could not convert variant of type (null) into type (olestr)

In FastReport VCL 5 this work's, but in FastReport VCL 6 return the title error:

var

V: string

begin

V := Report.Variables.Variables('Name');

end.

Comments

  • PolomintPolomint Australia

    G'day Daniel,

    What action do you want to take if Variables ['Name'] is Null? If you want the variable "V" to be set to an Empty String, you should code for that. 😉


    with Report.Variables do begin

    if IsNull (Variables('Name')) then

       V := EmptyStr // replace by whatever action you require

    else

    V := Variables('Name');

    end;


    This is not really a FastReport problem but an outcome of mixing Variants and Strings...

    Cheers, Paul

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.