C1 Editor Control Paste

Posted by: roger.porter on 16 January 2020, 8:32 pm EST

  • Posted 16 January 2020, 8:32 pm EST

    Hi,

    I have an issue with the editor control in that my customers are pasting content from Microsoft Word which is inserting a load of html tags that I cannot process when I come to print the content in Crystal Reports.
    First is there a way so that when the paste is selected it paste it as plain text without any HTML tags or secondly is there a way to intercept the paste into a C1Editor control and determine if the content has certain HTML tags and if so prompt the user and cancel the paste.

    Many Thanks For You Help,

    Roger
  • Replied 19 January 2020, 7:41 pm EST

    Hi Roger,

    When we paste a text in the C1Editor or type any text, the data is formatted by converting it into HTML text automatically. The Text property contains all the text including the HTML tags used in formatting. Could you please confirm whether this is the issue you are currently facing?

    Regards,
    Ashwin
  • Replied 19 January 2020, 8:03 pm EST

    Hi Ashwin,

    I need to intercept the paste of an editor control because some of my customers are pasting content from Microsoft Word which has all kinds of HTML tags that I don't want. When they paste I want to check for certain HTML tags and then message them to say invalid data has been paste.

    Many Thanks,

    Roger
  • Replied 21 January 2020, 5:57 pm EST

    Hi Roger,

    Sorry for the delayed response.

    As per my understanding, if you are using the Text property of the C1Editor class, it must be containing HTML tags that must be causing the issue. We cannot handle the paste event of the C1Editor, but we can remove the HTML tags easily. Whenever you need to create a report using the Text property, you can remove the HTML tags and assign it to a new variable. Please refer to the sample attached for reference.

    ~regards

    C1Editor.zip
Need extra support?

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

Learn More

Forum Channels