SSRS 2008 and Dynamic Positioning of Text Boxes - reporting-services

I'm trying to produce a pay check. I will allow the user to setup the position of the items according to their check style.
From my research, it seems that the position of text boxes in SSRS is static and not dynamic. There is no "expression" option for Top/Left. I thought a way to get around this might be to make the text boxes large and overlapping and then set the padding top/left based on expressions to the positions that user has selected. However, it seems that similar to HTML, the text boxes either float around the higher level text boxes or simply drop out of view.
This would be simple if there were a way to tell SSRS not to be concerned with the order of the text boxes and simply display them overlapping, however I don't feel that there is.
Given that, what other options to I have for dynamically positioning text boxes in an SSRS 2008 report? I'm moving right along with this project but I've hit this stumbling block.

SSRS gives you a lot of options for dynamic formatting but Size and Location are fixed. You cannot change this. Overlapping of textboxes does not work in the soft-break renderers like HTML and Excel but does work in hard-break renderers like PDF or TIFF. Have you tried your padding technique and output the report as PDF?

I'm not sure what are going to do in your report, But in similar cases I usually use Space character to position a text. For instance,
IIf(Len(Fields(YourColumn.valu)) > 10, Fields(YourColumn.valu), "    ")
Note that you have to ensure it can implemented in your case or not. I'm not sure that it is helpful but as long as the location and width properties are fix this is the only option
Note 2 : I'm using Unbreakable Space character instead of simple Space so that SSRS render it without any problem

Related

Report elements on left getting pushed down when tablix on the right side expands

I have a report with a tablix on the right side and several textboxes arranged in rows and columns on the left. While previewing the report, the tablix gets expanded with the separate values in them and because of which some of the text boxes are also getting pushed down leaving blanks spaces and making the report look unformatted.
I have attached the report format. Please let me know if you have any solution to this issue.
You need to place your report items in rectangles to stop them interacting with each other. Put your items on the left all into the same one and the table on the right into it's own.
Have you tried setting the Can Grow attribute to False or did you need it to expand? If so I would actually increase your Tablix size to the max it can to not push the text boxes and then set the property to Can Grow to false.
I think I know why rectangles didn't work for you. I have a similar report I am trying to create with the same format. I had the same problem you mentioned where white space appeared above my report objects, and the objects on the left still did not appear in the correct places.
What I found was that you need to create the rectangle first and then add objects into it. It appears that the above problem occurs when you try to place a rectangle on top of your report objects.
I know this is 4 years late, but I thought this might hopefully save someone some time.
Go to Report Properties to select columns number from 1 to 2 to see information side by side instead of going to next page.
Report Properties

SSRS Report Builder Center Data Bar Data Label in Column instead of on the bar

I am creating an SSRS report in SSRS report builder 3.0. I currently have a table where the rows have a Data Bar inside of the cells. I cant figure out how to get the data label to center on the row. I tried selecting center under the Data Bar "Custom Attributes for "bar label style" and also under the Data Label under "position". Both seem to just center the label on the Data Bar itself not on the row.
I'm under the reputation limit or i would post an image of what I'm talking about.
Image link of current configuration http://imgur.com/lmvl9dI
I realise that this is an old post, but I stumbled across this forum searching for an answer to the same question. Unfortunately, I have to agree with Christopher, in that there is no way around the issue (that I know of).
However, I have used a very simple workaround that displays the data bar and values neatly, and thought it may be useful for others.
Quite simply, I have added another column to the right of the data bar, and have entered the same field. I have then removed the borders between the two textboxes, so that it displays the data bar to the left with the values aligned to the right.
While this does not provide an answer to the question as such, I hope that it may help others with the same problem in the future.
I suspect, unfortunately, that what you seek is not possible. The reason being that the label is a part of the bar. The label is defined for the entire series, and for each label, it is positioned relative to the bar itself. Relative to either the start or the end or the middle of the bar, but not relative to the chart's container.
What I imagine you wanting is to define something that is centered in the cell itself, which would have to be a direct component of the cell (e.g., placeholder, entered text). Unfortunately, when using a databar, you cannot add anything else into that cell.

Access report "Can Grow" property needs to effect neighboring controls

