SSRS RDLC character appears partially hidden in report - reporting-services

I'm new to SSRS reports, and I didn't write this report, I'm just trying to fix it; and I've had no luck searching for anyone else suffering from this (too many false-positive matches).
Part of the data for a field is being rendered in a way that leaves half of the first character invisible. Perhaps the best thing to do is to show a screenshot of the problem (see the data in the final column):
StackOverflow says I don't have enough reputation to embed the image; but it's here:
http://i.stack.imgur.com/1YtcB.png
The "8" character is being chopped in half. I don't understand why the data isn't forced inside the 2pt padding, or why it doesn't split the date value between the date and time.
By the way, I suspect there is little value asking why the penultimate column looks OK: the columns are different widths, and the penultimate column is an expression returning a DateTime whereas the final column has to handle the possibility of the DateTime being null.
The RDLC file is here (requires you to download the file; suggestions of a better alternative are welcome): http://www.filedropper.com/markerprogresssummarybycomponent

It looks like it's attempting to fit as much of the date/time on the same line without wrapping as possible, which doesn't necessarily fit in that cell.
2 Suggestions:
Increase the width/padding of the cells that are cutting off text so the
entire date/time fits
If it's not a problem to have the time shown on the next line, you could force it to wrap at the time part, thus eliminating the issue:
=Replace("8/6/2015 12:35:02 PM", " ", chr(10), 1, 1)

Related

SSRS: Need the group footers to be at the bottom of the page

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.
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.
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)
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!

ssrs keep certain "chunks" of text "atomic" within a report header

I have some text I want to keep "atomic" within a report header. The text in question is the "Period Ending Date: 1/15/1998". It is OK if that block of text wraps down below, but I would like to keep the whole block of text together on one line. This has to be dynamic however, as the text will grow and shrink dynamically--sometimes the server and database and company name will be short and everything fits on one row, sometimes long even the database name will need to wrap.
And this is how I have it defined in the expression
Is keeping it "atomic" possible?
As the comments say you basically have two options, either make the text box wide enough to fit any possible combination of company, server, database and end date that could occur - you can use max(len([your fields])) in SQL to determine the maximum possible characters and then figure out the width from your font information - or you can put the separate chunks of information into separate text boxes and arrange them however is most aesthetically pleasing to you. Personally I'd have a company name box on one line, the Server and database beneath it and the end date beneath that. Up to your preference though obviously.
#Jeff.Clark, I guess you need to rethink the design. I agree with #Viking's comment. As far as i know, what you are trying to achieve is not possible in SSRS (keeping the Can Grow = False) and want to wrap it on the field level not the word level. I tried using it in the placeholder but it is splitting the field.
However, if your requirements are very critical and no matter what you have to do it in this way then i think you can achieve it by determining maximum characters the cell can accommodate in one line and then subtracting the SUM of LENGTH of the the fields+ the text(ex: "Totals per payroll period") and find out a position in your string to insert VBCRLF so the rest of the data will go to next line. Without the original expression i will not be able to provide the accurate updated expression but it will be nested IIFs to get the position of VBCRLF. I personally do not prefer this method because it will take lot of processing on the report design level and can affect the overall performance of the report as well as not very pretty when it comes to the maintenance of the report.

TextAlign and Vertical Align won't work for one cell in table in SSRS 2008

I want to apply Center & Middle for all cells in this table, no condition need, just all cells in table.
This is what I do for each column:
And this is how preview comes out:
First I thought maybe it's because the data type for DetailSheetNo is CHAR, so its length is fixed, so I cast it to VARCHAR:
CAST(CastPieces.DetailSheetNo AS VARCHAR(50)) AS DetailSheetNo
But it's still not solved the problem.
I wonder what would be the reason.
To sum up the comments:
The problem might appear because the word rendered in the cell has to many char and therefor cannot fit in the cell properly.
Make sure the word doesn't countain a lot of white space at the end. If so, right click on the cell, then "Expression" then write something similar to this:
=RTRIM(Fields!MYFIELD.Value)

Dealing with very tall textboxes and pagination in SSRS 2005

