Subtotal9 is not working

subtotal9 is not working when use smart maker.
In excel template I Fill
Cell A1: Quantity
Cell A2: &=Customers.Quantity
Cell A3: &=subtotal9:Customers.Quantity

The code:
string MyDir = Application.StartupPath ;
//Get the image data.
byte[] imageData = File.ReadAllBytes(Application.StartupPath + “/1.jpeg”);
//Create a datatable.
DataTable t = new DataTable(“Customers”);
DataColumn dc1 = t.Columns.Add(“Quantity”);
//Set its data type.
dc1.DataType = System.Type.GetType(“System.Int32”);

        //Add a new new record to it.
        DataRow row = t.NewRow();
        row[0] = imageData;
        row[1] = 2;
        t.Rows.Add(row);

//Add a new new record to it.
DataRow row1 = t.NewRow();
row1[0] = imageData;
row1[1] = 3;
t.Rows.Add(row1);

        //Create WorkbookDesigner object.
        WorkbookDesigner designer = new WorkbookDesigner();
        //Open the temple Excel file.
        designer.Workbook=new Workbook (MyDir + "/SmartMarkerDesigner.xls");
        //Set the datasource.
        designer.SetDataSource(t);
        //Process the markers.
        designer.Process();
        //Save the Excel file.
        designer.Workbook.Save(MyDir + "/SmartMarker.xls");

The cell: &=subtotal9:Customers.Quantity still is &=subtotal9:Customers.Quantity not working.
I also change &=subtotal9:Customers.Quantity into: =SUM(A2:A2) It also not working.

@billni
Please post your template SmartMarkerDesigner file here, we will check it ASAP.

@simon.zhao SmartMarkerDesigner.zip (6.5 KB)

@billni,
Please add correct column to the table, otherwise we could not find how many rows should be inserted.
Please try the following codes with the attached file
DataTable t = new DataTable(“Customers”);
DataColumn dc1 = t.Columns.Add(“数量”);
//Set its data type.
dc1.DataType = System.Type.GetType(“System.Int32”);

        //Add a new new record to it.
        DataRow row = t.NewRow();
        row[0] = 2;
        t.Rows.Add(row);
        //Add a new new record to it.
        DataRow row1 = t.NewRow();
        row1[0] = 3;
        t.Rows.Add(row1);

        //Create WorkbookDesigner object.
        WorkbookDesigner designer = new WorkbookDesigner();
        //Open the temple Excel file.
        designer.Workbook = new Workbook(dir + "SmartMarkerDesigner.xls");
        //Set the datasource.
        designer.SetDataSource(t);
        //Process the markers.
        designer.Process();
        //Save the Excel file.
        designer.Workbook.Save(dir + "dest.xls");

SmartMarkerDesigner.zip (7.2 KB)

I have checked your xls and code. In your xls file, you changed &=subtotal9:Customers.数量 into =SUM(D5:D5) Yes, it works. What when I use &=subtotal9:Customers.数量 why it still not work?

@billni,

You get it right now. “&=subtotal9:Customers.数量” is a smart maker which should be used in coordination with some other smart marker field to get summary value (of that other field) with respect to field “数量” in Customers table.

@billni
The smart marker “subtotal9” only works when table defination(in the Row 5) contains “group” smart marker.

I am not understand it. Could you please help to use &=subtotal9:Customers.数量 in the xls and tell me example code to understand it? thanks

@billni
1, If you want to get subototal formula, please simly set Cell “D6” as =SUBTOTAL(9,D5:D5)
2, If you want to make &=subtotal9:Customers.数量 work, table defination(in the Row 5)must contain “group” smart marker , such as &=&=Customers.序号(group:normal)

@billni,

Moreover, you may see the document examples to get better understanding.

understanding now,thanks

@billni,

You are welcome.

@billni
Please try the leat fix 21.11.4
Aspose.Cells21.11.4 For .Net2_AuthenticodeSigned.Zip (5.6 MB)
Aspose.Cells21.11.4 For .Net4.0.Zip (5.6 MB)
Aspose.Cells21.11.4 For .NetStandard20.Zip (5.6 MB)

The left of image is not correctly placed, imges’ left is on the boundary.QQ截图20211122104040.png (13.9 KB)

@billni,

Could you share your expected output in a screenshot, we will check it further.

阿里旺旺图片20211122213350.jpg (7.9 KB)
I hope it place into the cell,conected to boundary, not on left boundary.
Just like the effect top, right, bottom is what I wanted.

Image top also is on the boundary, please also help correct it. To make sure image is inside the cell, not on cell’s boundary.

@billni,

We understand your requirements. We think you need to show borders of the cells while fitting images to the cells using Smart Markers. We have logged a separate ticket with an id “CELLSNET-49898” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

@billni,

This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@billni
Please try the latest fix 21.11.5
Aspose.Cells21.11.5 For .Net2_AuthenticodeSigned.Zip (5.6 MB)
Aspose.Cells21.11.5 For .Net4.0.Zip (5.6 MB)
Aspose.Cells21.11.5 For .NetStandard20.Zip (5.6 MB)