static void ExportCurrencyExchangeRates(Args _args){
dteExchRates ldteExchRates;
SysExcelApplication excelApplication;
SysExcelWorkbooks excelWorkBooks;
SysExcelWorkbook excelWorkBook;
SysExcelWorksheets excelWorkSheets;
SysExcelWorksheet excelWorkSheet;
SysExcelRange range;
SysExcelCell SysExcelCell;
SysExcelCells SysExcelCells;
int lineNum=1; // int DataRowNum=1;
Amount exchRate;
Array arr;
Date EDate;
;
excelApplication = SysExcelApplication::construct();
excelWorkBooks = excelApplication.workBooks();
excelWorkBook = excelWorkBooks.add();
excelWorkSheets = excelWorkBook.worksheets();
excelWorkSheet = excelWorkSheets.add();
//excelApplication.visible(TRUE);
EDate = str2date('2050-01-01',321);
while select ldteExchRates where ldteExchRates.ToDate == EDate
{
lineNum++;
arr = new Array(Types::String);
range = excelWorkSheet.Range(strfmt("A%1:F%1", lineNum));
//arr.value( 1, num2str(ldteExchRates.ExchRate,18,2,0,0));
//if(LineNum==1)
// { SysExcelCell = ExcelWorksheet.cells().item(1,1);
SysExcelCell.value( "CurrencyCode");
SysExcelCell = ExcelWorksheet.cells().item(1,2);
SysExcelCell.value( "ExchRate");
SysExcelCell = ExcelWorksheet.cells().item(1,3);
SysExcelCell.value("FromDate");
SysExcelCell = ExcelWorksheet.cells().item(1,4);
SysExcelCell.value("ToDate");
// }
// else
//{
SysExcelCell = ExcelWorksheet.cells().item(lineNum,1);
SysExcelCell.value(ldteExchRates.CurrencyCode);
SysExcelCell = ExcelWorksheet.cells().item(lineNum,2);
exchRate = ldteExchRates.ExchRate/100;
SysExcelCell.value(num2str(exchRate,18,8,0,0));
SysExcelCell = ExcelWorksheet.cells().item(lineNum,3);
SysExcelCell.value( date2str(ldteExchRates.FromDate,321,2,-1,2,-1,4));
SysExcelCell = ExcelWorksheet.cells().item(lineNum,4);
SysExcelCell.value( date2str(ldteExchRates.ToDate,321,2,-1,2,-1,4));
// }
}
excelApplication.visible(TRUE);
}
Thanks
Mallik Gudidevuni
This Blog contains information regarding Dynamics AX 365 Finance and Operations AX (Axapta) Development and code that is frequently used. You can post any type of Queries related X++,EP, SSRS and AIF.
Subscribe to:
Post Comments (Atom)
Update NuGet package to new MS D365FO version
1. Import the NuGet package files from LCS for that particular version please take the PU version files only. a. Goto LCS-->Asset Libra...
-
In the below example we will see how we can get the default financial dimension values from Purch line table. Here we are using AxdDimensi...
-
Here we are going to see how we can filter / override the lookup on the form control. Scenario, we need to override the TemplateID lookup...
-
It is very common to use Like Operator in SQL SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern ; N...
No comments:
Post a Comment