Custom Routes with Stimulsoft MVC Viewer

Stimulsoft Reports.WEB discussion
Post Reply
User avatar
allo_man
Posts: 17
Joined: Sun Jun 10, 2012 6:56 am
Location: Canada

Custom Routes with Stimulsoft MVC Viewer

Post by allo_man »

We created a custom routes for our application, the custom route includes culture, but isn't limited to culture. The route config looks like this:

Code: Select all

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapActionRoute("Default", "{culture}/{controller}/{action}/{id}",
                new { controller = "Home", action = "Login", culture = "en", id = UrlParameter.Optional },
                new CultureConstraint(Culture.en.ToString(), Culture.fr.ToString(), Culture.ru.ToString())
            );
        }
So the URLs looks like
and for my report the URL looks:
The problem is that the report viewer is calling a URL via ajax that isn't formed correctly. the /en/ (culture part) isn't included in the Ajax call. It's calling:
To give you more info, the

Code: Select all

@Html.Stimulsoft().StiMvcViewer(@Model.StiMvcViewerOptions 
generates, from that line, we can see that the routes are ok, the problem is the requestUrl.

Code: Select all

"requestUrl":"https://localhost:44300/Certificat/","actionInteraction":"Interaction","routes":"%7b%22culture%22%3a%22en%22%2c%22action%22%3a%22CertificatMiseEnReserveReport%22%2c%22controller%22%3a%22Certificat%22%2c%22id%22%3a%221%22%7d"
And the StiMvcViewerOptions are:

Code: Select all

            StiMvcViewerOptions = new StiMvcViewerOptions()
                {
                    Theme = StiTheme.Office2010,
                    ActionGetReportSnapshot = "GetReportSnapshot",
                    ActionViewerEvent = "ViewerEvent",
                    ActionPrintReport = "PrintReport",
                    ActionExportReport = "ExportReport",
                    ActionInteraction = "Interaction"
                };
Is there anyway to configure our custom routes for the MvcViewer?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Custom Routes with Stimulsoft MVC Viewer

Post by Vladimir »

Hello,

We have reproduced the error, we need some time to fix it.

Thank you.
User avatar
allo_man
Posts: 17
Joined: Sun Jun 10, 2012 6:56 am
Location: Canada

Re: Custom Routes with Stimulsoft MVC Viewer

Post by allo_man »

Thanks,
I'll wait for your fix.

Regards,
Alex
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom Routes with Stimulsoft MVC Viewer

Post by HighAley »

Hello.

We will let you know when it will be available.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom Routes with Stimulsoft MVC Viewer

Post by HighAley »

Hello.

The issue is solved. The patch will be available in our next prerelease build on April 19.

Thank you.
Post Reply