I have a report with a bunch of controls in the Detail section.
I am working off a word document that was given to me as a sample and I recreated it in access almost perfectly. What I need now is a way to handle overflowing the text boxes. I have "Can Grow" enabled, but here is the real issue:
I have a fake table going on. Multiple text boxes arranged in a way that just doesn't work in a subform. Certain cells have red, green or yellow backgrounds while others are just plain white. When one of the text fields overflows, and "grows", the other text boxes in the same row stay the same size as before and it looks very very odd (703 twips vs 300). I would really just love for it to work as if it were a table in word/excel and the entire row would grow at once (all =703 twips), but seeing as how it isn't literally a "row" I just want a way to associate the height of these text boxes with each other.
Is anything like this possible? If I need to clarify anything just let me know, I hope I've given ample information.
In the design view of your report select all the textbox controls in the detail section and all the labels in the page header section. Right click on one of the textbox controls and select Layout -> Tabular. The controls and labels should now align with each other.
You've not set which version of Access you're using but this works in Access 2007.
Ok here we go. So I had a fake table, I needed it to have table borders around each text box and when one text box got taller than the others in the row, the borders would look totally wrong. So, what we have to do is literally draw on the report at runtime, which can be done in any view including print preview. This code must be placed in the Print event
'step one. find out which box in the row has the greatest height value.
'You can come across this information however you want.
'It will likely depend on what data goes in the boxes.
'For the sake of the answer length we will skip that actual code
'step two. Take measurements and store them in variables.
'You will need a start point, and an end point in standard (x1,y1),(x2,y2) form.
Dim t As Integer 'top
Dim l As Integer 'left
Dim b As Integer 'bottom
'step three. Use these measurements and draw your lines.
'Try to use looping if your naming and report layout work will allow it.
Me.Line (l, t)-(l, b), RGB(0, 0, 0)
' (x1,y1)(x2,y2),pick a color
'We just drew a line straight down the length of the control
'If you plan ahead, and place a line on the report permanently on top of the first row
'and below every row, you will only need to draw vertical lines.
'The lines below each row will be pushed down by the tallest control
I hope this helps. I had no idea this stuff existed before at all. Here is the MSDN info about it: http://msdn.microsoft.com/en-us/library/aa221362%28v=office.11%29.aspx
OK...
1 - Go into Design view of your report
2 - Select ALL the textbox controls in the detail section that you want to be table like and ALL grow if any one grows.
3 - Right click on one of the selected textbox controls and select Layout -> Tabular.... but... now... after you have your textbox row controls as a tabular layout... You must do one thing more...
4 - Inside your reports FORMAT TAB properties... Set ALL PADDING properties to 0.00... 0.00 for Top Padding, 0.00 Right Padding, 0.00 Left Padding and 0.00 Bottom Padding. (default is usually around 0.0208)
5 - Please note that changing your textboxes to a Tabular Layout kinda throws your textboxes to the right (at least for me) so you may need to re-adjust them so they are aligned with your Page Header textboxes again (if you have any that you might be using to header name your table like columns).
6 - Make sure ALL SPACE is removed in the detail area by having the bottom bar (page or report footer) snugly up against the bottom of your Tabular Textbox Layout and also ditto with the upper detail bar (page or report header).
7 - Now when you look your report in print preview with max 200% or more zoom you WILL still see very very minor spaces between your cells in your layout but when you actually print they will be almost unnoticeable unless you take out a magnifying lens.
I found a solution for my situation but I would like to have a better one...
In my case, a TextBox at the left side is describing the content of 1 to 3 pictures on the right side. The TextBox, if enlarging more than the height of the first picture, would shift pictures 2 and 3 down, in spite of a properly designed Top-Attribute in the picture controls.
My solution: I put the height attribute of the text box to 15cm (e.g 2 Inch) and enable it as shrinkable.
However, strange, but this helps for positioning the Pictures at its desired Top-Locations... :-) as well as minimizing the horizontal space used.

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.

How to bottom-align string in Access report textbox?

Using Access 2003. On a subreport I have arranged a row of text boxes that will be populated with dynamic data. (These will appear as column headers on a master report.) Due to report constraints, the text boxes are tall and somewhat thin; some incoming strings will be longer than other strings; strings are expected to wrap when necessary. Presently, each of these text boxes is bottom-aligned.
What I am looking for is a way to force the text in each of these boxes to be bottom-aligned, to grow upward as it were. As we know, Excel natively allows bottom alignment in a cell; I do not see that Access offers a similar capability. Any hints? A VBA technique maybe? Thanks.
TonBill,
You can use VBA to set TopMargin property of each textbox to a certain value; TopMargin will "move" text down towards the bottom. You will have to calculate each TopMargin based on how many characters including spaces fit in one line of each textbox. Not a great solution, but may work.
I don't think there is a configuration option in Access for bottom text alignment.
See this: http://www.eggheadcafe.com/software/aspnet/35318427/how-can-i-bottom-align-te.aspx
Since its a report. Check out the CanGrow property
If you have the text bottom aligned, just set the CanGrow Property for all the textboxes, and the textbox will dynamically grow to fit the text in the report.
Here is some info on the CanGrow property:
http://msdn.microsoft.com/en-us/library/bb242179.aspx