AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.12.2013, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,538 / 848 (80) +++++++
Регистрация: 28.10.2006
kamalblogs: SSRS Tip: Take care to clear the temp table record in RDP reports
Источник: http://dynamicsaxlounge.com/2013/12/...d-rdp-reports/
==============

All RDP reports adopt the approach of filling in all the required data into a temp table. In this article let us how a simple “clear” statement could be helpful as well as give way to a hidden problem in disguise.

Consciously make use of “table.clear()”
Let us look at the example here where the method highlighted here “insertCustListTmp” is called in a loop from the procesreport method.The method “isReversed” whose implementation is not shown here finds if there is reverse happened for the trans and also returns the reverse journal id. (Don’t funtionally interpret the implementation)

private void insertCustTransListTmp(ExchAdjustment _exchangeAdjustmentType, CustTransListTmp _custTransListTmp, RecordInsertList _tmpTableRecordList, TransactionReversalTrans _transactionReversalTransLocal) { //_custTransListTmp.clear(); this.initBalance(_exchangeAdjustmentType, _custTransListTmp); _custTransListTmp.TraceNum = _transactionReversalTransLocal.TraceNum; if (this.isReversed()) { _custTransListTmp.Reversed = true; _custTransListTmp.ReverseVoucher = this.getReversedVoucer(); } _custTransListTmp.Reversed = this.reversed(_transactionReversalTransLocal); _custTransListTmp.AccountNum = custTable.AccountNum; _custTransListTmp.Name = custTable.name(); _custTransListTmp.Voucher = custTrans.Voucher; _custTransListTmp.insert(); } Following is the data present at the table level.









So when the clear is commented the data filled in the temptable would look like this









When the clear is applied the temptable would reflect the reality











when you run your report it could appear that something is going terribly wrong in your logic but it could be the simple clear statement missing at the back.

Practically though the common problem area could be in reports this can happen anywhere both in temp and regular tables. However you can also use this to your advantage when say every field is initialized unlike the conditional flows specified here. So you can have the methods like “initFromCustTable” called only once and doesn’t required to be call again since the clear is not invoked. Whatever is the case make sure the decision is taken consciously.

Optionally run this code to quickly understand what is discussed here…

static void JobTestClear(Args _args) { CustTransListTmp transTmp; CustTable custTable; boolean insert; select * from custTable; while (custTable) { if (insert) { transTmp.AccountNum = custTable.AccountNum; } transTmp.insert(); insert = !insert; print transTmp.AccountNum; pause; next custTable; } }

Info: Thank to Pradeep Itnal who reminded me of this problem and to make a note here. 



Sharpen your SSRS skills. Buy the Dynamics AX reporting cookbook





Keep yourself updated with Dynamics Ax – Check the weekly Must read section here






The post SSRS Tip: Take care to clear the temp table record in RDP reports appeared first on Dynamics Ax Lounge.



Источник: http://dynamicsaxlounge.com/2013/12/...d-rdp-reports/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
kamalblogs: SSRS Tip: Prevent report execution through controller – Dynamics Ax 2012 Blog bot DAX Blogs 0 25.09.2013 14:11
kamalblogs: SSRS Tip: Printing Row headers in every page – Dynamics Ax 2012 Blog bot DAX Blogs 0 23.09.2013 16:12
kamalblogs: SSRS Tip: Using labels for dynamic texts in SSRS reports – Dynamics Ax 2012 Blog bot DAX Blogs 0 16.09.2013 12:11
kamalblogs: SSRS Tip: Speed up RDP based SSRS reports testing in Dynamics Ax 2012 Blog bot DAX Blogs 0 11.09.2013 17:11
kamalblogs: SSRS tip: Take care that VS and AX client are in the same layer for SSRS – Dynamics AX 2012 Blog bot DAX Blogs 0 09.09.2013 16:11

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 03:10.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.