TFrxRichView formatting text

ksihotaksihota Victoria, BC Canada
edited October 2010 in FastReport 4.0
Edit ****Sorry this should be in FR4. Moderator please move over so I don't have to repost****

I am loading several datafields into a frxRichview object in order to place a single objects on the report that can then be moved in edit mode before printing.

The code
rich1.Richedit.lines.add(<Data."Photo">); //loads an image in rtf format
rich1.Richedit.lines.add(<Data."Name">); //currently unformatted text

works fine for placing and displaying the data but I would like to center the information in the Richview object and possibly format lines differently (font size colour etc.) How can I do this in the FR script?

Also, is it possible to place text on top of an image as a single object using FR scripting? Like placing a watermark on an image. The images would all be different as would the text (data from the program not loaded from file.) The object in the end must be a single item that can be moved in the edit window (not several objects layered, or grouped that will move independently)

Thanks for any help.

Edit: This appears to handle the alignment issue for the whole edit:
Rich1.RichEdit.Alignment := taCenter;

Still looking for line formatting.


KS

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:31PM
    fr's rtfmemoview is not a full blown rtf reader writer.
    you can control positions of objectsout put by using the engine objects curx cury props.
    see the user manual on using the engine object.
  • ksihotaksihota Victoria, BC Canada
    edited 3:31PM
    gordk wrote: »
    fr's rtfmemoview is not a full blown rtf reader writer.
    you can control positions of objectsout put by using the engine objects curx cury props.
    see the user manual on using the engine object.


    Is rtfmemoview the same as tfrxrichview?

    I am using a richview component because the object it creates in my report is then moved by the user. I know how to programatically shift objects on the report but for this purpose that won't do.
    Previously, I had used a variable placed in the Richview editor (eg. [name] [photo]) and had an FR dialog that the user used to select differnt options. From within the obp of the master data band , the variables were replaced in the Richview with the proper data fields (eg. [data"FullName"])
    When the report ran the proper fields were filled out from the data supplied by the program and the formatting applied to the variables in the Richview was applied to the report data. This had been working fine.

    When I upgraded the program I was no longer able to get this to work. Either some setting got changed or the component was altered in some way. My guess is that I have forgotten to make a change to the report, but I can't figure out what it could be.
    In the meanwhile I have simple used the richedit.add() method to place the datafields into the richedit and this appears to work fine, other than I don't seem to be able to format the text.

    I have looked before, but can not seem to find any method or property listings for the Richview component. I am just guessing and testing possibilities and eventually l stumble across some that work.
    Do you know where I can find this information?

    Thanks for all your help Gord.

    KS
  • ksihotaksihota Victoria, BC Canada
    edited 3:31PM

    Previously, I had used a variable placed in the Richview editor (eg. [name] [photo]) and had an FR dialog that the user used to select differnt options. From within the obp of the master data band , the variables were replaced in the Richview with the proper data fields (eg. [data"FullName"])
    When the report ran the proper fields were filled out from the data supplied by the program and the formatting applied to the variables in the Richview was applied to the report data. This had been working fine.

    When I upgraded the program I was no longer able to get this to work. Either some setting got changed or the component was altered in some way. My guess is that I have forgotten to make a change to the report, but I can't figure out what it could be.

    [/quote]

    I must be a real idiot. I was rereading one of your posts on variables Gord, and I thought I would try one more time. Guess what??? it worked.

    I think that I must have changed the <> to [] so the datafield didn't work.
    This does work
    if FNameCheckbox.checked then Name:=<Data."FName">;

    This method appears to be working fine now and the variable data is formatted as the variables are in the RichView.

    KS
  • gordkgordk St.Catherines On. Canada.
    edited 3:31PM
    "Is rtfmemoview the same as tfrxrichview?"
    Yes that is what i meant.
    What you are experiencing is that when the text contains a variable and that text is stored in an rtf file or in a formatted memo field and is in itself a variable or expression . the text must be placed into the memo before the memo is processed. ie in the obp event of the band

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.