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 2015-05-19 01:25:53

ehdrnsep
Member
Registered: 2015-05-19
Posts: 1

Merge exception bug

The code below version 0.8.5, the well was operating at more than 1024 columns.
However, when accessing more than 1024 columns from the 0.8.8 version, RangeIntersectionException occurs.
Turned out to be HasIntersectedMergingRange method returns true.
How to fix?

ps. Thank you for having provided very good component.

        const int rowCount = 100;
        const int wordLength = 8;
        const int colCount = 1024 * wordLength;

        public Form1()
        {
            InitializeComponent();
            this.Load += Form1_Load;
        }

        void Form1_Load(object sender, EventArgs e)
        {
            Init();
        }

        private void Init()
        {
            Stopwatch sw = Stopwatch.StartNew();

            var sheet = this.grid.CurrentWorksheet;
            sheet.Reset(rowCount, colCount);

            ReoGridControlStyle rgcs = ReoGridControlStyle.DefaultControlStyle;
            rgcs.SetColor(ReoGridControlColors.GridLine, Color.Black);
            grid.ControlStyle = rgcs;

            sheet.SetColumnsWidth(0, colCount, 8);
            sheet.SetSettings(WorksheetSettings.View_ShowColumnHeader, false);
            sheet.SetSettings(WorksheetSettings.Edit_Readonly, true);
            sheet.SetSettings(WorksheetSettings.Edit_AutoAdjustRowHeight, false);
            sheet.SetSettings(WorksheetSettings.Edit_AllowAdjustColumnWidth, false);


            ReoGridStyleObject defaultColumnHeaderStyle = new unvell.ReoGrid.ReoGridStyleObject()
            {
                Flag = PlainStyleFlag.LineAll | PlainStyleFlag.HorizontalAlign,
                BackColor = Color.FromArgb(240,248,255),                     
                HAlign = ReoGridHorAlign.Center,
            };

            int headerText = 0;
            for (int i = 0; i < colCount; i += wordLength)
            {
                var range = new ReoGridRange(0, i, 1, wordLength);

                try
                {
                    sheet.MergeRange(range);
                }
                catch (RangeIntersectionException ex)
                {
                    //1024 over column RangeIntersectionException.....
                    Console.WriteLine(ex.Message);
                }
                sheet.SetCellData(0, i, (headerText++).ToString());
                ////style
                //sheet.SetRangeStyle(range, defaultColumnHeaderStyle);
                ////border
                //sheet.SetRangeBorders(range, BorderPositions.All, new unvell.ReoGrid.BorderStyle(Color.Black, BorderLineStyle.Solid));
            }
            sheet.FreezeToCell(1, 0);

            sw.Stop();
            Console.WriteLine(sw.Elapsed.ToString());
        }

Offline

#2 2015-05-19 13:49:33

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

Re: Merge exception bug

OK, let me check this problem!

Offline

#3 2015-05-24 00:50:54

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

Re: Merge exception bug

This was a bug from 0.8.7. We have fixed this in current development version and tested it with your code, the result is:
s03.png

We will make the next version available as soon as possible.

Offline

#4 2015-07-13 14:23:01

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

Re: Merge exception bug

This problem has been fixed in 0.8.9.x versions. Please download it from:

http://reogrid.net/download

Offline

Board footer

Powered by FluxBB