Page 1 of 2

Crosstab Summary that is a % of Total

Posted: Thu Jun 19, 2014 8:00 pm
by srichardson
I have a crosstab with the following info
Row: State
Column: Month
Summary: Units
Amount
% Total

I have everything working except the % Total summary. I need to be able to show the following where the % Total is equal to the Amount for the State divided by the Total Amount for all states. How do I accomplish this? I tried using this expression:
{Details.LoanAmount / (double)Totals.Sum(Data, Details.LoanAmount)} but it's not coming out as expected.

Thanks!

Re: Crosstab Summary that is a % of Total

Posted: Fri Jun 20, 2014 1:55 pm
by HighAley
Hello.

Please, read the Calculating percents in columns of cross-tab article on our Knowledge Base.

Thank you.

Re: Crosstab Summary that is a % of Total

Posted: Fri Jun 20, 2014 4:01 pm
by srichardson
Do you happen to have a sample report with this functionality that I can review, I'm unsure how it all fits together.
Thanks

Re: Crosstab Summary that is a % of Total

Posted: Mon Jun 23, 2014 9:56 am
by HighAley
Hello.

Here is a sample report.
StandardCrossTabPercentByColumn.mrt
(29.93 KiB) Downloaded 536 times
Thank you.

Re: Crosstab Summary that is a % of Total

Posted: Wed Jul 30, 2014 7:53 pm
by srichardson
When I copy the code entered in the ProcessCell from your sample report, I receive an error "The name'ht' does not exist in the current context". Playing with the code, I can get the % to come up using the row total...but I cannot get the denominator to use the column total for my field.

Re: Crosstab Summary that is a % of Total

Posted: Thu Jul 31, 2014 8:23 am
by Alex K.
Hello,

Please check that you copy additional code from Code tab:

private System.Collections.Hashtable ht = new System.Collections.Hashtable();

Thank you.

Re: Crosstab Summary that is a % of Total

Posted: Fri Aug 01, 2014 5:42 pm
by srichardson
I'm having trouble locating the Code Tab. Would it be possible to show me how to access using your demo site http://web.stimulsoft.com/Design/Reports/LargeCrossTab ?
Thanks!

Re: Crosstab Summary that is a % of Total

Posted: Mon Aug 04, 2014 8:10 am
by Alex K.
Hello,

Please clarify which version do you use. In the WebDesigner is not available the Code Tab.

Thank you.

Re: Crosstab Summary that is a % of Total

Posted: Tue Aug 05, 2014 3:50 pm
by srichardson
I use Reports.Web version 2013.1.1600

I tried adding System.Collections.Hashtable ht = new System.Collections.Hashtable() to some of the Print/Render Events in order to get it added to the code, but it is still coming back stating "The name 'ht' does not exist in the current context"

Re: Crosstab Summary that is a % of Total

Posted: Wed Aug 06, 2014 8:25 am
by HighAley
Hello.

Please, use next option to enable Code tab in the Web Designer.

Code: Select all

StiWebDesignerOptions.CodeTabVisible = true;
Thank you.