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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.02.2007, 09:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
casperkamal: HTML based Report in Dynamics Ax
Источник: http://casperkamal.spaces.live.com/B...CD63!227.entry
==============


          Though Ax reports offer lot of inbuilt functionality, it happens so that we need some features like tables with different alignment styles. Dynamics Ax has the solution for cases of that kind  too...
 
The solutions is very simple and easier, it is using HTML pages for reporting.
 
check out the step by step methods to create a HTML based report.
1. Decide the type of report you want, now try to simulate the report layout using some HTML editor
   or using someonline editors too.
   I used an online editor from w3schools(Check out here
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_span)
   Just let the layout be as it is, now let us turn our attention to Ax and later use the HTML code generated for the layout.
 
2. Create a query in the AOT if you want to use it in your report
 
3. Create a simple class that extends runbase and add all necessary runbase methods
 
4. Add any dialog fields which you require for your report
 
5. Now add a method called GenerateHTML to your runbase class, you can refer to the following class for example   
    Classes ->HRMSkillGapEmployeeHTMLGenerate
   with a signature of this sort

   CCHTMLString generateHTML()
   {
   }

6. Inside this method use the queryrun class to fetch the records in loop

 7. Now move the HTML code that was generated earlier to this method and convert all static content to dynamic(i.e)by
    placing the value fetched through the query  
    eg: generated code :
                                        CustomerName' 
                                 The Light Company 
                                 

          Dynamic code  :                                   CustomerName' 
                                 CustTable.Name 
                                 

 

8. Now create a method with anyname that you want say runreport(), Place the follwoing code
    in to it.

 
    Args    args;
    Object  object;
    FormRun formRun;
    ;

    args = new Args();
    args.name(formstr(CCHTMLPrintPreview));
    args.caller(this);
    args.record();

    formRun = classfactory.formRunClass(args);
    object = formRun;
    object.parmObject(this);
    object.parmHTMLObject(this);

    object.init();
    object.run();
    object.wait();

 
  The form CCHTMLPrintPreview is responsible for displaying your HTMLcode in the form of Axreport. We invoke this form   through the following code.This form uses GenerateHTML method that we created earlier to get the data to be displayed
 
9. Create a run method and call the above created method(runreport()) to activate the form
 
10.Create a main method for it, calling the prompt and run method of our class.
 
11.Drag the class to Output MenuItem and Place the menuItem in to any module that you want, execute it to see the 
    report.
 
   You can also further refer to the follwoing report for further information and other ways of fetching and feeding data for report rendering.
 
I have created a simple class that will help you in understanding this, download and check out.
 
http://www.axaptapedia.com/Image:Class_CustomerDetailHTMLReport.xpo
 
Snap Shot of my output
 
      
 

....................The "WoW" effect
 



Источник: http://casperkamal.spaces.live.com/B...CD63!227.entry
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Сергей Герасимов: Что нового в Microsoft Dynamics AX 4.0 Blog bot DAX Blogs 0 16.01.2007 11:00
Dynamics AX: Why Dynamics AX beats SAP Blog bot DAX Blogs 0 10.01.2007 23:15

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

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

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