Controller for managing all Reports
Posted: Tue Mar 21, 2017 9:45 am
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:
Is it possible or Actions must be in the same controller than view?
thanks in advance.
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"
}
})
thanks in advance.