In Speadsheet, cells are not exporting to excel with border

2 Answers 63 Views
Spreadsheet
Josh
Top achievements
Rank 1
Josh asked on 22 Aug 2024, 04:51 PM
When creating cells they are created roughly as follows 
{
value: String(result[0][i]["date_description"]),
 ...CONFIG_LEFT,
borderTop: { color: "#000000", style: "solid", width: 1 },
borderBottom: { color: "#000000", style: "solid", width: 1 },
borderLeft: { color: "#000000", style: "solid", width: 1 },
borderRight: { color: "#000000", style: "solid", width: 1 },
},
 This displays correctly on the browser view but when I go to export it and then open it in excel only the bottom border shows up
Josh
Top achievements
Rank 1
commented on 22 Aug 2024, 06:20 PM

When I do something like the following it will both display correctly in the browser except a few random cells will have their left or right border missing AND when I export it to excel the entire right border on the right most cells is missing


                       const alphabet = "ABCDEFGHIJKLMNOP".split("")
                       for(let i = 0; i < 13; i++) {
                            for(let j = 0; j < r + 2; j++) {
                                let r = sheet.range(`${alphabet[i]}${j}`)
                                r.borderRight({size: 1, color: "black"})
                                r.borderTop({size: 1, color: "black"})
                                r.borderBottom({size: 1, color: "black"})
                                r.borderLeft({size: 1, color: "black"})
                            }
                        }
Very weird and makes no sense

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 27 Aug 2024, 07:33 AM

Hello Josh,

I tested the behavior by adding a border as demonstrated in your first email. The borders appear in the exported Excel file as expected. The only scenario where the left and right borders are not visible is when the text in the cell is longer than the cell`s width. Here is a Dojo example where exporting the borders is demonstrated. - https://dojo.telerik.com/@NeliK/uQAbIYEW. Could you please check if this is the issue on your side as well.

Looking forward to your reply. 

Regards,
Neli
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

0
Setven
Top achievements
Rank 1
Iron
Iron
answered on 27 Aug 2024, 09:45 AM | edited on 11 Sep 2024, 09:00 AM
Hey Josh, exporting borders with Spreadsheets can be tricky. Telerik doesn't natively support it, but you could try a third-party library like 'xlsx' to define borders in the exported Excel file. Perhaps Frelan Hardware has a solution or knows of a compatible tool.
Tags
Spreadsheet
Asked by
Josh
Top achievements
Rank 1
Answers by
Neli
Telerik team
Setven
Top achievements
Rank 1
Iron
Iron
Share this question
or