Seal Report Forum
»
Report Edition
»
Reports
»
SINGLE COLUMN SUB TOTALS OUTPUT
Rank: Newbie
Groups: Registered
Joined: 8/12/2019(UTC) Posts: 6 Location: Hyderabad Thanks: 2 times
|
Hi All,
I am unable to get subtotals on TOP in single row, can anyone suggest me on this.
RAW DATA:
ID|| MASTER GROUP NAME || GROUP NAME || LINE || BALANCE|| --------------------------------------------------------------------------------------------------------------------|| 1 ||TOTAL LOANS and ADVANCES (sum 2-4)||1 TOTAL LOANS and ADVANCES (sum 2-2.5) || || 15 || 2 ||SHORT TERM (sum 2.1-2.13) || ||2.1 Int trade || 1 || 2 ||SHORT TERM (sum 2.1-2.13) ||2.4 International trade (sum 2.4.1-2.4.2) ||2.2 Export || 2 || 2 ||SHORT TERM (sum 2.1-2.13) ||2.4 International trade (sum 2.4.1-2.4.2) ||2.3 Import || 3 || 2 ||SHORT TERM (sum 2.1-2.13) ||2.5 Building and construction (sum 2.4.1-2.4.4)||2.4 TRADE || 4 || 2 ||SHORT TERM (sum 2.1-2.13) ||2.5 Building and construction (sum 2.5.1-2.5.4)||2.5 Commercial || 5 ||
EXPECTED OUTPUT:
ID|| MASTER GROUP NAME || BALANCE ||
1 ||TOTAL LOANS and ADVANCES (sum 2-4)|| 15 || 2 ||SHORT TERM (sum 2.1-2.5 ) || 1 || 3 ||2.1 Agriculture || 2 || 4 ||2.2 Manufacturing || 3 || 5 ||2.3 Domestic trade || 4 || 6 ||2.4 Int trade (sum 2.4.1-2.4.2)|| 5 || 7 ||2.4.1 Export || || 8 ||2.4.2 Import || || 9 ||2.5 Hotel & tourism || ||
As this is the requirement from client, expecting a quick reply.
Thanks & Regards, Sujeet
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Hi, your sample is not very clear, can you do it with Northwind ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/12/2019(UTC) Posts: 6 Location: Hyderabad Thanks: 2 times
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/12/2019(UTC) Posts: 6 Location: Hyderabad Thanks: 2 times
|
Hi Epf,
I am waiting for your response, Kindly suggest the solution asap.
Thanks
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
Yes, here is a solution to have the Subtotal on top: Select your model and modify the 'Final Script' property to reorder the ResultTable Lines (Rows). The script will look like: Code:@using Seal.Model
@using System.Data
@{
ReportModel model = Model;
ReportExecutionLog log = model.Report;
//Final script executed to modify the model result tables after their generations
//Note that other assemblies can be used by saving the .dll in the Repository 'Assemblies' sub-folder...
log.LogMessage("Modifying result values with the 'Final Script'...");
ResultTable summaryTable = model.SummaryTable;
foreach (ResultPage page in model.Pages)
{
ResultTable table = page.DataTable;
var newLines = new List<ResultCell[]>();
for (int row = 0; row < table.BodyStartRow; row++)
{
newLines.Add(table.Lines[row]);
}
int firstRow = table.BodyStartRow;
for (int row = table.BodyStartRow; row < table.BodyEndRow; row++)
{
if (table.IsSubTotalRow(row)) {
newLines.Add(table.Lines[row]);
for (int row2 = firstRow; row2 < row; row2++) {
newLines.Add(table.Lines[row2]);
}
firstRow = row+1;
}
}
for (int row = table.BodyEndRow; row < table.RowCount; row++)
{
newLines.Add(table.Lines[row]);
}
table.Lines = newLines;
}
}
In attachment is the sample report to do this. Subtotal on top.srex (13kb) downloaded 2 time(s).
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
SINGLE COLUMN SUB TOTALS OUTPUT
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.