Page 1 of 1

Controller for managing all Reports

Posted: Tue Mar 21, 2017 9:45 am
by marianux
I got an asp.net mvc aplicattion with differents controllers.
There's Controller for every Model, like customers, Orders, etc..
I got to add reports for every controller.
All reports got the same parameters so id like to create just one controller that manages all Reporting actions, so i will have centralized all this stuff.
For example, i create ReportsController.
In Reports controller i got all Actions for Reporting (GetReportSnapshot, etc...)
In GetReportSnapshot i decide what Report it must be shown.

Then in a view for reporting from Customer Controller id like that i could do something like that:

Code: Select all

@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
    Actions =
    {
        GetReportSnapshot = "Reports/GetReportSnapshot",
        ViewerEvent = "Reports/ViewerEvent",
        EmailReport = "Reports/EmailReport"
    }
      
})
Is it possible or Actions must be in the same controller than view?

thanks in advance.

Re: Controller for managing all Reports

Posted: Wed Mar 22, 2017 8:26 am
by Alex K.
Hello,

Please try to use the following code:

Code: Select all

@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
    Server = 
    {
        Controller = "Reports"
    },
    Actions =
    {
        GetReportSnapshot = "GetReportSnapshot",
        ViewerEvent = "ViewerEvent",
        EmailReport = "EmailReport"
    }
})
Thank you.