Error in excel report


I am developing a reprot in Excel

While displayin the item no eg:- 095epgo1405LTR its coming fine in excel report but when item no starting with:-01624458779 in report its not taking first zero it is coming as:-1624458779 report in excel

im using class in AX9.0 through which iam displaying this reportin Excel

How to display the item no which is having only number values. as eg:-01624458779

Please help me out ASAP

Hi Syed,

In the excel for the itemid column,go to format cells there it is by default to 'General’ it should be ‘Special’ then you can get the zero also in item number.

Naresh Kolli

Hi Naresh

thanks for ur rply.

have tried that still it is not coming and more over here user wont change that cell into format from general to special…is there any other way we make change in our class from where we are making excel report

Hi Syed,

try this it may help you

static void Excel(Args _args)
CustTable custTable;
COM excelApplication;
COM excelWorkBooks;
COM excelWorkBook;
COM excelWorkSheets;
COM excelWorkSheet;
COM range;
int lineNum;
Array arr;

custTable.AccountNum = ‘00000001’;
custTable.Name = ‘ABC’;
custTable.CustGroup = ‘10’;

excelApplication = new COM(“excel.application”);
excelWorkBooks = excelApplication.workBooks();
excelWorkBook = excelWorkBooks.add();
excelWorkSheets = excelWorkBook.worksheets();
excelWorkSheet = excelWorkSheets.add();

select custTable
where custTable.AccountNum == ‘00000001’;
arr = new Array(Types::String);
arr.value( 1, custTable.AccountNum);
arr.value( 2, custTable.Name);

range = excelWorkSheet.Range(strfmt(“A%1:D%1”, lineNum));

Naresh Kolli

ok i will try this method thanks for ur quick rply

Dear Naresh

How do i merge 2 cells. I tried but it gives error.

Give me a sample plz.