Stimulsoft.Reports.Web designer and .NET 6 C# Web API
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello!
I need to integrate the Stimulsoft.Reports.Web Designer with a .NET 6 C# Web API backend.
Frontend is an Angular 14 application.
The report was loaded with no problem, but when I try to save and use the method StiAngularDesigner.GetReportObject(this), the resulting report is null.
For testing purposes I've created a new backend using the .NET 6 C# MVC Application template, and the same frontend / backend code worked fine.
Can you help me?
Thank you.
I need to integrate the Stimulsoft.Reports.Web Designer with a .NET 6 C# Web API backend.
Frontend is an Angular 14 application.
The report was loaded with no problem, but when I try to save and use the method StiAngularDesigner.GetReportObject(this), the resulting report is null.
For testing purposes I've created a new backend using the .NET 6 C# MVC Application template, and the same frontend / backend code worked fine.
Can you help me?
Thank you.
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello,
Please check samples at the following link:
https://github.com/stimulsoft/Samples-Angular
if the issue is still present, please send us a sample project that reproduces the issue for analysis.
Thank you.
Please check samples at the following link:
https://github.com/stimulsoft/Samples-Angular
if the issue is still present, please send us a sample project that reproduces the issue for analysis.
Thank you.
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello!
My Web API is stateless and I think the Report Designer is trying to save each change in the server, before I really save the report file.
It only worked when I added the code " builder.Services.AddMemoryCache() " in the Startup.cs / Program.cs file.
But this application is running on multiple instances, so I cannot just use the server memory, because changes could be saved in different server instances.
I think we would need to configure an external cache, like Redis or something.
Is there an option in Designer to stop saving each change and save only when user clicks "Save" in the menu, sending the whole file?
If this option is not available, can you add in a new version?
Thank you.
My Web API is stateless and I think the Report Designer is trying to save each change in the server, before I really save the report file.
It only worked when I added the code " builder.Services.AddMemoryCache() " in the Startup.cs / Program.cs file.
But this application is running on multiple instances, so I cannot just use the server memory, because changes could be saved in different server instances.
I think we would need to configure an external cache, like Redis or something.
Is there an option in Designer to stop saving each change and save only when user clicks "Save" in the menu, sending the whole file?
If this option is not available, can you add in a new version?
Thank you.
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello,
You can set the CacheMode=None
https://www.stimulsoft.com/en/documenta ... ttings.htm
Thank you.
You can set the CacheMode=None
https://www.stimulsoft.com/en/documenta ... ttings.htm
Thank you.
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
When I set CacheMode=None it starts showing the message "Your session has expired!"
This is how I'm setting the property CacheMode:
I've attached the source code projects.
Am I doing something wrong?
Thank you!
This is how I'm setting the property CacheMode:
I've attached the source code projects.
Am I doing something wrong?
Thank you!
- Attachments
-
- StimulsoftDesignerWebApiTest.zip
- (221.6 KiB) Downloaded 194 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello!
I've changed the Post method in DesignController to load and return the report on every request.
I don't understand the need of doing server requests on every report change when cache is set to none, but the message "Your session has expired!" disappeared.
Now the problem is when saving the report template. User clicks "Save", the requestParams.Action is StiAction.SaveReport, but the report object is null.
I've changed the Post method in DesignController to load and return the report on every request.
I don't understand the need of doing server requests on every report change when cache is set to none, but the message "Your session has expired!" disappeared.
Now the problem is when saving the report template. User clicks "Save", the requestParams.Action is StiAction.SaveReport, but the report object is null.
Code: Select all
var report = StiAngularDesigner.GetReportObject(this); // null object
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello.
Method StiAngularDesigner.GetReportObject(this); // null object
takes report from cache, so if you use CacheMode=None, - you must provide your own method to get report.
Method StiAngularDesigner.GetReportObject(this); // null object
takes report from cache, so if you use CacheMode=None, - you must provide your own method to get report.
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello!
So the designer is not compatible with stateless APIs?
The available options are setting up an external session/cache or provide myself a method to get the report?
Thank you.
So the designer is not compatible with stateless APIs?
The available options are setting up an external session/cache or provide myself a method to get the report?
Thank you.
-
- Posts: 10
- Joined: Tue Jan 10, 2023 8:38 pm
- Location: Brazil
Re: Stimulsoft.Reports.Web designer and .NET 6 C# Web API
Hello!
As a workaround I've created a new stateful ASP.NET MVC Web App.
This new webapp will run all designer requests, like loading/saving reports and other commands.
Thank you.
As a workaround I've created a new stateful ASP.NET MVC Web App.
This new webapp will run all designer requests, like loading/saving reports and other commands.
Thank you.