Page 2 of 2
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Tue Aug 20, 2019 2:30 pm
by Lech Kulikowski
Hello,
We have reproduced the issue, the NET Core process crashes without any specific errors, and not every time, we will try to solve the problem for the next release.
Thank you.
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Mon Sep 02, 2019 11:44 pm
by kubalak
Thanks. In the meantime, I run into another issue. OS X is my development environment. Production environment is Ubuntu 18.04 with Apache serving as reverse proxy and dotnet being run by supervisor. When I set it up, I get the following error when trying to open designer. Using the same sample project.
Uncaught TypeError: Cannot read property 'CloseForm.png' of undefined
at StiMobileDesigner.SmallButton (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:24811)
at StiMobileDesigner.StandartSmallButton (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:25229)
at StiMobileDesigner.BaseForm (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:30848)
at StiMobileDesigner.InitializeErrorMessageForm (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:31345)
at StiMobileDesigner.receveFromServer (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:279)
at XMLHttpRequest.xmlHttp.onreadystatechange (SimpleList?stiweb_component=Designer&stiweb_action=Resource&stiweb_cachemode=cache&stiweb_version=2019.3.4&stiweb_data=DesignerScripts:167)
Please would you have an idea how to overcome this? Many thanks!!
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Thu Sep 05, 2019 4:42 pm
by Lech Kulikowski
Hello,
We have made some improvements and fixes. Please check the next build which will be within one or two days.
Thank you.
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Wed Sep 11, 2019 9:50 pm
by kubalak
Great!!! It works both on my OS X and behind the Apache reverse proxy on Ubuntu. Thank you!!
Now, the last thing is to turn anti-forgery token back on. In the sample project, in Startup.cs, I commented out lines 37-40 and line 44. The first block adds header and the second adds auto validation. When I turn it on, I get this error for the viewer:
Failed to load resource: the server responded with a status of 400 (Bad Request)
2:1 Uncaught SyntaxError: Unexpected token S in JSON at position 0
at JSON.parse (<anonymous>)
at 2?stiweb_component=Viewer&stiweb_action=Resource&stiweb_data=scripts&stiweb_theme=Office2013WhiteBlue&stiweb_loc=d3d3cm9vdC9SZXBvcnRzL2NzLnhtbA%3d%3d&stiweb_cachemode=cache&stiweb_version=2019.3.5:9171
at XMLHttpRequest.xmlHttp.onreadystatechange (2?stiweb_component=Viewer&stiweb_action=Resource&stiweb_data=scripts&stiweb_theme=Office2013WhiteBlue&stiweb_loc=d3d3cm9vdC9SZXBvcnRzL2NzLnhtbA%3d%3d&stiweb_cachemode=cache&stiweb_version=2019.3.5:931)
And only 400 for the designer.
Please, can it be done? Thanks again!
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Fri Sep 13, 2019 12:20 pm
by Lech Kulikowski
Hello,
You can set the anti-forgery token вin the request header with adding the following JavaScript code on the viewer page after its initialization:
Code: Select all
<script>
jsNetCoreViewer1.openConnection = function (http, url, responseType) {
http.open("POST", url);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.responseType = responseType ? responseType : "text";
// Set authorization header and other custom headers
// http.setRequestHeader(...);
// http.setRequestHeader(...);
}
</script>
Thank you.
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Fri Sep 20, 2019 4:12 pm
by kubalak
Thanks but I still get the same error. Here is the code:
Code: Select all
@using Stimulsoft.Report.Mvc;
@using Stimulsoft.Report.Web;
@using Stimulsoft.System.Web.UI.WebControls;
@{
ViewBag.Title = "Stimulsoft Reports.Web Demo";
}
@Html.StiNetCoreViewer("StiMvcViewer1", new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
},
Server =
{
RequestTimeout = 300
},
Localization = "wwwroot/Reports/cs.xml",
Appearance =
{
BackgroundColor = System.Drawing.Color.FromArgb(0xe8, 0xe8, 0xe8),
ScrollbarsMode = true
},
Toolbar =
{
DisplayMode = StiToolbarDisplayMode.Simple,
ShowDesignButton = false,
ViewMode = StiWebViewMode.SinglePage
},
Height = Unit.Pixel(1250)
})
<script>
StiMvcViewer1.openConnection = function (http, url, responseType) {
http.open("POST", url);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.responseType = responseType ? responseType : "text";
// Set authorization header and other custom headers
// http.setRequestHeader(...);
// http.setRequestHeader(...);
}
</script>
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Mon Sep 23, 2019 6:38 am
by Lech Kulikowski
Hello,
You should set JavaScript headers for antiforgery:
// Set authorization header and other custom headers
// http.setRequestHeader(...);
// http.setRequestHeader(...);
Thank you.
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Wed Oct 16, 2019 8:40 pm
by kubalak
I will play with it. Thank you!!
Re: Viewer - paging undefined, view mode undefined, zoom undefined
Posted: Thu Oct 17, 2019 7:23 am
by Andrew
Okay!