frxRichView contents set font size before print?
I am making a label report for deli items that includes item description, price UPC, and ingredients list.
The ingredients list is a widestring field of up to 1000 characters. This field is tied to a data bound RTF editor to allow user to format ingredients, say to bold any allergens.
I want to ignore the font size in the field's RTF formatting code and print the contents of the widestring in a 6 pt font, so that it fits on the label.
Is there a way I can do this on the RichView OnBeforePrint event? Thank you.
The ingredients list is a widestring field of up to 1000 characters. This field is tied to a data bound RTF editor to allow user to format ingredients, say to bold any allergens.
I want to ignore the font size in the field's RTF formatting code and print the contents of the widestring in a 6 pt font, so that it fits on the label.
Is there a way I can do this on the RichView OnBeforePrint event? Thank you.
Comments
The code executed but it did not change the font size of the text. Paul, if you wish, we can correspond on the forum instead of support ticket. I planned to post the final solution here anyhow.
From Support
You can't to change TfrxRichView font side in the script. In the Delphi's code only
I added TfrxRichObject component to the data module where TfrxReport rxAnyFastReport lives and added frxRich to my units Uses list..
The report runs but font is not changed to 6 pt. IncludeIngredients is true, breakpoint showed code entered the if block. I will probably
not use RTF and go back to using a memo object.
dmPBData.frxAnyFastReport.LoadFromFile(RptPath);
if includeIngredients then
begin
TfrxRichView(dmPBData.frxAnyFastReport.FindObject('Rich1')).RichEdit.SelectAll;
TfrxRichView(dmPBData.frxAnyFastReport.FindObject('Rich1')).RichEdit.SelAttributes.Size := 6;
end;
Screen.Cursor := crDefault;
dmPBData.frxAnyFastReport.ShowReport();
end