Using RTF (RichText) inside Variables?
Hi...
I've a report with a richtext control placed on it. I've placed a TfrxUserDataSet component on that form to return the master data. Inside the richtext control, I've placed the folloging snippet:
Inside the method "...GetValue(const VarName: string; var Value: Variant);", I've tryed the following:
...but instead of rendering the richtext, FastReport outputs the richtext-description such as {rtf/ansi/....}.
What should I do to be able to render the real richtext?
Regards,
Marc
I've a report with a richtext control placed on it. I've placed a TfrxUserDataSet component on that form to return the master data. Inside the richtext control, I've placed the folloging snippet:
Hello xyz,
[TEXT]
Regards,
...
Inside the method "...GetValue(const VarName: string; var Value: Variant);", I've tryed the following:
  ReportEngine.Variables['TEXT'] := QuotedStr(MyRichText);
...but instead of rendering the richtext, FastReport outputs the richtext-description such as {rtf/ansi/....}.
What should I do to be able to render the real richtext?
Regards,
Marc
Comments
If I disallow expression, the variable [TEXT] won't be replaced...
Regards,
Marc
Anyway, I think the moment you use QuoteStr or GetValue your richtext no longer is 'rich', as you are type casting it as a plain string.
I don't know how to convert it back to RichText format.
Anyone?
However, is it possible that you split your RichView object in 3 objects?
You have this
Band
RichView object
why don't you try putting the text before and after [TEXT] in separate objects, like this:
Band
RichView1.text = 'Hello XYX'
RichView2.text = [TEXT]
RichView3.text = 'Regards...'
I'm suggesting that because I wonder if it's displaying the plain string because you are mixing its value with the text before and after it, but maybe if you try it separately it may work.
The only way I had success to load the value of a TrfxRichView from a separate source was by code, and like this:
rfxRichView1.RichEdit.Lines.LoadFromStream(MydataStream);
I hope I could give you some ideas.
Thank you...splitting the richtext into three parts isn't a solution, cause the enduser can place the placeholder at any position...but I'll try to communicate with the real object and loading the richtext using a stream..
Best regards,
Marc
you can assign the lines of a delphi richtext component to fr's richtext object.
I've used direct control access and now it works very well for me.
Thank you very much for all responses 8-)
Regards,
Marc