Thursday, March 22, 2012

Calculated field in Footer...running total

Hello,

How do I add unique values on the report? For example say I have this in my report:

Customer: Food Purchased: Amount:

Judy Cat Food $12

Sarah Dog Food $13.50

Diane Rabbit Food $17

Jason Dog Food $16

Tammy Dog Food $15

In the footer of the report I want to print a summary box that looks like this:

Product: Number Purchased: Total:

Cat Food 1 $12

Dog Food 3 $44.50

Rabbit Food 1 $17

How do I do this?

Thanks!

group on the food purchased fields and do a count on the group.|||

I'm not an expert at this. It is easy to say what do to. Can you tell me how to do it?

|||

Hello,

I don't think there is a way to have a summary like that in the footer of your report. But this will add your group totals, then you can just hide the details if you need.

Right click on the row handle for your detail row and select 'Insert Group'. In the box that pops up, give the group a name (or leave the default), select the Food Purchased field as your expression and select the box for 'Include group footer'. This will create two new rows in your table, a header and footer. In one of your footers textbox's, enter this to get the count of the group:

=CountRows()

If you don't want to see the details and just want the summary, click the row handle and change the Visibility -> Hidden propery to True. This will hid your details and only show the group footers.

Hope this helps.

Jarret

|||I have one question if the data of your main report is not fit in one page then the footer will repeat on next page. Does it ok with your requirement ?|||

I am converting this report from a crystal report. So yea, in the report now it is in a Report Footer and it only appears on the last page. This is how I need it because I was told to make the SQL Report look exactly like the CR. Unfortunately it seems like SRS doesn't give you a really nice option of doing Running Total fields like in Crystal. In Crystal they created a running total field and said "count all that are Dog Food" and then another running total that said "Count all that are Cat Food." I am not sure if putting it on the group footer will work because I need the report to display as it is. And to just say =CountRows() seems like it will count all rows and return 5. But I haven't tried it.

I created another report and put all the footer stuff in a table footer. And the table footer only appeared on the last page. I would like to put all this information in the table footer not the report footer. Sorry if I didn't explain that too well.

I am very surprised that SRS doesn't have an easy way to do this.

|||

Hello,

Using =CountRows() will give you the number of rows in that scope, so if you put this in your group header/footer, it will show the number of rows in that group. If you place it in the table header/footer, you will get the total number of rows in the table.

Jarret

|||

How do I put the conditional on? Currently it is counting all rows in the database for each type of food. What if I want to say "only count the rows that are on the report" (or only records that happened in the past week)?

|||

This worked in the table footer!

=Count(iif(Trim(Fields!FoodPurch.Value)="Dog Food",Fields!FoodPurch.Value, Nothing))

No comments:

Post a Comment