Free Support Forum - aspose.com

Problem with group:merge smart marker - Aspose. Invalid end row index exception

Hi!

There is a problem with using “group:merge” smart marker ( Aspose.Cell 4.8.0) if dataset has only 1 row:

Code:<o:p></o:p>

DataTable dt = new DataTable("Rows");

dt.Columns.Add(new DataColumn("field1", typeof(string)));

DataRow dr = dt.NewRow();

dr["field1"] = "test";

dt.Rows.Add(dr);

WorkbookDesigner designer = new WorkbookDesigner();

//Non merged - OK

designer.Workbook.Open(@"..\..\NonMerge.xls");

designer.SetDataSource(dt);

designer.Process(true);

designer.Save(@"..\..\NonMergeOut.xls", FileFormatType.Default);

//Group merging - ERROR !!! Aspose. Invalid end row index exception

designer.Workbook.Open(@"..\..\Merge.xls");

designer.SetDataSource(dt);

designer.Process(true);//Generate exception

<span style=“font-size: 10pt; font-family: “Courier New”;” lang=“EN-US”>
designer.Save(@"…\MergeOut.xls",
FileFormatType.Default);


Templates in attachment


<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Обычная таблица"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;}

<![endif]–>

Thanks, Evgeny

Hi,

Please try the attached version as I have tested using your template file and code with it, it works fine.

Thank you.

Hi!


Thanks, it worked



Regards, Evgeny