We are using a trial of the asp.net Core 2019.2 version and are rendering reports in a Viewer within a partial view nicely. We have linked our datasource to SQL Server and have specified "Variables" for some of the conditions within the SQL "where" clause. This works great on first render with the variables being populated in the "GetReport" method in the Controller.
Here is the code for the Viewer instantiation within the partial view.
Code: Select all
@using Stimulsoft.Report.Mvc;
<table width="10" align="center">
<tr>
<td style="width: 100%;" align="center" valign="top">
@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent",
},
Toolbar =
{
DisplayMode = Stimulsoft.Report.Web.StiToolbarDisplayMode.Simple,
ShowOpenButton = false,
ShowAboutButton = false,
Alignment = Stimulsoft.Report.Web.StiContentAlignment.Center,
BorderColor = System.Drawing.Color.White,
ShowRefreshButton = true,
},
Appearance =
{
ShowTooltipsHelp = false,
ShowPageShadow = true,
PageBorderColor = System.Drawing.Color.White,
},
Exports =
{
ShowExportToDocument = false,
ShowExportToSylk = false
},
Localization = "~/Localisation/Reporting/en-GB.xml",
})
</td>
</tr>
</table>
All this is great and working well. What we cannot figure out is how to refresh the report Variables with this new posted-back data and have the report redraw. Is this done within the Controller and, if so, how do we tell the viewer to refresh (thus getting the new data) or is this done within the View and, if so, what is the correct method to call on the Viewer object.
Seems such a simple and common ask and I suspect we are missing something but have been working on this for days!
Thanks in advance for any guidance.
James.