Code to show Dynamic Reports in MSD axapta

Code to show Dynamic Reports


Write following code on init method of report in axapta

 ReportSection reportSection;  
 DictTable dictTable;  
 DictField dictField;  
 Counter fieldCounter;  
 super();  
 reportSection = element.design().autoDesignSpecs().addSection(ReportBlockType::Body);  
 reportSection.table(tableNum(custTable));  
 dictTable = new DictTable(tableNum(custTable));  
 while (fieldCounter < 10)  
 {  
 fieldCounter++;  
 dictField = new DictField(dictTable.id(), dictTable.fieldCnt2Id(fieldCounter));  
 reportSection.addControl(dictTable.id(), dictTable.fieldCnt2Id(fieldCounter));  
 }