Disable a specific band in the report using designer within the code and display grouped totals

Stimulsoft Reports.JS discussion
Post Reply
devanshsaini
Posts: 10
Joined: Fri Nov 02, 2018 1:34 pm

Disable a specific band in the report using designer within the code and display grouped totals

Post by devanshsaini »

Hello,

I was using Stimulsoft Reports and Stimulsoft Viewer to make a report. I was using the Designer Windows application to make an MRT file and i was binding the data to the MRT file using an object in my code. I was able to bind all the data to the report and now i wanted to add conditions to enable and disable the bands within the report by CODE and NOT in the Designer application. I wanted to enable the footer and header bands when a certain value was true. I wanted to set the Behavior's property 'Enabled' in the code when a certain value was true.

Thank You
Last edited by devanshsaini on Wed Dec 05, 2018 3:24 pm, edited 1 time in total.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Disable a specific band in the report using designer within the code

Post by Alex K. »

Hello,

You can find a sample which shows how to work with a report from code:
https://www.stimulsoft.com/en/samples/j ... -from-code

Thank you.
devanshsaini
Posts: 10
Joined: Fri Nov 02, 2018 1:34 pm

Re: Disable a specific band in the report using designer within the code

Post by devanshsaini »

Hello there,

Is it possible to calculate sum in a Stimulsoft Report for a particular group then add that sum to the sum of the next group and keep doing that till the last group. I know this is a function for SumRunning in the Stimulsoft Designer but that is not working.

I have data in the following format:

Interest
// Group 1 starts
500
600
500
400

Sum = 2000
Running Total = 2000

//Group 2 starts
100
200
300
500
200
400

Sum = 1700
Running Total = previous Running Total + sum of this group = 2000 + 1700 = 3700

I need to do it in the code. Please check the attachment.
And also can you please let me know how can i access the Sum which was calculated in the designer.

P.S.: Sum here depict the Running Totals for a group.

Thank you
Attachments
Capture.PNG
Capture.PNG (46.11 KiB) Viewed 3066 times
Lech Kulikowski
Posts: 6329
Joined: Tue Mar 20, 2018 5:34 am

Re: Disable a specific band in the report using designer within the code and display grouped totals

Post by Lech Kulikowski »

Hello,

You can use additional variables for necessary summing in the expression:
{SumVariable = SumVariable + DataSourceName.ColumnName}

Thank you.
devanshsaini
Posts: 10
Joined: Fri Nov 02, 2018 1:34 pm

Re: Disable a specific band in the report using designer within the code and display grouped totals

Post by devanshsaini »

Hello,

I tried that but it does not work because the sum is within the column. It looks like Running Sum.

Thank You
Lech Kulikowski
Posts: 6329
Joined: Tue Mar 20, 2018 5:34 am

Re: Disable a specific band in the report using designer within the code and display grouped totals

Post by Lech Kulikowski »

Hello,

Sample report in the attachment.

If you need reset sum for group, you can add text expression {SumVariable = 0}

Thank you.
Attachments
ReportSample.mrt
(653.99 KiB) Downloaded 219 times
Post Reply