Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Error in the page after excel export
posted
I am trying to upload the image( my chart image in the application) in the Excel work sheet image with grid info. After doing the export, if i refresh the page I am getting the following error. This is easily re-producible. Code : protected void btnExport_Click(object sender, EventArgs e) { UltraWebGridExcelExporter1.DownloadName = "Gabriel"; UltraWebGridExcelExporter1.WorksheetName = "Gabriel Sheet"; Workbook wb = new Workbook(); Worksheet ws = wb.Worksheets.Add("main"); WorksheetImage wsi = new WorksheetImage(System.Drawing.Image.FromFile(Server.MapPath("ChartImages/Chart_1.png"))); wsi.TopLeftCornerCell = ws.Rows[0].Cells[0]; wsi.BottomRightCornerCell = ws.Rows[6].Cells[10]; // Get the bounds of cell C3 //Rectangle cellC3Bounds = ws.Rows[5].Cells[5].GetBoundsInTwips(); //wsi.SetBoundsInTwips(ws, cellC3Bounds); wsi.PositioningMode = ShapePositioningMode.MoveAndSizeWithCells; ws.Shapes.Add(wsi); UltraWebGridExcelExporter1.Export(UltraWebGrid1, ws, 6, 0); } Error : Server Error in '/InfragisticsSample' Application. A generic error occurred in GDI+. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ExternalException (0x80004005): A generic error occurred in GDI+.] System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +397778 System.Drawing.Image.Save(String filename, ImageFormat format) +69 Infragistics.WebUI.UltraWebChart.UltraChart.Render(HtmlTextWriter output) +17299 [ImageStoreException: Unable to write chart image files at given file path. Please check and correct UltraChart's DeploymentScenario property. Or please provide write permissions to directory path where chart must save images. Please refer Deployment Scenario section in help files. -Or- Follow KB article link: http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=5444 ] Infragistics.WebUI.UltraWebChart.UltraChart.Render(HtmlTextWriter output) +17458 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.Page.Render(HtmlTextWriter writer) +26 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558