Console errors in DesignerScripts
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Console errors in DesignerScripts
These show up on version 2019.2.1, and, apparently, are harmless, but you never know.
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: Console errors in DesignerScripts
Hello,
Please send us a simple project which reproduces the issue for analysis.
Thank you.
Please send us a simple project which reproduces the issue for analysis.
Thank you.
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Re: Console errors in DesignerScripts
More errors, this time I noticed that I cannot use the preview tab of the designer.
The project is the asp.Net Core version 2019.2.1 using a controller to implement the report methods (DesignReport, GetReport, GetReportDesigner, etc).
While the views are created using Html.StiNetCoreViewer and Html.StiNetCoreDesigner Razor methods.
This is from an update from version 2018.3.2 to 2019.2.1.
The project is the asp.Net Core version 2019.2.1 using a controller to implement the report methods (DesignReport, GetReport, GetReportDesigner, etc).
While the views are created using Html.StiNetCoreViewer and Html.StiNetCoreDesigner Razor methods.
This is from an update from version 2018.3.2 to 2019.2.1.
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: Console errors in DesignerScripts
Hello,
We couldn't reproduce the issue on our samples.
Please send us a simple project which reproduces the issue for analysis.
Thank you.
We couldn't reproduce the issue on our samples.
Please send us a simple project which reproduces the issue for analysis.
Thank you.
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Re: Console errors in DesignerScripts
This is the generated html: https://pastebin.com/XMCvGUfn
Apparently, it's missing the script that defines StiJsViewer somehow.
It was generated using this code: https://pastebin.com/DAFVuWu7
Which was loaded using this action:
I also noticed that the sample projects (source) are using JQuery 2.2, while my project is updated to 3.2.
Apparently, it's missing the script that defines StiJsViewer somehow.
It was generated using this code: https://pastebin.com/DAFVuWu7
Which was loaded using this action:
Code: Select all
public IActionResult ViewReport()
{
try
{
var viewModel = new RelatorioViewModel('Test', 1);//This is merely a view model to pass debugging arguments to the view
return View("~/Views/Shared/Stimul/Viewer.cshtml", viewModel);
}
catch (Exception Ex)
{
throw Ex;
}
}
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Re: Console errors in DesignerScripts
After a few more tests today, I figured the cause of the issue.
The src here is using the url for this report instead of the url for the StiJsViewer, which fails to load because there is nothing in that url.
This is my url for that viewer:
As you can see, the order of routes is messed up:
This is my ViewEvent action, if relevant:
Why is it creating that url? What should be the src there instead? How do I fix that?
Code: Select all
<script type="text/javascript" src="/GrupoImpressao/ViewerEvent/Fabrica/Cadastro?&stiweb_component=Viewer&stiweb_action=Resource&stiweb_data=scripts&stiweb_theme=Office2013WhiteBlue&stiweb_cachemode=cache&stiweb_version=2019.2.3"></script>
This is my url for that viewer:
Code: Select all
/Fabrica/Cadastro/GrupoImpressao/ViewReport
Code: Select all
/GrupoImpressao/ViewerEvent/Fabrica/Cadastro?
Code: Select all
public IActionResult ViewerEvent()
{
return StiNetCoreViewer.ViewerEventResult(this);
}
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Re: Console errors in DesignerScripts
I created a copy of the sample project and tried to reproduce the issue. I discovered that this happens due to routing. When a controller has an Area and calls an inherited action instead of using RedirectToAction, the GetReport method will mess up the route when writing that URL.
This works:
This causes the error:
Here is a sample project with the necessary modifications to make the error happen:
This works:
Code: Select all
[Area("MyArea")]
public class ViewerWithoutErrorController : ViewerController
{
static ViewerWithoutErrorController()
{ }
[Route("IndexRedirect")]
public IActionResult IndexRedirect()
{
return RedirectToAction(nameof(Index));
}
}
Code: Select all
[Area("MyArea")]
public class ViewerErrorController : ViewerController
{
static ViewerErrorController()
{ }
[Route("IndexError")]
public IActionResult IndexError(string id)
{
return this.Index(id);
}
}
-
- Posts: 27
- Joined: Wed Jan 30, 2013 10:53 am
- Location: Cuiabá/Mato Grosso - Brazil
Re: Console errors in DesignerScripts
The problem is very similar to what was reported on this other thread.
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: Console errors in DesignerScripts
Hello,
Thank you for the detailed description. We need some to investigate the issue. We will let you know about the result.
Thank you.
#8275
Thank you for the detailed description. We need some to investigate the issue. We will let you know about the result.
Thank you.
#8275