Control on dynamiv columns in Excell template

Hi,

We have an issue with one of our excell report . it has 2 tables in excel template.

above table has static Aspose tags and below table has dynamic tags which insert columns horizontally.

Ex: we are using columns A to F

Table 1(Above table in Excel) has static tags in A to F.

Table2(Below Table in Excel) has dynanic horizontal tag in colum A like "&=[Table2].Year(horizontal)"

suppose we have 10 years of data when we run the report second table tags insert 10 dynamic columns due to this the above static colums (From B) move towards right 10 columns imean its showing after the end of second table(dynamic columns)

Is there any way to protect the above table as it is even when second table insert columns?

Hi,

Please include “noadd” parameter to your smart marker, see the topic: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/smart-markers.html . Please change your smart marker from “&=[Table2].Year(horizontal)” to “&=[Table2].Year(horizontal,noadd)” for your requirement.

I have created an example, the input and output excel files are attached, kindly refer to it.

Sample code:

WorkbookDesigner wb = new WorkbookDesigner();
wb.Open(@“f:\test\BkControl.xls”);
DataTable dt = new DataTable(“Table2”);
dt.Columns.Add(“Year”, typeof(int));

DataRow row = dt.NewRow();
row[0] = 1;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 2;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 3;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 4;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 5;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 6;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 7;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 8;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 9;
dt.Rows.Add(row);
row = dt.NewRow();
row[0] = 10;
dt.Rows.Add(row);

wb.SetDataSource(dt);
wb.Process(false);
wb.Save(@“f:\test\outBkControl1.xls”);


Thank you.


Hi,

I have tried the tag(noadd). this is not working still its inserting columns.

Please suggest

Hi,

Well, noadd works fine for me. Please check my template(input) file where i have put a marker with noadd parameter. Also, check my sample code and output file as it works fine.

Could you try the attached latest fix that I am using if it works fine.

If you still find the issue, kindly create a sample input file, write sample code (just like I have written) and the generated file, post all these here, we will check it soon.

Thank you.

Hi,

This tag is working with old version Dll aswell. the issue is i have used tag (horizontal,noadd) in a cell and in same sheet ihave used only(horizontal) this is causing issue . if i use only (horizontal,noadd) in a sheet then this is working.

Thanks

Hi,

"the issue is i have used tag (horizontal,noadd) in a cell and in same
sheet ihave used only(horizontal) this is causing issue . if i use only
(horizontal,noadd) in a sheet then this is working."
We have checked as you described and found the the behavior as you mentioned, we will look into it soon. You issue has been registered into our issue tracking system with an issue id: CELLSNET-11649. We will investigate if this is an issue or not.

Thank you.

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. If you do not want to insert column and move the range to right, please use shift option. Such as “&=[Table2].Year(horizontal,shift)”;

Thank You & Best Regards,

The issues you have found earlier (filed as 11649) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.