hi everybody, I'm having an issue with hiding an animation during the excel export option of the ultrawebgrid. I'm able to display an animation when the user clicks on a link button to export the excel spreadsheet via the client side. Howerver, right after the export, the animation still appears and I can't make it disappear. If anybody could help me, I would greatly appreciate it. Thank you so much.
protected void lbExcelExport_Click(object sender, EventArgs e) { //ShowReport(); Infragistics.WebUI.UltraWebGrid.UltraWebGrid uwgGrid = null; switch (_reportNumber) { case 1: //Workbook wb = new Workbook(); //Worksheet ws = wb.Worksheets.Add(ddReport.SelectedItem.Text); //if (chart.Visible) //{ // WorksheetImage wsi = new WorksheetImage(System.Drawing.Image.FromFile(MapPath(_chartImagePath))); // wsi.TopLeftCornerCell = ws.Rows[0].Cells[0]; // wsi.BottomRightCornerCell = ws.Rows[2].Cells[5]; // wsi.PositioningMode = ShapePositioningMode.DontMoveOrSizeWithCells; // ws.Shapes.Add(wsi); //} uwgExcelExport.ExportMode = Infragistics.WebUI.UltraWebGrid.ExcelExport.ExportMode.Custom; uwgGrid = rSummary.GetGrid; uwgExcelExport.Export(uwgGrid);//, ws, 10, 0); break; case 2: uwgGrid = details.GetGrid; uwgExcelExport.Export(uwgGrid); break; case 4: uwgGrid = rSummary.GetGrid; uwgExcelExport.Export(uwgGrid); break; } //myAnimatedImage1.Visible = false; } protected void uwgExcelExport_EndExport(object sender, EndExportEventArgs e) { e.CurrentWorksheet.Columns[0].Width = 15000; e.CurrentWorksheet.Columns[0].CellFormat.WrapText = ExcelDefaultableBoolean.True; e.CurrentWorksheet.Columns[0].CellFormat.ShrinkToFit = ExcelDefaultableBoolean.True; foreach (WorksheetRow row in e.CurrentWorksheet.Rows) { row.Hidden = false; } string javaScript = "<script language=JavaScript>\n" + "document.getElementById('imgLoader').style.visibility = 'hidden';\n" + "</script>"; ClientScript.RegisterStartupScript(typeof(Page) ,"HideUploadProgress", javaScript); }
Alex,
I am having the exact same issue. The problem is "identifying" when the "export" is complete. The only way to determine the excel export has been completed in the "Download" mode is at the "EndExport" server-side event. And this server-side event does not let any javascript rendering because as you mentioned, it's too late in the page life cycle.
So, how do you suggest the timer at the javascript can be stopped or notified back from the EndExport event?
If the original poster of this thread had found a solution, please do tell.
Thanks
Hello hew0n0,
It has been a while since you have made your post, but I suppose the other community members can benefit from this answer as well.
In the code provided the “RegisterStartupScript()” method is used in “EndExport()” event. It is possible that this method is called to late in the page life cycle and it is not actually added to the page when used in this event - http://community.infragistics.com/forums/p/24510/89842.aspx#89842
You can check your page code with Developer Tools (F12) in the browser and see if the JavaScript code is actually added to the page when “EndExport()” event is fired and executed - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/Infragistics4.WebUI.UltraWebGrid.ExcelExport.v10.3~Infragistics.WebUI.UltraWebGrid.ExcelExport.UltraWebGridExcelExporter~EndExport_EV.html
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebGridExcelExporter_Export_Data_to_Excel.html
You can try to add the function for animation stop in some other event (like export button click) and then use timer to execute it when the exporting is completed.
I hope that this information will be useful.