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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.07.2009, 15:07   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Debugging Microsoft Dynamics AX 2009 SSRS reports with Microsoft Visual Studio 2008
Источник: http://blogs.msdn.com/emeadaxsupport...udio-2008.aspx
==============

While Microsoft SQL Server Reporting Services (SSRS) reports allowed in in Dynamics AX 4.0 a user to create Ad'hoc reports that were only based on the data stored in the Dynamics AX database, in Dynamics AX 2009 Production reports allow also the execution of Business Logic. The Business Logic can either be X++ code in the AOT or C# code directly in the SSRS report.

This also brings up the question how the C# code could be debugged when necessary. You can use the Visual Studio 2008 integrated debugger however you need to follow certain steps otherwise your breakpoints will not be hit.

You need a PC where the following components are installed:
  • Microsoft Dynamics AX 2009 Client,
  • Microsoft Dynamics AX 2009 Reporting Tools,
  • Microsoft SQL Server 2005 or 2008 Reporting Services,
  • Microsoft Dynamics AX 2009 Reporting Extensions, and
  • Microsoft Visual Studio 2008
Note:
In the following example we use a report that is based on Microsoft SQL Server Analysis Services (SSAS) data. Therefore the Dynamics AX default cubes need to exist, however SSAS does not necessarily need to be locally installed.


In the following steps I will explain how you can debug the standard SSRS / SSAS report Cust.CashInflowvsCashOutflow for example:
  1. Start the Dynamics AX Client, open the AOT window and go to AOT\Report Libraries
  2. Click with the right Mouse button at the Cust report library and select Edit in Visual Studio from the context menu
  3. Wait until the Visual Studio IDE has launched completely
  4. Make sure the active configuration of the Solution is set to Debug (to check the Active configuration go to Build - Configuration Manager...)
  5. Rebuild the whole Solution by selecting Build - Build Solution
  6. Deploy the Solution to your Microsoft SQL Server Reporting Services by selecting Build - Deploy Solution
    (Note: It is important to deploy the Solution from within Visual Studio even if the SSRS reports were already deployed and did not change since then!)
  7. Open the report CashInflowvsCashOutflow from the Visual Studio Solution Explorer window
  8. In the Report Explorer window expand the node Data Methods and double click at GetDefaultCompany
  9. Place a breakpoint (e. g. by pressing the [F9] key) at any line of code
  10. Start the Internet Explorer and navigate to your Microsoft SQL Server Reporting Services Report Manager page (e. g. http://localhost/reports)
  11. Click at the Dynamics folder in the Report Manager page
  12. Go back to Visual Studio and select Tools - Attach to Process from the menu
  13. Make sure the options Show processes from all users and Show processes in all sessions are enabled (checked)
  14. The next step is different based on the version of Microsoft SQL Server Reporting Services:
    1. If you are using Microsoft SQL Server 2008 Reporting Services:
      In the list of processes located the process ReportingServicesService.exe and attach to this process
    2. If you are using Microsoft SQL Server 2005 Reporting Services:
      In the list of processes located the process w3wp.exe and attach to this process (If you have more than one w3wp.exe process listed, see the appendix at the end how to determine the correct process)
  15. Go back to the Report Manager page in Internet Explorer and execute the report Cust.CashInflowvsCashOutflow.FullPage
  16. The breakpoint will be hit by the Visual Studio integrated debugger
Some more hints:
  • On Windows Vista and Windows Server 2008 make sure you run Visual Studio with elevated privileges (Run as Administrator)
  • Once the debugger is attached you can check what modules are loaded in the Visual Studio integrated debugger by selecting Debug - Windows - Modules from the menu (The Assembly the C# code is compiled to is Cust.BusinessLogic.DLL)
How can I determine the correct w3wp.exe process to attach to?

The Microsoft SQL Server Reporting Services 2005 are hosted in the Microsoft Windows Server Internet Information Services (IIS). Therefore the process to attach to for debugging is the IIS Worker Process (w3wp.exe). As IIS is starting at least one Worker Process per Application Pool, more than one w3wp.exe processes are usually running on a Windows Server.

In order to see what Worker Process is serving what IIS Application Pool tools exists:
  • On Windows Server 2003 (IIS 6.0) run: iisapp.vbs
  • On Windows Server 2008 (IIS 7.0) run: appcmd.exe list wp
The output of the tools looks as follows:

C:\Windows\system32>iisapp.vbs
W3WP.exe PID: 2056 AppPoolId: AxReportServer
W3WP.exe PID: 5092 AppPoolId: EP - 39014

C:\Windows\system32\inetsrv>appcmd.exe list wp
WP "6916" (applicationPool: SharePoint Central Administration v3)
WP "1356" (applicationPool: AxReportServer)

Once identified the correct w3wp.exe process (based on the Application Pool) use the PID (Process ID) to attach to the correct w3wp.exe process.



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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
gatesasbait: Dynamics AX 2009 SSRS and SSAS Integration Tips Blog bot DAX Blogs 3 09.07.2009 13:07
axStart: Visual studio web development for Dynamics AX 2009 training Blog bot DAX Blogs 0 04.05.2009 14:05
axStart: Visual studio web development for Dynamics AX 2009 training Blog bot DAX Blogs 0 14.04.2009 21:05
Vincent: Debugging business logic in AX 2009 SSRS reports Blog bot DAX Blogs 0 29.11.2008 09:05
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, время: 22:27.