Using html in sql reporting

4 posts, 1 answers
  1. Robert Strazzarino
    Robert Strazzarino avatar
    41 posts
    Member since:
    Jan 2006

    Posted 18 Jan 2010 Link to this post

    Is there an easy way to change some of the tool functionality in how it generates html tags?

    For instance, instead of wrapping text in <strong> </strong> it would wrap the text in <b></b> instead. Any ideas? There is limited support for html in sql reporting and we are restricting all the tools to work with this limitation.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 19 Jan 2010 Link to this post

    Hi Robert,

    RadEditor has a number of built-in content filters whose main purpose is to provide XHTML1.0 compliant content. You can disable some of the filters in order to provide the required output - for your scenario MozEmStrong, FixUlBoldItalic. You can find more Information about built-in content filters in the following help article and live demo:
    Content Filters
    Built-in Content Filters

    If this approach does not fully resolves the problem for your scenario, RadEditor offers the functionality to create a custom content filter to replace unsupported HTML tags. In the help article mentioned above you can find an example of how to create a custom content filter.

    I hope this information helps.

    All the best,
    Dobromir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robert Strazzarino
    Robert Strazzarino avatar
    41 posts
    Member since:
    Jan 2006

    Posted 19 Jan 2010 Link to this post

    Can we set these custom content filters at a global level like with skins?
  5. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 21 Jan 2010 Link to this post

    Hi Robert,

    The RadEditor's custom content filters are designed and registered on the client-side while ASP.NET Themes provide server-side controls styling.

    In addition, it is possible to register some custom content filters in an external JS file and link this file after RadEditor declaration in multiple pages. For example:
    customfilter.js content
    //function that needs to be executed OnClientLoad event for each editor 
    function registerMyFilter(editor) {
        editor.get_filtersManager().add(new MyFilter());
    }
    //content filter 'MyFilter'
    MyFilter = function() {
        MyFilter.initializeBase(this);
        this.set_isDom(false);
        this.set_enabled(true);
        this.set_name("RadEditor filter");
        this.set_description("RadEditor filter description");
    }
    MyFilter.prototype =
    {
        getHtmlContent: function(content) {
            var newContent = content;
            //Make changes to the content and return it
            newContent = newContent.toUpperCase();
            return newContent;
        },
      
        getDesignContent: function(content) {
            var newContent = content;
            //Make changes to the content and return it
            newContent = newContent.toUpperCase();
            return newContent;
        }
    }
    MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);

    aspx file snippet
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="FirstEditorLoad">
    </telerik:RadEditor>
    <telerik:RadEditor ID="RadEditor2" runat="server" OnClientLoad="SecondEditorLoad">
    </telerik:RadEditor>
    <script type="text/javascript" src="js/customfilters.js"></script>
    <script type="text/javascript">
        function FirstEditorLoad(editor, args) { 
            ...
            addMyFilter(editor);
            ...
        }
        function SecondEditorLoad(editor, args) { 
            ...
            addMyFilter(editor);
            ...
        }
    </script>


    Sincerely yours,
    Dobromir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top