In hierarchical grid where we have (number of columns in parent) < (number of columns in child), for the difference in column number we get Column1, Column2 in the header (See B1,C1,D1,E1,F1 cells in the snapshot).
I have attached the snapshot below.
Hello Tapas,
Thank you for posting in our community.
Usually this happens when the header text of the column is omitted in the columns array.
If this is not your case, then please provide more information about the behavior leading to your issue. A working sample will be much appreciated.
Kind regards,Martin
In my code,I have hierarchical grid which is having only 1 column (Name) in main or parent grid which is "Bonet Robert" and under that grid,I do have one more grid with only one column(status) which is "A" and under "A" , I have one more grid which is having all other columns like "Address,Billing name,region" etc.
Now when I export this to excel ,I get column 1 ,column 2 and so on for the main grid which is having only 1 column "Name" .
you can match these values with the excel.
var northwind = {
"results": [
{
"Name": "Bonet Robert",
ProjectStatus: [
"ProjectStatus": "A",
Orders: [
"CSA": "18ps3021-19", "CustomerBillingName": "Ernsh", "ServiceAddress": "RW Electric",
"Region": "DPSO", "ProjName": "ALLCONNECT",
"ProjectTotal": "1000"
}
]
} ] }]}
I am glad to know that I was able to help you achieve the functionality you were looking for.
Thank you for using Infragistics components.
Thanks Martin, Its working perfectly now .
I have sent you only a demonstration of how to use our Excel Library. The implementation was hardcoded. However I have modified the sample and now it should handle any number of columns.
Regarding your second question, about the cell formatting, please keep in mind that according to our support policy we handle single support forum thread per query. This helps us ensure that all your issues are addressed correctly. Please create a new forum post about the issue you are experiencing so the other users in our forum will benefit in case that they are experiencing the same issues.
2110.Sample.zip
Your sample is working only for 2 columns . Its not working for more than 2 columns .If I am adding one more column in the child grid and adding a row args.worksheet.rows().item(0).setCellValue(3, " "); in exportEnding event ,its giving extra column header as "2" .
Thanks for your help Martin, Its working .
I have one more issue in the same excel .I have a column (Project Total) which has datatype as "Number" and format as "Currency" .When I am exporting it to excel, cell format is getting change from number to text . I want the cell format as it is which is "Number" .