Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am developing a excel report in ax 2012. I have a temp table and a DP class which inserts the data into the temptable.

I need to write a method which is in the following format:

public void ExportToExcel( TableId tblid, str FilePath)
{
.
.
}

I need to pass the temptable id to the export method and generate the excel report.
I am able to get the table field names in the excel using dicttable.

C#
dict = new DictTable(tblId);    

    for (i = 1; i<=dict.fieldCnt(); i++)
    {
        fieldId = dict.fieldCnt2Id(i);
        dictField = new DictField(tblid, fieldId);
        if(!dictField.isSystem())
        {
            fieldnames[i-1] = dictField.name();
            xlsWorkSheet.cells().item(row,i).value(dictField.label());
        }
    }


But I am not getting a way to get the table values.

The DictTable also gives the table properties only, but no clue on the table records.

Kindly help me getting the table data in the excel.

Thanks in advance,
Sruthi R
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900