ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-05-20 09:27:26

brian.shankland
Member
Registered: 2016-05-11
Posts: 15

Last Row and Column borders missing

Hello, sorry but another border and excel import issue I've found, which I hope is something I'm doing wrong / misunderstanding

I have a spreadsheet with 23 columns and 62 rows [A1:W26]. This has a border around this outer range.

When I load it into ReoGrid I do a scan to find the last column / row that has either content or a border setting.
This is correctly identifying a MaxColumn Index of 22 (0..22) and a max row index of 61 (0..61)

I then set the limits for the RodGrid rows and columns as follows:

            CurrentSheet.Rows = maxRowIndex + 1;
            CurrentSheet.Columns = maxColumnIndex + 1;


But with this the right border of the final column and the bottom border of the final row are not displayed. If I add an extra row and column they are.

I can work around this by just adding in an extra row and column but wanted to raise it in case it was something that needed a look at.

Code for the Limit detection:

            int maxRowIndex = 0;
            int maxColumnIndex = 0;

            for (int rowIndex = 0; rowIndex < CurrentSheet.Rows; rowIndex++)
            {
                for (int columnIndex = maxColumnIndex; columnIndex < CurrentSheet.Columns; columnIndex++)
                {
                    if (CurrentSheet.Cells[rowIndex, columnIndex].Data != null)
                    {
                        maxRowIndex = Math.Max(maxRowIndex, rowIndex);
                        maxColumnIndex = Math.Max(maxColumnIndex, columnIndex);
                    }

                    if (CurrentSheet.Cells[rowIndex, columnIndex].Border.Left.Style != BorderLineStyle.None)
                    {
                        maxRowIndex = Math.Max(maxRowIndex, rowIndex);
                    }

                    if (CurrentSheet.Cells[rowIndex, columnIndex].Border.Right.Style != BorderLineStyle.None)
                    {
                        maxRowIndex = Math.Max(maxRowIndex, rowIndex);
                    }

                    if (CurrentSheet.Cells[rowIndex, columnIndex].Border.Top.Style != BorderLineStyle.None)
                    {
                        maxColumnIndex = Math.Max(maxColumnIndex, columnIndex);
                    }

                    if (CurrentSheet.Cells[rowIndex, columnIndex].Border.Bottom.Style != BorderLineStyle.None)
                    {
                        maxColumnIndex = Math.Max(maxColumnIndex, columnIndex);
                    }

                }
            }

Offline

#2 2016-05-23 12:02:20

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Last Row and Column borders missing

Thanks for report. It looks like a bug during save worksheet, it will be fixed in next release.

Offline

#3 2016-05-23 15:35:50

brian.shankland
Member
Registered: 2016-05-11
Posts: 15

Re: Last Row and Column borders missing

Thanks, my workaround of adding addition row and column will do for now.

Offline

#4 2016-05-27 15:09:33

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Last Row and Column borders missing

The latest version 1.3.0 fixed some bugs about border exported to Excel. Can you please use the latest version to see whether this problem still exists?

Offline

Board footer

Powered by FluxBB