Create variable and use variable

Stimulsoft Reports.Silverlight discussion
Locked
Designer
Posts: 6
Joined: Mon Feb 15, 2016 1:05 am

Create variable and use variable

Post by Designer »

Hi

I want to calculate a value and store in a variable and re-use the variable for further calculations in my report page. I am not sure exactly how would I do that so if you know different methods please advise.

I want to create a new variable which is a % increase/decrease of last 2 years and based on this number I want to calculate rest of numbers.

For example:

~Revenue year 1 = 1200
~Revenue year 2= 1320

~ProjRev (Variable)= (Revenue year 2- Revenue year 1)/ Revenue year 1

Using variable within different objects - Textbox, Charts

~Income Taxes * ProjRev
~Interest * ProjRev

please advise, how to create a variable and use/re-use this variable in calculation in same report.

please reply at earliest convenience.

Thanks

Pat
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Create variable and use variable

Post by HighAley »

Hello, Pat.

To answer your question we need to know what type of Silverlight project you have.
Do you use Native (pure) Silverlight or Client/Server?

Thank you.
Designer
Posts: 6
Joined: Mon Feb 15, 2016 1:05 am

Re: Create variable and use variable

Post by Designer »

Hi,
We use Client/Server application.

I also have another question,
I wan to use following formula in one of my text box to display CAGR value (Compound Annual Growth Rate) which is calculated as

{(Optimist.Legal_Entity.Model.Historical_Current_Yr.Net_Revenue___Value/Optimist.Legal_Entity.Model.Historical_Prior_Prior_Yr.Net_Revenue___Value)^(1/3)-1}

getting error "Text60: Operator '^' cannot be applied to operands of type 'double' and 'int'. please provide right direction of this to solve the issue.


If you can please respond to my query as soon as possible that will be much appreciated.
Thanks
Pat
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Create variable and use variable

Post by HighAley »

Hello, Pat.

Sorry, but we need to see a sample report to give you more detailed answer.
Please, try to add a variable to the report and use Before Print event of the Band.
Then you could use this variable. If you have any problem with it, please, send us a sample report template with data.

As about ^ operator, please, try to use Math.Pow() method.

Thank you.
Designer
Posts: 6
Joined: Mon Feb 15, 2016 1:05 am

Re: Create variable and use variable

Post by Designer »

Thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Create variable and use variable

Post by Alex K. »

Hello,

Let us know if you need any additional help.

Thank you.
Locked