20.02.2007, 09:40 | #1 |
Участник
|
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 |
|