Adding a datasource through business logic
This recipe will show how a simple datasource can be created and used as a source of data through the business logic option in reports.
Getting ready
This recipe requires that you have access to Visual Studio with the Dynamics AX reporting extension.
How to do it...
- Create a new reporting project called PktExchRateReports in Visual Studio.
- Add a report and name it PKTExchRateDataTable.
- Right-click on the Data Method node and create a new method as shown in the following screenshot:
- Double click the TestMethod node. This adds a new C# project to the solution and a C# class with the same name as the report.
- Replace the empty data method with the business logic shown here:
[DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")] Public static DataTable ExchangeRateDataset(string _stest) { DataTable dt; // Adding rows and columns in DataTable dt = new DataTable(); dt.Columns.Add("Category", typeof(string)); dt.Columns...