Page 1 of 1

SOLVED - Issue with MVC viewer and Chrome

Posted: Fri Nov 29, 2013 9:00 pm
by poweredbyporkers
Environment C# .NET 4.5 VS 2012 Update 4 Chrome (v31.0.1650.57) IE11

Hi,

Awesome product so far but I'm a little stumped with this issue. Using the mobile viewer I can see my report and toolbar but I can't use any of the buttons in the toolbar all is fine in IE, using MVC viewer I can see the toolbar but the report just never appears due to a error, but again works fine in IE

Code: Select all

"Uncaught TypeError: Cannot read property 'length' of null" at line 113 of WebResource.axd?d=CC6UhKvo7a7jUnHStCIJAAkR2mWwkvEVmM12bx-ZR1WpkNMVHWZXpZk-nkIwLpNggZcH0sPVWgsvi0r0SvSALBqN9gZOUJyp7QwDI2TZ1wqrZRsSa8p2GzFIIkakMD8aeaqUGhWeCGpdp51wRht6Pyr9jUpNmkARk_2YhvXj85EFp-E9xZAIivJhcjWAz7f-0&t=635213123121677529
Image

I have no idea what I've missed, do you? Here is my view

Code: Select all

@using Stimulsoft.Report.Mvc

@section ScriptHeader
{
    @Html.Stimulsoft().RenderMvcViewerScripts()
}

<table>
    <tr>
        <td style="width: 100%;">
            @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions() {
                Theme = StiTheme.Windows7,
                ActionGetReportSnapshot = Model.ReportName + "SnapshotResult",
                ActionViewerEvent = "ViewerEvent",
                ActionPrintReport = "PrintReport",
                ActionExportReport = "ExportReport",
                ActionInteraction = "Interaction"
            })
        </td>
    </tr>
</table>


@section ScriptFooter
{

}
Thanks!

Re: Issue with MVC viewer and Chrome

Posted: Sat Nov 30, 2013 11:35 am
by poweredbyporkers
I've tracked the issue to a <style type="text/css"></style> that is being created in the head of my page only on webkit browsers. I'm assuming it's returning a NULL or undefined to the node.sheet.cssRules.length line and that's where it's blowing up. Can you guys confirm?

Now all I need to do is work out where the hell it's coming from :x

EDIT:

Actually I was wrong. This is the line that's causing all the headaches

<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700,300&subset=latin,vietnamese,latin-ext' rel='stylesheet' type='text/css'>

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Tue Dec 03, 2013 8:22 am
by HighAley
Hello.

We have added additional check to avoid such issue in future.

Code: Select all

if (node.type == "text/css") {
            if (node.sheet && node.sheet.cssRules) {
                for (j = 0; j < node.sheet.cssRules.length; j++) {
Thank you.

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Tue Dec 03, 2013 8:41 am
by poweredbyporkers
Perfect, thank you

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Tue Dec 03, 2013 10:58 am
by HighAley
Hello.

Let us know if you get any error with our product.

Thank you.

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Thu May 08, 2014 6:22 pm
by sbd_jeff
Has this behavior been applied to your releases?
I'm still getting this error in Chrome.

I've applied the 2014.1.1900.0 dlls:
Stimulsoft.Base
Stimulsoft.Report
Stimulsoft.Report.Mvc
Stimulsoft.Report.MvcMobile

Thanks,

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Mon May 12, 2014 9:01 am
by HighAley
Hello.

Let us know if you need any additional help.

Thank you.

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Mon May 12, 2014 3:49 pm
by sbd_jeff
I've looked at the source for 2014.1.1900.0.
The fix described above was applied to Stimulsoft.Report.Mvc.
It was not applied to Stimulsoft.Report.MvcMobile (specifically the ..\Scripts\Viewer\Viewer.js file).

Please include for next public release.
Thanks!

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Tue May 13, 2014 1:46 pm
by sbd_jeff
Using the following block in Viewer.js:

Code: Select all

    if (node.type == "text/css") {
                if (node.sheet && node.sheet.cssRules) {
                    for (j = 0; j < node.sheet.cssRules.length; j++) {
This works in Chrome and IE, however Firefox 29.0 will raise a "SecurityError: The operation is insecure"

I've found that using node.sheet.rules appears to work:

Code: Select all

if (node.type == "text/css") {
            if (node.sheet && node.sheet.rules) {
                var flag = false;
                for (j = 0; j < node.sheet.cssRules.length; j++) {

Re: SOLVED - Issue with MVC viewer and Chrome

Posted: Thu May 15, 2014 12:37 pm
by HighAley
Hello.

We have made an improvement.

Thank you.