|
13.01.2011, 23:57 | #1 |
Microsoft Dynamics
|
Я этот прием подсмотрел в функции выгрузки данных таблицы в ексель. Немного причесал для своих целей и оформил для удобства ввиде пары макросов.
Почему не sleep? Не помню. Может, потому что sleep замораживал бы систему. А может, по какой-то другой причине. |
|
25.10.2011, 19:31 | #2 |
Участник
|
Цитата:
\Classes\SysGridExportToExcel\performPushAndFormatting X++: for (retryCount = 1; retryCount <= 3; retryCount++) { try { // Format the range... break; } catch (Exception::Error) { if (retryCount == 3) { return; } infolog.clear(0); infolog.addTimeOut(infolog, #NotifyMethod, 1000); infolog.wait(); } } X++: sysDictClass = new SysDictClass(classnum(COM)); lcidExist = sysDictClass.hasObjectMethod("lcid"); // ... if(lcidExist) { listSep = WinAPI::getLocaleInfo(#xlEnglishUSLocale, #xlLocaleListSeperator); } else { listSep = excel.international(#xlListSeperator); } // ... cell = cells.item(_numberOfRows + 2, columnToFormat); if(lcidExist) { // Set the locale used by the IDispatch->Invoke method to en-us indicating to // Excel that the formulas are in the en-us locale. Otherwise, we need to // localize to each version of Excel. sysDictClass.callObject("lcid",cell.comObject(),#xlEnglishUSLocale); } |
|
|
За это сообщение автора поблагодарили: Logger (10). |
Теги |
com-объект, excel, thread, асинхронный com, ошибка |
|
|