Loading an rtf file in a rtffield in flexreport

Posted by: jon.herrero on 25 June 2019, 1:10 am EST

    • Post Options:
    • Link

    Posted 25 June 2019, 1:10 am EST

    Hi

    how can i load an RTF file to an RTF field in a flexreport? . i’ve tried to find a method as LoadRTF in c1editor control.

    I’ve got a field named “attached” that contains the Filename (with the fullpath) with an RTF file containing a document.

    for example , my file is “c:\tmp\idencuentro 78.rtf” and i want to load it in field rtffield1 in my report

    Thanks in advance

  • Posted 25 June 2019, 8:16 pm EST

    Hello,

    You cannot load an rtf file in RtfField directly. However, this can indirectly be done by reading the rtf file text in a string and then using that string in Rtffield.Text property. This is done as follows:

                c1FlexReport1.Load("../../DemoReport.flxr","Report 1");
                string rtfText = System.IO.File.ReadAllText("../../Sample.rtf");
                C1.Win.FlexReport.RtfField rtf = new C1.Win.FlexReport.RtfField();
                rtf = (C1.Win.FlexReport.RtfField)c1FlexReport1.Fields["Field1"];
                rtf.Text = rtfText;
                c1FlexViewer1.DocumentSource = c1FlexReport1;
    

    An application is attached for your reference.

    Regards,

    Esha

    prj_FlexReportSample_LoadRtf.zip

  • Posted 25 June 2019, 10:08 pm EST

    Thaks Esha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels