Tampilkan postingan dengan label Report Writer. Tampilkan semua postingan
Tampilkan postingan dengan label Report Writer. Tampilkan semua postingan

Rabu, 11 Maret 2015

Silverlight "ArgumentException: An item with the same key has already been added" when attempting to print a report

Silverlight "ArgumentException: An item with the same key has already been added" when attempting to print a report

It's been about 3 months now since working with Microsoft Dynamics GP 2015 in our production environment. To recap, at Intelligent Partnerships we run all our information technology infrastructure on Microsoft Azure. A big reason for this, of course, is the high degree of mobility required by our consulting staff and the ability to access demo environments and be able to enter timesheets and expenses from anywhere in the world they happen to be. In addition, we need to be able to run our business and access our financials and analytics without being constrained to a particular geographical location. As such we rely heavily on Dynamics GP's Web Client and Business Analyzer to achieve these goals.

One of the issues we started noticing with Web Client recently is, when you attempt to print a report - Standard or Template - but cancel out the printing on the Report Destination window, then attempt to print the report once more, we would receive the following Silverlight error message:

Severity: Critical Summary: A server side exception of type "ArgumentException" has occurred. Details: ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.Hierarchy`1.Add(T ancestor, T item) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.Implementation.WCDexRuntimeStateResourceManager.Register(DexUri parentId, IWCDexWindow window) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.Implementation.Adapters.WCDexFormOpenStateChangedNotificationAdapter.Notifications_FormOpenStateChanged(Object sender, DexUriEventArgs`1 e) at System.EventHandler`1.Invoke(Object sender, TEventArgs e) at Microsoft.Dexterity.Runtime.Interop.DexNotification.OnFormOpenStateChanged(DexUri uri, DexFormOpenState value) at Microsoft.Dexterity.Runtime.Interop.Win32.NativeMethods.MsaCommandExec(Int16 tag) at Microsoft.Dexterity.Runtime.Interop.Win32.NativeMethods.<>c__DisplayClass26.b__25() at Microsoft.Dexterity.Runtime.Interop.Win32.NativeMethods.ExecuteMsaAction(Func`1 interopAction, String entryPoint) at Microsoft.Dexterity.Runtime.Interop.Win32.NativeMethods.MacroSystemCommandExecute(Int16 tag) at Microsoft.Dexterity.Runtime.Interop.DexMacroSystem.CommandExecute(Int16 tag) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.Implementation.WCDexMessageProcessor.ProcessCommandExecuteInstanceResourceMessage(IWCDexMessage msg) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.Implementation.WCDexMessageProcessor.Process(IWCDexMessage message) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.DexRuntimeStateManager.SendMessage(IWCDexMessage message) at Microsoft.Dynamics.GP.Web.Services.Runtime.Dexterity.DexRuntimeStateManager.MainEventLoop()

This particular error was received attempting to print a sales order processing quote, but we have been able to reproduce from other windows. While I don't claim to understand all these exceptions, this particular one seems to refer to an issue caused by a "key" being added twice to the same "Generic.Dictionary" collection. Since the action causing the error seems to be a second attempt at printing a report - the same report it seems - somewhere along the lines it would appear that some value isn't being cleared out from the collection of reports being printed which would cause a duplicate key. Again, pure speculation.

Nonetheless, in speaking to the Dynamics GP development team, it seems to be this issue has been written up and may be solved in the upcoming hotfix release. This issue can be reproduced in Microsoft Dynamics GP 2015 build 14.00.0619 (January Hotfix).

Until next post!

MG.-
Mariano Gomez, MVP
Intelligent Partnerships, LLC
http://www.intelligentpartnerships.com/

Kamis, 08 Mei 2014

Visualizing Long Calculated Expressions in Report Writer

Granted, MVP Mark Polino hates Report Writer (RW), but even he will admit he loves a good RW nugget when he sees one.

Several times I've been asked "how do I visualize long Report Writer calculated field expressions?". At simple glance, it would seem that the horizontal list box control is all we have to visualize the expression, which could be far too complicated to deal with when working with large computations or even when invoking Report Writer functions.

RW horizontal list box expression field

As it turns out, there's a little known feature in this window that allows you to visualize long expressions. If you click on the "Calculated:" or "Conditional:" prompt - depending on the expression type - next to the horizontal list box, it will display the full calculated or conditional expression in the Calculated Expression window.

Calculated Expression window
It would be nice if we can get the zoom property for the prompt field and the zoom button set to true. This would display the classic blue hyperlink as it is now customary on Microsoft Dynamics GP windows where zoom buttons are prevalent.

Until next post!

MG.-
Mariano Gomez, MVP
Intelligent Partnerships, LLC
http://www.IntelligentPartnerships.com