1
votes

I recently converted an old Crystal report into SSRS. I'm almost done but have one remaining problem. In Crystal the group footers all seem to be anchoring at the bottom of the page while in SSRS they are directly below the detail leaving a bunch of white space below the group footers.

I've Googled this so many times and find very few articles that deal with the group footer, it's always page or report footer. What I'd like is the detail section to consume all remaining space. I've tried making it bigger but when I have multiple lines in the detail it has a bunch of white space after it. I tried increasing the height of various group footers (I have 3 groups in this report) but it seems to shrink down to content. I've checked the group properties, report properties, every property page I can find but I can't seem to find something to anchor them to the bottom. I can set the vertical align of one element to bottom but I need all 3 group footers to be at the bottom.

I've attached images of both reports, the SSRS one shows what I need anchored to the bottom while the Crystal one shows what it should look like. I feel like this should be an easy thing to do. The only solution I've seen is to put a placeholder that has the height set to a formula with like 6 values in it to try and calculate how much height it should occupy. This seems like a ridiculous solution.

I'm not sure if it matters but I'm saving these reports in the rdlc format since they are served up by an API. I edit them in rdl then copy them over and rename the extension.

SSRS Report

Original Crystal Report

I tried including the XML but it goes WAY over the character limit of a question (200k+ characters). If someone needs that I'll have to find a way to send it.

1

1 Answers

0
votes

SSRS is not good at doing this kind of spacing.

We can trick it however by the doing the following.

First.. create a subreport - let's call it

"Insert Blank Lines"

I like using stored procedures for my data sources -

So here is my code for the report:

ALTER PROCEDURE [dbo].[report_getblankrows](@N AS INT)
AS
BEGIN
      DECLARE   @Numbers TABLE
      ( 
             Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED 
      ) 

      WHILE COALESCE(SCOPE_IDENTITY(), 0) < @N 
      BEGIN 
             INSERT @Numbers DEFAULT VALUES 
      END   
      SELECT * FROM @Numbers
END

Pretty much all it does is return rows for the number that is supplied as the parameter.

Now in your insert blank line report.. use this as the data source and place the numbers field in the details row group.

The report itself need not be big.. something to fill the space in and set the font color to white so it's not visible.

Now in your main report.. lets say you have a data set called "invoice" (for all your invoice details) . you obviously have a detail line.. immediately After the detail group, and before your "Footer" summary (the bit you need pushed down); Merge all fields into a single line and then insert a subreport in that line and point it to the "Insert Blank Lines" subreport. (shown below)

Insert Blank Lines

Now go to the subreport properties -> Parameters and Add a parameter..

Name N

Value = 10 - countrows("invoice")

This is the trial and error part. The first number (10) is just a guess to start with.. run your report and see how far down the summary of the invoice is pushed down.. a bit of a trial and error will be needed to get the correct number.. Not enough blank lines, increase the first number (10)... too many, just decrease it.. to suit.

If the invoice has enough lines to fill the page.. the returned number is in the negative.. so the subreport will not populate any rows and no blank spaces will be created.

This is the best I could come up with and have used it for years. Good luck!