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)
Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++
Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...
-
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...
-
It is very common to use Like Operator in SQL SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern ; N...
-
Get temp data from class to form Data source AX 2012 + X++ In the below example we will see how we can use the temporary table as form da...
No comments:
Post a Comment