I have a report in SQL Server Reporting Services 2005. It makes use of a page header and footer and has no subreports. The body portion contains a few smaller elements and then a simple single column table. The table has a single header row and a single detail row. The header is just a label, basically. The detail row is a single textbox with a simple Fields!FieldName.Value as its output.
The problem is that FieldName, in this case, is a highly variable length string. It can be a sentence up to 8000 characters (usually no more than 2 pages worth). The text can contain line/paragraph breaks (returns) but no other special formatting. Everything is fine so long as the content fits on one page. Once the text exceeds a single page (8.5x11), the text is very nastily cut off abruptly. Since this is a pagination problem, it is only visible when exporting to PDF or when viewing the report in Print Layout.
It seems as though there is a maximum size the row can grow to on the first page and then it chops it off and starts it up on the second. But this cutoff is not carefully managed in relation to the text. It can occur right in the middle of a line, causing it to show the top halves of the letters on the first page and the bottom halves at the top of the second page.
Obviously, this is unacceptable, as it looks very unprofessional and can impair the readability of the line that was so messily split. I also can never be sure it'll split badly, as sometimes it more or less ends the page evenly, though usually I can still see the hanging tails of certain letters on the next page (g and p for instance).
The secondary problem is that I'd really like the table row header to repeat on each page. Setting the obvious property, "RepeatOnNewPage" has no effect. I suspect this is because it's still trying to show the single really vertically tall row. It seems like it's okay repeating headers and splitting pages nicely between detail rows. But because this is basically just a big block of text, and thus just one really tall row, it doesn't split it nicely.
What can I do or use to solve this problem? I can live without the repeating header so long as it just doesn't cut off text in the middle of a line.
Unfortunately, page break fine tuning is one of the biggest weak points of SSRS.
I can only suggest that you break up the long text into multiple rows before SSRS ever gets it. You'd want to parse the text to look for word breaks. The result will be odd looking breaks in the output since you won't know where the break will come on a line in the printed report. However, it'd be much more readable than cutting text in half.
If the text is comprised of reasonably sized paragraphs, you could parse it out that way instead.
You might even go so far as to measure the text using SQLCLR and the System.Drawing.Graphics.MeasureString method to fine tune the output but I wouldn't recommend that route for the feint of heart.
In SSRS 2008 R2 and Visual Studio 2008:
Click (not-right click) a textbox and go to the properties window (lower right side of VS) -> KeepTogether = false.
The text will cleanly cut between a line and continue on the next page.
Just thought to add here as searching for this doesn't return many results.
I have done what JC has suggested in the past where I've broken down the text into paragraphs and each paragraph would in effect be its own row. Works pretty well given the limitations of SSRS.
One thing to be careful about is that you would need to make sure that your paragraphs sort properly. In most cases it would display them in the correct order, but adding in a column with sortID to give some sorting hints to the table would probably be a good idea.
In the end, the cut-off-text problem was due to non-standard padding on the textbox in question.
For whatever reason, having padding any greater than the defaults (2pt all around) seemed to cause its pagination to go sour. I imagine it is due to the algorithm not taking padding into consideration when deciding where to break the paragraph. With default padding, the line always ends cleanly and nicely on each page.
As a workaround (since I liked the extra white space the padding gave to the layout), I used a rectangle to achieve the border and made the textbox inside it smaller than the rectangle by about an eighth of an inch. This gave the box some inner padding while still apparently allowing the pagination to correctly determine when to break up lines.
Still, a lot of unnecessary headache.

SSRS - rsMultiReportItemsInPageSectionExpression Error

The Particulars:
I have a report that displays information about invoices. There is a page break between multiple invoices (each invoice gets its own page). What I want in the report header is the result of this expression (ex. "June, 2009"):
=MonthName(Month(ReportItems!textbox1.Value)) & ", " & cstr(Year(ReportItems!textbox1.Value))
But I get this exception (textbox2 is in the header):
Error 1 [rsMultiReportItemsInPageSectionExpression]
The Value expression for the textbox
‘textbox2’ refers to more than one
report item. An expression in a page
header or footer can refer to only one
report item.
First of all... Why would that even matter?! Second of all... How can I work around this strange restriction?
The Big Picture:
The reason I'm grabbing the text from another textbox is to work around the restriction that you can't use data fields in a header or footer. So there's a hidden column that shows the invoice date next to every transaction. Then the table header has the expression:
=First(Fields!InvoiceDate.Value, "table1_Group1")
This seems ridiculous and I hope I'm just doing something wrong. Yes I realize I could simply have a "month" and "year" text box in the header but that pushes the complexity way too high for the simple requirement of showing an invoice date in the header of a report.
One wild guess would be that textbox1 exists for every page of your report. So if you have two invoices, you'll have two pages and thus 2 x textbox1, so SSRS does not know which one to refer to.
You might try to play with report parameters as described here. If nothing else helps, I guess you'll have to put the invoice ID into the report body.
I came back to this issue and found a way around the buggy behavior in SSRS.
All formatting can be done inside the column header instead of up in the page header. The text box in the page header simply grabs the already formatted (and complete) text from the column header all at once. No more multiple references.
This is a hackish workaround for a strange limitation which is the result of a hackish workaround for another strange limitation. But it works.