Hello.
I'd like to draw grid borders in advanced_excel.
In the old version(2.4.8) of advanced_excel, I used CellFormat_ApplyToRange to draw borders on the outer frame of a column range,
and then on the outer frame of a horizontal range, thereby achieving grid borders.
However, when I perform the same process in the latest version(3.4.3) of advanced_excel, the borders drawn on the column range disappear,
and the process is completed with only the borders drawn on the outer frame of the horizontal range.
Is there a way to draw grid borders in the latest version of advanced_excel?
Regards
Atsushi
Hi Atsushi,
Yes, there seems change in CellFormat_ApplyToRange behavior with version 3.4.3,
I suggest a more durable approach and one of the main reasons for the Advanced Excel component is to rely on a marked-up spreadsheet. With your grid borders, branding and formatting directly in an Excel base file you can guarantee the layout will remain consistent without needing them to be drawn via code.
Hi Sanket.
Thanks for your reply.
The latest version of advanced_excel (2.2.19) has a ServerAction called Cell_FormatRange(),
which I discovered allows me to create grid-like borders all at once. For now, this seems to be sufficient.
However, since all formatting other than borders is ultimately overwritten, it feels like the functionality is reduced compared to the previous version (2.1.23).
Is creating Excel files using template files essentially an outdated system?
Hello @Atsushi Mizutani,
You can draw grid borders in the latest version, and there are two things worth separating here.
What changed (the disappearing borders)
Your original technique drew the outer frame of each column range and then the outer frame of each row range, letting the overlapping frames form the grid. That relies on the second frame merging with the borders the first one already set on the shared cells. In that old version, merge isn't happening on the overlapping cells, so applying the horizontal frames wipes the vertical ones — exactly what you're seeing.
I reproduced your scenario against the current codebase and the overlapping-frame approach now preserves both sets of borders (I verified an interior cell keeps its left/right from the column frame and gains top/bottom from the row frame, both in memory and after the file is saved and reopened). Upgrading to the most recent version on the Forge should restore your old behavior.
The more robust way (recommended)
Instead of building the grid from overlapping outer frames, set the four individual borders — Border Top, Border Bottom, Border Left, Border Right — on the entire table range in a single CellFormat_ApplyToRange call. When you set a side on a multi-cell range, it's applied to every cell in that range, so all four sides together give every cell a full box — i.e. a complete grid — in one step. There's no overlap and nothing to wipe, so it works regardless of order.
Hope this helps.
P.S.: I made a mistake with the version number.
Old advanced_excel: Version 2.1.23
New advanced_excel: Version 2.2.19