javascript error on 'export'

Stimulsoft Reports.WEB discussion
Post Reply
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

javascript error on 'export'

Post by brianj774 »

TypeError: this.options[this.parentTable.getAttribute(...)] is undefined
https://xyzk.com/Portal/WebResource.axd ... 2720000000
Line 17

I just updated to build 1900, and found that I am unable to export/save any reports in the non-flash version.

Happens with Save to (pdf, csv, excel, word).... I assume it happens for all types, but I only have those four options enabled.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: javascript error on 'export'

Post by Alex K. »

Hello,

Can you please describe your issue in more details.

Thank you.
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

Sure, I was a bit pressed for time with the first post, and hoped it would be enough to get the ball rolling.

So, at your suggestion, I updated to the 2014.1 version (build 1900), to resolve some other issues that we've been having. All issues seem to be resolved, as near as I can tell.

Our software uses stimulsoft in 2 ways. First, it is our main reporting tool. Second, it is our receipt generator (a receipt is nothing more than a very special report). Over the years we've encountered situations which seem to break stimulsoft, and the only easy way around them was to make certain tweaks to our software to change rendering modes. To that end, we have a user preferences screen, where a logged in user may specify which stimulsoft engine to use for each of their two usages (receipts and reports). So, a user might choose to use the Flash engine on receipts, and the HTML5 engine on the reports. Or any other configuration. Addidionally, we let them provide information about the default printing output options (html, pdf, image, etc.)... this works reasonably well on the HTML5 side, but not so well on the Flash side.

Anyways, after the update to build 1900, I am finding that the options in the save (export) menu don't work. On click, they close the dialog, and generate the error:
TypeError: this.options[this.parentTable.getAttribute(...)] is undefined
https://xyzk.com/Portal/WebResource.axd ... 2720000000
Line 17

The error comes from the code module: StiMvcViewer.prototype.InitializeExportDropDownList
in the function: dropDownList.reset
the full error line: this.value = this.options[this.parentTable.getAttribute("defaultIndexItem")].value;


I've never had issue with this code in the past. Also, just to be certain, I set some breakpoints in my ExportEvent function, but that never gets hit. This error happens before the callback executes. Firebug verifies this fact...no 'Net' activities happen subsequent to the selection of the menu item.

I hope this is sufficient information for you now, I can't really think of anything else pertinent to add. Let me know if you need something more.

Thanks
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

Ok, I think I've found the base cause.

My MvcViewerOptions setup is fairly large...



var o = new StiMvcViewerOptions() {
ActionGetReportSnapshot = "GetReportSnapshot",
ActionExportReport = "ExportEvent",
ActionPrintReport = "PrintEvent",
ActionViewerEvent = "ViewerEvent",
ScrollbarsMode = true,

ShowExportDialog = true,
ServerCacheMode = StiCacheMode.Session, // default value is "Page" which obviously conflicts for us. If "Session" doesn't work then we'll have to fall back to "None", but that is a last resort (terrible efficiency).

ShowExportToCsv = true,
ShowExportToDbf = false,
ShowExportToDif = false,
ShowExportToDocument = false,
ShowExportToExcel = true,
ShowExportToExcel2007 = false,
ShowExportToExcelXml = false,
ShowExportToHtml = false,
ShowExportToHtml5 = false,
ShowExportToImageBmp = false,
ShowExportToImageGif = false,
ShowExportToImageJpeg = false,
ShowExportToImageMetafile = false,
ShowExportToImagePcx = false,
ShowExportToImagePng = false,
ShowExportToImageSvg = false,
ShowExportToImageSvgz = false,
ShowExportToImageTiff = false,
ShowExportToMht = false,
ShowExportToOpenDocumentCalc = false,
ShowExportToOpenDocumentWriter = false,
ShowExportToPdf = true,
ShowExportToPowerPoint = false,
ShowExportToRtf = false,
ShowExportToSylk = false,
ShowExportToText = false,
ShowExportToWord2007 = true,
ShowExportToXml = false,
ShowExportToXps = false,

Width = System.Web.UI.WebControls.Unit.Percentage(100),
Height = System.Web.UI.WebControls.Unit.Pixel(800)
};


The largest portion, as you can see, is a list of Export Buttons to show/hide.... What I've found, is that when I comment out 12 options, functionality returns (though a javascript error is still thrown). Commenting out 11 or less, the problem persists... 12 or more, the problem goes away!

.... Nope....

That doesn't seem to be quite right... I took that same list of ShowExportXYZ's, and modified it to be like this:

// ShowExportToCsv = true,
//ShowExportToDbf = false,
//ShowExportToDif = false,
//ShowExportToDocument = false,
// ShowExportToExcel = true,
// ShowExportToExcel2007 = false,
// ShowExportToExcelXml = false,
//ShowExportToHtml = false,
//ShowExportToHtml5 = false,
//ShowExportToImageBmp = false,
//ShowExportToImageGif = false,
//ShowExportToImageJpeg = false,
//ShowExportToImageMetafile = false,
//ShowExportToImagePcx = false,
//ShowExportToImagePng = false,
//ShowExportToImageSvg = false,
//ShowExportToImageSvgz = false,
//ShowExportToImageTiff = false,
ShowExportToMht = false,
ShowExportToOpenDocumentCalc = false,
ShowExportToOpenDocumentWriter = false,
// ShowExportToPdf = true,
ShowExportToPowerPoint = false,
ShowExportToRtf = false,
ShowExportToSylk = false,
// ShowExportToText = false,
// ShowExportToWord2007 = true,
//ShowExportToXml = false,
//ShowExportToXps = false,

For THAT setup, the magic number was around 20.... adding the last two lines (as comments) was the tipping point for this setup. So, it doesn't appear to have anything to do with a specific number of elements, nor does it appear to be related to SPECIFIC show elements.

Hopefully this gives you some good data to work with.
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

Here's another interesting experiment. Undoing all the 'comments', and instead, just setting all the options to true, yields a (mostly) working system...

So, its no the number of entries in the list, causing problems....instead, it has something to do with the number of false's...
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: javascript error on 'export'

Post by Vladimir »

Hello,

We found and fixed the error. An error occurred when disabled all exports of images.
Update will be available in the next prerelease build.

Thank you for detailed bugreport.
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

Awesome, thanks!
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

Out of curiosity, were you also able to fix the javascript error that shows up in the console, despite an otherwise working system?

Hmm...I'm unable to verify your solution (in order to get at that other bug....). I set all the Image exports to false EXCEPT for the Png type...and retested. I still get the original error. :(
brianj774
Posts: 177
Joined: Tue Jan 11, 2011 7:15 am
Location: Minnesota

Re: javascript error on 'export'

Post by brianj774 »

I found that I ALSO had to enable at least one of the HTML export options as well.... 1 image and 1 html... for it to start working again.

After I did that, I got another error:

"NetworkError: 404 Not Found - https://webstore.revtrak.com/Portal/Web ... 2720000000"


I'd really like to eliminate that error as well. My sys-admin is getting very unhappy with the numbers of these we were seeing on the 2013.2 release. (images related, for the most part).. This one seems to be image related as well... its right between a image of an X, and a 3x22 pixel bluish background thing.

It shows up when opening the Export Settings dialog. Any of them. Is there any way to change the behavior on this, so that our Elmah system doesn't catch all of these events, and bombard my sys-admin with unimportant error messages?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: javascript error on 'export'

Post by Vladimir »

Hello,

Error with inaccessible resource is fixed. Update will be available in the next prerelease build.
Error was present only in the Default theme. In other themes all resources should be loaded correctly.

Thank you.
Post Reply