FR 2018.2 giving me "console is undefined" error
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?
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
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.
<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" />
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
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.
get a try....
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>