Parameter is not valid

I have been getting this here and there lately, first with a dashboard, then in BAQ designer.

Anyone else?


(I failed to grab the details before I closed it.)

Ah, it was when trying to “Copy to Excel.”

Error details

Application Error

Exception caught in: System.Drawing

Error Detail

Message: Parameter is not valid.
Program: System.Drawing.dll
Method: GetHdc

Client Stack Trace

at System.Drawing.Graphics.GetHdc()
at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter…ctor()
at Ice.Lib.Framework.EpiUltraGridExcelExporter.ExportToExcel(EpiUltraGrid grid)
at Ice.Lib.Framework.EpiContextToolsManager.handleToolClick(ContextToolClickedEventArgs e)
at Ice.Lib.Framework.EpiContextToolsManager.OnToolClick(Object sender, ContextToolClickedEventArgs e)
at Ice.Lib.Framework.PopupMenuBuilderBase.ToolbarManager_ToolClick(Object sender, ToolClickEventArgs e)
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.ToolMenuItem.OnClick()
at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.DoClickProcessing(MouseEventArgs e)
at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.OnMouseUp(MouseEventArgs e)
at Infragistics.Win.TextUIElementBase.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.UltraWinToolbars.PopupControlBase.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)

Seems the issue might be related to Infragistics UltraGrid when trying to launch and render an instance of Excel. Memory is not enough.


Interesting. I’ll look for that next time. Thank you.

Hi Jason,

Is this error still occurring for you? Did you ever get a grasp on why it was happening? I don’t have many windows open nor am I returning many rows on this dashboard assembly, I cannot understand why I would be having a memory issue when I try to right click / copy to Excel.



In short, no.

There was a behemoth dashboard I created that was, as far as I remember, the only thing that would generate that error.

Actually, now that I think about it, I think what would happen is that maybe that dashboard itself might let you escape without the error, but if you went on to use some other dashboard or BAQ in the same session, you would often get that error.

Basically, we all got used to the idea that if you were going to use that dashboard, you get the information you needed out of it, then just go ahead and close and reopen Epicor immediately after.

I very rarely use the dashboard myself. Some others still do, but the person that I created it for no longer works for the company, and he was never shy about complaining about an error message. And for better or worse, most other users never tell me about errors like that.

One thing to remember is that Excel 32 bits (which is the vast majority of installs out there), supports a maximum of 1,048,576 rows (in recent versions; before it was 65535). If you had more rows than that in your dashboard, I would expect this error.

Oh Irony! :face_vomiting:

My dataset goes to 666 rows, far from behomoth. It’s pulling only open orders. I got out of Epicor and came back in, and now the error is gone. This damn dashboard is acting so buggy, even though I completely rebuilt it. I have no idea why. No filters work on it 100% either. I really wish Epicor worked the way it is supposed to.

Thanks for your feedback Jason and Hugo. I do relate to not hearing from your users much on this sort of thing… but then again, if I did I’d have to tell them IDK why it does that. Exit Epicor and come back in (yep, I get support person of the year on that one!).



We get the same thing (although I think I’d add a blank row to get to 667 :smile:)

It seems to randomly happen, so we get out and back in again and the problem goes away. (IT Clichés do work)

1 Like

Probably unrelated, but the Copy To Excel seems to include the styling and formatting of the source grid. So there could be a lot more info than just the values of the cells being moved around. If you were to select all Rows and then use “Copy All Include Labels”, you could paste that into a blank Excel file.

Some of my SSR reports that are rendered to an Excel file, give me an error like:

Selecting OK allows the file to load, and I find a cell like:


That row is normally highlighted yellow, because the QOH is zero. It’s the fact that the cell shows up
as the string: 0.000000000000000000.

If whatever is generating the excel file when “Copy To Excel” is used, works similar to the SSRS rendering for Excel, it could be choking on some data. Especially formatting/styling, as the errror is in the “Drawing.dll” program.


Hi Calvin,

Hmm, I wonder if it’s due to format issue/choking with dates. I do have some with just date and others with long datetime in same column. I’m not certain how that’s happening but suspect stamp of today vs now. Maybe I’ll mess with that.
Now however, I’m not getting the error, since I got out and came back in :frowning: Nothing like the sickening feeling of deploying with occasional known error.

Thank you!

“Errors that go away by themselves, return by themselves.”


I just had this today for the first time, got out and back in…

I feel like @Jonathan 's linked article might hold some clues.

I never did mark this as solved after I had figured it out, so I did that now.

In short, it happened with a dashboard that had a lot of publish/subscribe BAQs and tons of data in each. I rebuilt it to not pull so much at once - but honestly I never use it anyway, so it may still happen and I just don’t even know about it.

Also important is this :point_down:

This is what I call a red herring. The error appears to come from a very innocuous dashboard, but that’s not the cause at all – the cause was the huge dashboard you opened 10 minutes ago and closed already. It haunts the system.

1 Like

Thanks for adding this Jason, I figured if it was a memory error like Jonathan pointed out, then Epicor must have something allocated in memory or maybe even the computer itself was low on memory.

The user stated that they just opened Epicor and the only thing they had open was customer tracker - which would have many rows of data depending on which tab she was on…

I’ll have to try and apply your case when and if this happens again to us to see if it may be some previous screen.

Well, if that’s the case, then this is quite the mystery. But in two years I haven’t had an issue outside of one or two dashboards. And it has been many months since I’ve seen that at all; maybe they fixed it in 700?