This is a migrated thread and some comments may be shown as answers.

[Solved] ExportToExcel with Azure

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 24 Jul 2013, 05:44 PM
Greetings,

I'm experiencing a problem exporting a grid to Excel while testing with the Azure Emulator.  I have not deployed to Azure, so I'm not sure the problem exists once deployed.  The problem isn't related to the grid at all, or so it appears.  I'm hoping someone has experienced a similar problem and can point me in the right direction.  The funny thing is that if the grid is bound to an empty generic list the exception doesn't occur.  It only occurs when there are rows present in the grid.  The error I receive is as follows:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 7/24/2013 10:05:45 AM

Event time (UTC): 7/24/2013 5:05:45 PM

Event ID: bd332a71f6e44a9690da782e0ebcadb6

Event sequence: 135

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1273337584/ROOT-1-130191590609111328

Trust level: Full

Application Virtual Path: /

Application Path: C:\Users\Administrator\Desktop\Flowtivity\Flowtivity.Web\

Machine name: EPGSA-CPD-2010

Process information:

Process ID: 5192

Process name: iisexpress.exe

Account name: CPD2010\administrator

Exception information:

Exception type: HttpException

Exception message: Cannot use a leading .. to exit above the top directory.

at System.Web.Util.UrlPath.ReduceVirtualPath(String path)

at System.Web.Util.UrlPath.Reduce(String path)

at System.Web.VirtualPath.Combine(VirtualPath relativePath)

at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)

at System.Web.HttpServerUtility.MapPath(String path)

at Telerik.Web.UI.ExportInfrastructure.Image.GetImageFromUrl()

at Telerik.Web.UI.ExportInfrastructure.Image.GetImage()

at Telerik.Web.UI.ExportInfrastructure.XlsBiffRenderer.CreateWorksheet(Table tbl, Workbook wb)

at Telerik.Web.UI.ExportInfrastructure.XlsBiffRenderer.Render()

at Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any feedback is greatly appreciated!

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 29 Jul 2013, 09:50 AM
Hi Paul,

The most probable cause for getting that exception is if your web page is referring to content in folder which is one or more levels up from your page root folder. This will be considered as invalid path and throw an exception. 

If you are accessing the root directory from subdiretories I could suggest you use ~/ (Root-relative) Path insead of "../" and see if it helps in your case.

If you continue to experience that issue, please provide a code snippet from your project (.aspx and web.config files) for inspection.

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Paul
Top achievements
Rank 1
answered on 30 Jul 2013, 01:42 PM
Thanks for the reply, Konstantin.  I decided to go the route of ExcelML within my data access layer rather than export from the RadGrid itself.  I will try your approach once time permits to satisfy my curiosity and for future reference.  Thanks again.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Paul
Top achievements
Rank 1
Share this question
or