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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 06.10.2012, 20:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
sumitsaxfactor: Reports and Data Methods
Источник: http://sumitsaxfactor.wordpress.com/...-data-methods/
==============

In this post, I will explain how to use data methods in Reports. We will use the same Report model and report that we created in Building a Simple Report–Precision Design.

In AX 2009, AX SSRS had good use of these data methods. But with much better integration, and Reporting framework in AX improving, Data Methods in AX SSRS are reduced to minimal use.

Also the reason is that MS is soon going to do away with .Net Business Connector from next version hence the usage of data methods for many things will be redundant. What I have also noticed is the data methods have return type only as System.String and you will not be able to change this return type. This means, data methods can only return strings.

What I will try and demonstrate here is how to add links in AX reports (to open the corresponding forms).

To achieve this first we will add the reference to SRSDrillThroughCommon project. Do the following:
  • Open the SKL_SampleReportProject (refer to link above)
  • In Application Explorer, right-click Visual Studio Projects > C Sharp Projects > SRSDrillThroughCommon and then click Edit. This adds the SRSDrillThroughCommon project to our current solution

  • Open the report SKL_SampleReportPrecision project
  • Right click on the Data Methods node and create a new DataMethod. Name it CustDrillDown
  • You will also notice that a Business Logic Project is automatically added

  • In Solution Explorer, right-click the business logic project and then click Add Reference

  • Go to “Projects” tab and select “SRSDrillThroughCommon” and click Ok

  • Double click the data method this opens the Code editor
  • Add this line of code the declaration
using Microsoft.Dynamics.AX.Application.Reports;


  • Your code editor should be like this
using System;

using System.Collections.Generic;

using System.Security.Permissions;

using System.Data;

using Microsoft.Dynamics.Framework.Reports;

using Microsoft.Dynamics.AX.Application.Reports;



publicpartialclassSKL_SampleReportPrecision

{

[DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")]

publicstaticstring CustDrillDown(string reportContext, string custAccount)

{

returnDrillThroughCommonHelper.ToCustomerForm(reportContext, custAccount);

}

}








  • Right click on Precision Design and open the designer
  • Select the AccountNum text box, underline the text and set font color to Blue

  • Now right click on this text box and select “Text Box Properties…”, Switch to Tab “Action”
  • Select option “Go to URL” and click button “fx

  • Set Expression “=CustDrillDown(Parameters!AX_ReportContext.Value, Fields!AccountNum.Value)”
  • Click Ok
  • Save report, go to AX, deploy the report and run it. You should see following

  • Click on the link and the customer form opens up





Источник: http://sumitsaxfactor.wordpress.com/...-data-methods/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: Walkthrough: Creating a Report Bound to a Report Data Provider Class (X++ Business Logic) [AX 2012] Blog bot DAX Blogs 0 20.09.2012 11:11
Microsoft Dynamics CRM Team Blog: Create Sample Data for your Solution Blog bot Dynamics CRM: Blogs 0 01.12.2011 05:14
Microsoft Dynamics CRM Team Blog: Creating Custom Sample Data for Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 0 07.01.2011 03:15
kamalblogs: Data methods in Ax Reports and SSRS Reports Blog bot DAX Blogs 0 22.12.2010 12:11
Microsoft Dynamics CRM Team Blog: Data Migration Manager Tips and Tricks Blog bot Dynamics CRM: Blogs 0 02.09.2008 22:05

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:36.