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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.03.2011, 12:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,607 / 848 (80) +++++++
Регистрация: 28.10.2006
saveenr: Dynamics AX 2012: An Introduction to Report Data Providers
Источник: http://blogs.msdn.com/b/saveenr/arch...providers.aspx
==============

 

We just published a screencast that started exploring a new concept in AX 2012: the Report Programming Model and Report Data Providers.





 

In addition to the screencast I wanted to use this post to elaborate on the topic shown in the screencast.

 

BUSINESS LOGIC IN REPORTS

When I discuss "business logic" in this post, I am referring to code that is used to generate data for use in reports. In Dynamic AX 2009 there really is no great way to reuse your X++ code in an SSRS report. This is one reason I recommend that everyone stick with simple query-based reports in Dynamics AX 2009. Of course, we wanted to make this much easier in Dynamics AX 2012 and that is why we created a concept called the Report Data Provider.

 

WHAT IS A REPORT DATA PROVIDER?

It is a X++ code-based way of generating data for reports. This code can use any technique to generate data for Dynamics AX 2012 Reports. It is the correct and supported way to reuse your existing X++ code in Dynamics AX 2012 reports.

 

HOW IT WORKS

The simplest summary is that you create a table – usually a temp table. And then a class – this is known as the Report Data Provider class. When the report is run, the class populated the temp table with data. One the data completely populated it is transferred to the SSRS server.

 

CONSTRUCTING THE TEMP TABLE

First, decide what fields you need in your report. Then create a table with those fields. You MUST assign Extended Data Types to those fields. Then set the TableType property to "TempDB"

Here's a simple table with just two fields



Notice that that Extended Data Type has been set for the Name field



 

And for the ID field




And then notice that the TableType property has been set on the table to "TempDB".



CONSTRUCTING THE DATA PROVIDER CLASS

The simplest RDP class has only three components – they are shown below.



 

The classDeclaration is simple. The RDP Class MUST extend SRSReportDataProviderBase. Also it has a reference to the temp table.



 

The next method is needed for the AX 2012 reporting framework to retrieve data from the temp table. The SRSReportDataSetAttribute attribute MUST be used to identify the temp table to the framework. The specific name of this method is not important – the attribute is what counts.



 

The processReport() method MUST be implemented when a class extends SRSReportDataProviderBase. In this example, you can see that this method is a completely code-based way of generating data into the report.



 

YOU'RE FINISHED

And that's it for the basics. Now you have a datasource that can be used in an X++ Report.

 

PARTING THOUGHTS: THIS IS IMPORTANT TO LEARN

In practice, many or most of the reports you'll work with or implement will be built on Report Data Providers. Above I have provided the very simplest implementation. Master it. Once you get AX 2012 implement this over and over until you have memorized the steps because you'll be doing quite a bit of it in the future.




Источник: http://blogs.msdn.com/b/saveenr/arch...providers.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
saveenr: Dynamics AX 2012: A Preview of SSRS Report Development (Part 1) Blog bot DAX Blogs 0 06.02.2011 00: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
dynamics-ax: Modeling the world, with Microsoft Dynamics AX 2012 Blog bot DAX Blogs 0 25.01.2011 09:11
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05

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

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

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