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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.09.2014, 14:15   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
goshoom: Printing dynamic parameters (AX 2012 / SSRS)
Источник: http://dev.goshoom.net/en/2014/09/sh...ic-parameters/
==============

In addition to parameters specified in data contracts, reports can also use queries. It’s very handy, because users can specify filters and sorting in exactly the same way as they’re used to from other places in Dynamics AX, they can use query expressions and so on.




A relative common request is printing parameter values on the report itself. It’s easy with parameters defined in data contracts – an expression like =Parameters!UsersToInclude.Value will do the job. But the same approach doesn’t work with dynamic parameters (that’s how query parameters get represented in SSRS).

I recommend the following approach. Use a report data provider class – very often, it’s already in place. Add a new data table to hold information about query ranges and expose it to the report. I’m using an existing table, TmpSysQuery, so we don’t have to discuss the design of the table. In processReport(), we extract ranges from the current query and save them to our temporary table.

class LedgerJournalPostControlDP extends SRSReportDataProviderBase{ … TmpSysQuery tmpSysQuery;} [SRSReportDataSetAttribute(tablestr(TmpSysQuery))]public TmpSysQuery getTmpSysQuery(){ select tmpSysQuery; return tmpSysQuery;} public void processReport(){ … tmpSysQuery = MyQueryUtils::rangesToTable(this.query());}






Because the logic for extracting ranges from a Query object may be needed from other places as well, I’ve put it into a separate class. This is the content of the method:

<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="xpp">public static TmpSysQuery rangesToTable(Query _query){ QueryBuildDataSource qbds; QueryBuildRange queryBuildRange; TmpSysQuery tmpSysQuery; LabelType tableLabel; int occurrence; int dataSourceNo; int i; if (!_query) { return tmpSysQuery; } for (dataSourceNo = 1; dataSourceNo <span class="sy0">
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
DAX: Microsoft Dynamics AX 2012 R3 is now available! Blog bot DAX Blogs 1 02.05.2014 23:00
kamalblogs: Error: SSRS/EP error when the return type in display method is incorrect – Dynamics AX 2012 Blog bot DAX Blogs 0 11.10.2013 12: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: Speed up RDP based SSRS reports testing in Dynamics Ax 2012 Blog bot DAX Blogs 0 11.09.2013 17:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

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

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

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