Richeview is showing an expression error when loading variables

I'm banging my head with this, trying to load a document in rich format, from the database directly into a variable, which is dynamic, that is, the user himself creates it, but whenever I load it directly into rich [VARIABLEX] it presents the error, or when I load it into fastscript the same error


procedure Rich1OnBeforePrint(Sender: TfrxComponent);

var

 Stm: TMemoryStream;

begin

  Stm := TMemoryStream.Create;

//  Stm.Write('TESTE GERAL', Length('TESTE GERAL'));        

//  Stm.Write(<VRDIDS>, Length(<VRDIDS>));

//  Stm.Write(PChar(<VRDIDS>)^, Length(<VRDIDS>));


//  Stm.Position:= 0;


//  Rich1.RichEdit.Lines.LoadFromStream(Stm);

  Rich1.AllowExpressions:= false;          

  Rich1.RichEdit.Lines.Text:= '''' + <VRDIDS> + '''' ;


  //Rich1.RichEdit.Lines.Text:= (<VRDIDS>);

end;


Thank you all

Comments

  • Try Rich1.RichEdit.Lines.Text:= '[VRDIDS]' ;

  • It didn't work; the variable receives the text in rich format, even if it's in the memory stream, before even passing it to the line.

    var

    Stl: TStringList;

    begin

    Richt.allowexpressions:= false;

    Stl:= TStringList.Create;

    Stm.Write(Copy(<VRDIDS>,1,Length(<VRDIDS>)-1), Length(<VRDIDS>)-1); -> error expression....


    reports the expression error.

  • edited August 13

    Kennedy

    Obrigado pela informação, tentei via TMemoryStream, como dito no primeiro post, mas inexplicavelmente ao carregar a variável TMemoryStream, ela já exibe o erro, nem chega ao componente, acredito que o formato rtf esteja ok, pois estou carregando no wordpad

    {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}

    \ viewkind4 \ uc1 \ pard \ lang1046 \ f0 \ fs16 teste geral ce cadatri \ \ \ par

    }

    .

    Estou passando o comando para uma variável como esta

    frxR.Variables[informacoes_6.Fields[4]. Texto] := QuotedStr(Trim(Stl.text));

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.