Controller for managing all Reports

Stimulsoft Reports.WEB discussion
Post Reply
marianux
Posts: 11
Joined: Thu Oct 24, 2013 5:15 pm

Controller for managing all Reports

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Controller for managing all Reports

Post 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.
Post Reply