Hello,
I'm evaluating Stimulsoft.Reports.NetCore. I didn't find how I can pass a parameter (a property of my model) from the View into the GetReportData method of my controller. Any idea ?
In the controller, perhaps I must use the StiNetCoreViewer.GetRequestParams method but I don't see how I can set a variable into these parameters from my view code.
Cordially,
Stéphane.
Pass parameters to GetReportData method
Re: Pass parameters to GetReportData method
Hi Stéphane,
Please check the following page:
https://www.stimulsoft.com/en/documenta ... g_data.htm
And also please check the SQL data sources option in that page.
This is also a method of passing some report parameters:
https://www.stimulsoft.com/en/documenta ... viewer.htm
https://www.stimulsoft.com/en/documenta ... meters.htm
Could you please explain more about your task, what exactly you are trying to send from view and the controller?
Thank you,
Edward
Please check the following page:
https://www.stimulsoft.com/en/documenta ... g_data.htm
And also please check the SQL data sources option in that page.
This is also a method of passing some report parameters:
https://www.stimulsoft.com/en/documenta ... viewer.htm
https://www.stimulsoft.com/en/documenta ... meters.htm
Could you please explain more about your task, what exactly you are trying to send from view and the controller?
Thank you,
Edward
Re: Pass parameters to GetReportData method
Yes, I looked at the documentation. In fact, in our ASP.Net Core business application, there is a complex UI where the user can filter and sort a datasource. So, I want to pass this filter (or directly the filtered datasource) to the Stimulsoft report. I didn't find how I can pass these parameters directly to the StiNetCoreViewer component. The mode of operation seems inverted, the StiNetCoreViewer asks for the report name and the datasource but we can't set these parameters directly from the view. I can put these parameters to a memory cache and use it in GetReport and GetReportData methods of the controller but I think there is a better way (that I didn't find).
Re: Pass parameters to GetReportData method
Hello,
You can use two ways:
1. Send parameters in the GET request and read them in the Action of the viewer:
public IActionResult GetReportData(string paramName)
{
...
}
2. Save parameters in the server session and then read them in the viewer actions.
Thank you.
You can use two ways:
1. Send parameters in the GET request and read them in the Action of the viewer:
public IActionResult GetReportData(string paramName)
{
...
}
2. Save parameters in the server session and then read them in the viewer actions.
Thank you.
Re: Pass parameters to GetReportData method
Has any other solution been created for this need? We too need to pass parameters and a token to the report viewer, but passing this in a query string is poor practice. Is there no other way to load a POST request with the report parms and request?
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Pass parameters to GetReportData method
Hello,
You can set the following viewer's option:
and then get all POST parameters in any action of the viewer with the following code:
Thank you.
You can set the following viewer's option:
Code: Select all
Server =
{
PassFormValues = true
}
Code: Select all
var formValues = StiNetCoreViewer.GetFormValues(this);