HI
I want to get the subtotal based on two columns & after each subtotal want to add a blank row. To achieve this i use (group:repeat,skip:1) for two column but then it won’t shows the grand total row.
I am using Aspose.cells for .net 17,2,0,0 (able to replicate on latest version),
Replication Steps:
-
Use the Northwind.mdb Microsoft Access database and extract data from the table named “Order Details”.
-
Place the following smart markers:
&=[Order Details].Order ID(group:repeat,skip:1),
&=[Order Details].Product Name,
&=[Order Details].Quantity,
&=[Order Details].Unit Price,
&=&=C{r}*D{r}
&=[Order Details].Order ID,
&=[Order Details].[Product Name]
&=&=IF(A{-1}="",“Total For “&G{-3},””),
&=&=IF(H{-1}<>"",“Total For “&H{-1},””),
&=subtotal9:Order Details.Order ID&[Order Details].[Product Name] into D6 & D6
“Grand Total”,
and =SUBTOTAL(9,E5:E5)
into A5, B5, C5, D5, E5, G5, H5, A6, B6, (D6 & E6), A7 and E7 respectively.
worksheet of the SmartMarker_Designer.xls file (13.9 KB) -
Use the code as per aspose document of “subtotalN” topic (
https://docs.aspose.com/pages/viewpage.action?pageId=5018144
)
and command as
Dim cmd As OleDbCommand = New OleDbCommand(“Select [Order Details].[Order ID], Products.[Product Name], [Order Details].Quantity, [Order Details].[Unit Price] from [Order Details] inner join Products on Products.ID = [Order Details].[Product ID]”, con)
The grand total line position was wrong and overlap by total line. (Check the text ‘GT’ in column ‘G’)
Output (15.7 KB)
Any Idea?