FR 2018.2 giving me "console is undefined" error

edited March 2018 in FastReport .NET
I have a C# VS 2010 app with Fast Reports for reporting.
I was running a 2015 version of FR previously and the app ran perfectly.

I just upgraded to FR 2018.2.7 and I updated all the references to the new version. No other changes were made.
Now, when I run it, I get this "console is undefined" error in the WebResource_3.axd file. See attached screenshot.
What's going on?

Comments

  • edited March 2018
    just delete 'console' script, it hurts internet explorer browser
  • edited 11:56PM
    ipong wrote: »
    just delete 'console' script, it hurts internet explorer browser
    Where do I find this console script to delete?
  • edited March 2018
    it is embedded in fastreport.web.dll library, fr_util.js, run your mvc app, debug in browser and copy to harddisk, modify it

    do not put @WebReportGlobals.Scripts() in view (MVC)
    do it manually:
    <script type="text/javascript" src="~/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="~/scripts/fr_util.js"></script>
  • edited March 2018
    ipong wrote: »
    it is embedded in fastreport.web.dll library, fr_util.js, run your mvc app, debug in browser and copy to harddisk, modify it

    do not put @WebReportGlobals.Scripts() in view (MVC)
    do it manually:
    <script type="text/javascript" src="~/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="~/scripts/fr_util.js"></script>

    You completely lost me, I've never done anything like this before. A little more explanation on the process would be appreciated.
    It's a Web Forms app, not MVC, BTW.
  • edited March 2018
    i dont know in webforms, try to include these below in your aspx page:

    <script type="text/javascript" src="~/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="~/scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="~/scripts/fr_util.js"></script>
    <link type="text/css" rel="stylesheet" href="~/scripts/jquery-ui.custom.min.css" />
  • edited 11:56PM
    it is easier to do like this:
    1. in aspx page:
    <script type="text/javascript" src="~/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="~/scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="~/scripts/fr_util.js"></script>
    <link type="text/css" rel="stylesheet" href="~/scripts/jquery-ui.custom.min.css" />
    <div id="fastreport"></div>
    2. in aspx page, use ajax (jquery) to call webmethod
    3. webmethod is processing fastreport and returns :
    FastReport.Web.WebReport wr = new FastReport.Web.WebReport();
    return wr.GetHtml().ToHtmlString();
    4. ajax receives data, update the <div>
    $("#fastreport").html(data);
    5. single page application style >
  • edited March 2018
    ipong wrote: »
    i dont know in webforms, try to include these below in your aspx page:

    <script type="text/javascript" src="~/scripts/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="~/scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="~/scripts/fr_util.js"></script>
    <link type="text/css" rel="stylesheet" href="~/scripts/jquery-ui.custom.min.css" />
    No, this isn't fixing anything. Why is it suddenly complaining about 'console'? Is this something new in FR 2018?
  • edited 11:56PM
    try SPA style I mentioned before, probably fastreport doesnt like internet explorer
  • edited March 2018
    ipong wrote: »
    try SPA style I mentioned before, probably fastreport doesnt like internet explorer
    I can't change my whole app just for FR.
    It worked fine in FR 2015 before.
    It works fine when I run FR 2018 designer and then run the report from there.
    It's only running FR 2018 through my app that it hits this error.

    I'm going to uninstall all versions of FR from my dev box, install 2018.2.7 again, and try again.
    If it doesn't work, I'm going to raise a ticket with FR, I think.
  • edited 11:56PM
    actually, someone complained this problem before, search it in forum, but it's never been fixed
    get a try....
  • edited 11:56PM
    ipong wrote: »
    actually, someone complained this problem before, search it in forum, but it's never been fixed
    get a try....
    Excellent, thanks for the head's up on the previous complaint. I tried out their solution and it worked.

    For anybody else in the future who runs across this problem, my solution is to add this code to the .aspx page where the FR runs:

    <script LANGUAGE="javascript">
    // Avoid `console` errors in browsers that lack a console.
    (function() {
    var method;
    var noop = function () {};
    var methods = [
    'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
    'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
    'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
    'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
    method = methods[length];

    // Only stub undefined methods.
    if (!console[method]) {
    console[method] = noop;
    }
    }
    }());
    </SCRIPT>
  • edited 11:56PM
    good job [img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> i never know there is a solution to suppress 'console' word thanks for sharing[/img]

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.