Sign in to follow this  
juaritos

Export Handlers For Asp.net Mvc

Recommended Posts

I'm trying to export using ASP.NET MVC. Found the export handlers for ASP.NET, but these won't compile as is. What changes do we need to do in order include these on an MVC based app?

 

Thanks

Share this post


Link to post
Share on other sites

That MVC3 sample validates what I did at the root level. But it does not use Areas. But, I did figure out the issue when Areas are in-play. I have to adjust the path to the SWF file when I am adding the chart javascript when I am in a particular view within an area. Seems simple, now that I have it figured out.

 

Basically, if you have defined an area name "Demo", so that it essentially lives within the Areas folder. And, say your controller is "HomeController", and your view is "Home", action is "Index", you would reach that page with one of these URL's, for example (given that you route this correctly.)

 

www.mysite.com/MyApp/Demo/Home

www.mysite.com/MyApp/Demo/Home/Index

 

 

To allow that path to render a chart you have place on your page in Flash, the path to your FusionCharts folder off your root would need to be as shown here:

  var myChart = new FusionCharts("../../FusionCharts/Line.swf", "myChartId", "400", "300", "0", "1"); 

 

If you did NOT use Areas, and your URL was straight to a Home controller, your path would have just been:

  var myChart = new FusionCharts("FusionCharts/Line.swf", "myChartId", "400", "300", "0", "1"); 

 

 

****

And, I realized, that if you are forcing pure javascript/HTML5 rendering, it simply parses the chart type from that first argument. You can simply provide "Line", and you get a line chart. Not sure if that is documented. Probably not, since it desires the full path if you let it run normally with Flash as the first choice.

****

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this