Modify Loading Messages

4 posts, 1 answers
  1. Colin
    Colin avatar
    2 posts
    Member since:
    Apr 2018

    Posted 25 Feb Link to this post

    Is it possible to modify the loading message on a report? ("0 pages loaded so far...") I have two issues:

     

    1) By default it loads with orange text/background regardless of the white labeling done in the configuration menu.

    2) Some of our reports load slowly, and different text would be helpful to inform the user of such.

  2. Answer
    Neli
    Admin
    Neli avatar
    48 posts

    Posted 28 Feb Link to this post

    Hi Colin,

    If I understood correctly, the requirement is to customize the messages of the Html5 Viewer in the Report Server Manager. This can be done with some minor modifications of the Preview.cshtml View file that could be found in the folder (Telerik Report Server installation folder)\Telerik.ReportServer.Web\Views\Report (for example C:\Program Files (x86)\Progress\Telerik Report Server\Telerik.ReportServer.Web\Views\Report).
    To be able to change some of the loading messages, please, add a new JS file (for example called resources.js). It should contain the following of code:

    (function (trv, $) {
        "use strict";
        var sr = {
            //warning and error string resources
            loadingReport: 'Loading report... Custom',
            loadingReportPagesInProgress: 'Custom Loading Message {0} pages loaded so far...',
            loadedReportPagesComplete: 'Done. Total {0} pages loaded.',
            noPageToDisplay: "No page to display."
        };
        trv.sr = $.extend(trv.sr, sr);
    }(window.telerikReportViewer = window.telerikReportViewer || {}, jQuery));

    Then, please, add a reference in the file that contains the Html5 Viewer (or another web page).

    <script src="PathToTheFile/resources.js"></script>

    Please, check the Localization article that gives the full list with the messages and properties which can be customized. You can see also the attached muted video that demonstrates the above approach. The video can be opened via any web browser with installed Flash plug-in.

    About: 1) By default it loads with orange text/background regardless of the white labeling done in the configuration menu.

    If you would like to change the background color of the dialog window, please add the following piece of code in the file that contains the Html5 Viewer, i.e. Preview.cshtml (or another web page).

    .k-widget.k-tooltip-validation {
             border-color: red;
             background-color: red;
             color: #000;
         }

    This will override the default colors (in red in the example above).
    In the attached Demo file you can also find a demo project which demonstrates the previously explained approaches. The solution is built against Telerik Reporting version 13.0.19.222. Please, Build the Solution first.

    I hope the proposed approach would work for you.
    Let me know if you need any additional help.

    Regards,
    Neli
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

  3. Colin
    Colin avatar
    2 posts
    Member since:
    Apr 2018

    Posted 28 Feb in reply to Neli Link to this post

    Thanks, Neli. This was extremely helpful!
  4. Neli
    Admin
    Neli avatar
    48 posts

    Posted 04 Mar Link to this post

    Hello Colin,

    I am really glad that the issue was solved.
    Please, let me know if you have any additional questions.

    Regards,
    Neli
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top