Hi, My Name is Edmundo Guerrero
I am working with the following tools:
The Problem.
When I instantiate the UltraWingGrid.ExcelExport as shown below:
If e.Tool.Key = "Exportar a Excel" Then
Dim HojaExcel As New UltraGridExcelExporter
HojaExcel.Export(Me.UltraGrid1, "c:\pais.xls")
Process.Start("c:\pais.xls")
End If
and run the program the following errors message displayed:
System.ArgumentException was unhandled by user code
Message=Parameter is not valid.
Source=System.Drawing
StackTrace:
at System.Drawing.Graphics.GetHdc()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter..ctor()
at MenuPrincipal.pais.UltraToolbarsManager1_ToolClick1(Object sender, ToolClickEventArgs e) in E:\Sistema Minerva2010\MP\MP100\MenuPrincipal\pais.vb:line 281
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnToolClick(ToolClickEventArgs e)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.FireEvent(ToolbarEventIds id, EventArgs e)
at Infragistics.Win.UltraWinToolbars.ToolBase.OnToolClick()
at Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.DoClickProcessing(MouseEventArgs e)
at Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.OnMouseUp(MouseEventArgs e)
at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e)
at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e)
at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
at Infragistics.Win.UltraControlBase.OnMouseUp(MouseEventArgs e)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
Thank you very much in advance for a quick response.
Edmundo Guerrero
I think the problem might be your project references.
eaguerrero said: 10. infragistics2.documents.excel.v11.1 11. infragistics2.win.ultrawingrid.excelexport.v11.1
Is this a complete list of your project references? I assume it's not, since you did not list the UltraWinGrid assembly. But even so, you should be using Infragistics3 for the Excel references, not Infragistics2.
Here's the bare minimum you should be using:
hi Mike
I do have the correct references (just checked). Any ideas?
Sorry, that was my development computer. Problem is happening at client's computer. This are their references, as you see there is no Documents.Excel library, but Documents and Excel
Hi,
I don't see anything wrong there, then. The exception is occurring when trying to create a graphics object, so that seems to indicate a memory leak.
What version of the controls are you using? Your original post said 11.1, but obviously that was incorrect and you are using 10.3. But what build? Do you have the latest service release?
We recently fixed an issue with UltraExplorerBar which could cause the exception you are getting. And I noticed your project is reference the ExplorerBar assembly. So you might just need to get the latest service release.
How to get the latest service release - Infragistics Community
Hi Mike,
I reused another one's post. There comes de inconsistence. My fault.
I am using 10.3.20103, but the error is raising in UltraExcelExporter. May it be related? We are not allowed to "easily" change version by company policies, so may you ensure that it is solved in any newer version?
Many thanks for your help and patience
theabdabs said:but the error is raising in UltraExcelExporter.
The bug I am referring to was a bug in the UltraExplorerBar, but it was essentially a bug in the way the ExplorerBar was doing some caching which is shared by all of the Infragistics WinForms components. So the fact that the exception occurred in the UltraGridExcelExporter doesn't necessarily rule out the ExplorerBar issue as the cause.
The easiest way to tell is to find all of the UltraExplorerBar controls in your solution and set AnimationsEnabled on each one to False.
If that does not help, then the issue you are experiencing must be something new. In which case, we would need to be able to duplicate it in order to assist you. Can you post a small sample project demonstrating the exception?
That seems like plenty of processing power and memory to me - unless you are trying to export a huge number of rows.
How long does it take to raise the exception? Does this happen immediately as soon as you begin the export, or does it take a while?
If you can post a small sample project (or even a large one as long as we can run it) demonstrating the error, we could take a look at it.
Hi Mike, thanks again for your help.
We have a total of 3 UltraExplorerBar, and we have set animation to false in all of them.
About the computer, it is a Core2Duo at 2.26Ghz, 2Gb RAM running WinXP. I know it is low, but should run the application fluently.
theabdabs said:Unfortunately that didn't solve the error.
Are you saying that you have UltraExplorerBar controls in your application and you turned off the animation on all of them and you are still having a problem?
Or are you saying you simply aren't using UltraExplorerBar, so my suggestion does not help?
theabdabs said:The problem is only happening in a low resource computer, just as if it helps.
How low are the resources? It's certainly possible that this exception can occur if the machine simply doesn't have enough memory to create a Graphics object.
Unfortunately that didn't solve the error. I think we'll have to play with UltraGridExcelExporter options.
The problem is only happening in a low resource computer, just as if it helps.
Thanks