November Happy Hour will be moved to Thursday December 5th.

Issue with blog post "Create Custom Report In MVC with Excel Export"

Vote:
 

I would have prefferred to put this on the blog post itself but comments seem to be disabled, so apologies if this feels like it could be somewhere better

http://world.episerver.com/blogs/Henrik-Fransas/Dates/2016/3/create-custom-report-in-mvc-with-excel-export/

I've been trying to set this up as is before modifying it for my own needs. However, I'm getting this error when selecting the report

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /episerverfindreport

I've put a break point on this method

protected override void RegisterRoutes(RouteCollection routes)
{
base.RegisterRoutes(routes);
routes.MapRoute("episerverfindreport", "EpiserverFindReport/{action}",
new { controller = "EpiserverFindReport", action = "Index" });
}


However, it doesn't ever seem to run. I've attempted to get this working with 2 different version of episerver, one corresponding to update 61 and the other to update 102.

Has anyone else tried this or can someone help explain what the problem is?

#146709
Mar 21, 2016 17:43
Vote:
 

Strange, I just tried to write a comment and it worked great.

Regarding you problems, have you created the controller with the exact name as I have used?

The route you set up in global.asax.cs must point to the url you want to use and the controller you use.

Could you write here how your global.asax.cs and controller looks like?

#146710
Mar 21, 2016 18:30
Vote:
 

I uploaded my example here:

https://dl.dropboxusercontent.com/u/14161504/AlloyExample.zip

All you have to do is insert your own Episerver Find Index info in web.config and then you should be up and running (after indexing some pages)

#146715
Mar 21, 2016 21:53
Vote:
 

Thanks so much Henrik, I went over my code trying to figure out what was different but struggled to spot it, so just overwrote my attempt with the code you sent and it's working great now.

Sorry to leave the problem as a mystery! Looking forward to adapting this report to work for blocks instead of pages now, cheers. 

#146738
Mar 22, 2016 12:20
Vote:
 

Great that it works.

please mark the response as answer if you think it solve the problem

#146760
Mar 22, 2016 18:48
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.