So I'm attempting to create a report that is able to pre-fill a "government form" with Reporting Services 2008.
Now this all falls down to the 96 DPI issue everyone seems to be having.
Let's say I have a 300 DPI high res JPG file that I want to use as a background image for a report. (This jpg is actually a scan of the government form I'm trying to prefill)
When you set the Fill option of a rectangle object (or even the entire report body) - you have no option but for it to be it's original size. I cannot seem to get the image to fit proportional to the size of my rectangle.
If I add the image as a ... "image object" - I get my desired right shock horror - because I can select the sizing option "fit proportional" and then resize my "image object" as I desire.
BUT - you cannot overlay textboxes over the top of an image object. And because my image object contains fields I'm trying to prefill from a dataset - it fails.
Any ideas?
Ok so I managed to figure this out.
For those interested, read this guide and DOWNLOAD THE SAMPLE PROJECT for an example (ignore the stuff regarding showing/hiding high/low res versions - I merely used the example to see how they were able to overlay textboxes ontop of images).
http://www.infoq.com/articles/Gogolowicz-Swanson-SSRS
You need to keep an eye on an objects parent. Keep in mind these notes;
Page_1 rectangle needs to have a parent of BaseRectangle.
Page_1_Image needs to have a parent of BaseRectangle.
All page1 textboxes need to have a parent of the Page_1 rectangle etc.
It all makes sense now.
Related
I have seen some mind-binding situations with SSRS reports in my few years of using it, and I've been able to design around most issues and get it to do everything I've been asked to do.
But apparently, not something extremely simple!
I'm using Visual Studio 2019 version 16.7.2 with the Microsoft SQL Server Reporting Services Designers
version 15.0.19124.0 installed. There's no data bound to the report, this is just a simple design concept.
I have a report that has a static custom page size (in centimetres), interactive size and no margins (12.8 x 17.8cm).
The body size is deliberately set to make it a two page report (2 x the page height).
'ConsumeContainerWhiteSpace' on the report properties is set to true.
Page 1 has an image, consuming the entire space of Page 1 (size of 12.8 x 17.8), with a Text box placed near the bottom right of the image (overlaying it, but not exceeding the width or height of the page, and is set to not grow).
Page 2 is exactly the same, with the content starting where Page 2 would and should start (0, 17.8). However, the Page 2 content is set to hidden (hidden = true, on both the image and the textbox).
When previewed, the report renders two pages, one of which is blank.
If I take the Page 2 content textbox off, and preview it, the report renders as one page (as I need it to).
The same issue occurs if I replace the textbox with a Rectangle or Tablix (the two objects I really need to use in this report as well as the textbox located where it is) and set them to hidden.
Moving any of these objects to the top of Page 2, still results in the same behaviour.
It seems that certain objects, despite being hidden, have space allocated that can't be 'rolled up / truncated / shrunk'. Is this 'by design behaviour'?
Is there some form of magic-witch-craftery I'm missing here to get this to work, or simply something I'm not understanding... ?
Thanks for reading!
Note: So far I have tried the 'Switch to inches, then back to centimeters' solution mentioned in other posts along these lines, have varied 'Keep together' properties, checked 'CanGrow' and 'CanShrink' property changes - all of which have not helped find a solution.
The report body should be set at most wide enough to fit on your output page and long enough to hold all your report items. When you want different items to appear on a new page, put them in a container with a page break set either before or after (whichever is most appropriate). This can also be handled in a data driven manner using page breaks on table groups.
There is no requirement to have white space within your report design to 'fill up' the rest of the page on the rendered report.
If you want anything to appear at the bottom of the report, simply put it in the footer section. If you want specific things to appear at the bottom of the page of different heights on different pages, that is more of a challenge and will usually require some clever data driven spacers within the report body.
In Reporting Services I'm trying to place a table over a picture. Within the Report Builder it works, but whenever the report is run, the table is moved to beneath the picture. I've thought about several workarounds, but none of them has worked:
Creating a rectangle with my picture as the background, and placing the table of top of the rectangle. This works, but it doesn't show the picture in the Excel sheet when exporting the report. I need the picture in the report, so this solution is not satisfactory.
Creating a report where the background image is set to the picture I need, and then importing it in my main report as a subreport. The weird thing here is that background images WILL show up in Excel when you just export the report with the background image. However, when importing that report within another report, it doesn't show up anymore in the export.
Set the picture as background for the main report. the problem is that the picture will be the background for every page/sheet. If someone nows a possibility to set a specific background per page, I would also be helped!
TL;DR: Is it possible the overlay a table of top of a picture? Or is it possible to set a background image per page, so I can use that instead?
You can overlap text and an image but it may not show up that way depending on how you want to render it. I think it works with PDFs and DOCs but not much else.
You can use a background image for the report or just the table's background.
Click on either the Body or the table and use the Background Image properties.
Put an Expression in the Background Image Value field with your logic to determine which image to display.
https://technet.microsoft.com/en-us/library/ms156482(v=sql.100).aspx
I have images in a database that I want to display in an SSRS report. For this I have used a matrix and in this I have inserted an Image item.
Because the source image sizes are different, the images on the SSRS report are not in same size and format. I have tried the "fit to size" and "fit proportional" options to resize the images but nothing is working.
Could anyone suggest what I can do to display the images the same size in the report?
I would use a picture editor like Paint to get the images to about the same size.
Set the picture's cell size using the larger pictur and set the Sizing to CLIP so that it always show the full image without auto-sizing them. Then change the picture to use your image field.
I'd make a subreport that accepts parameters used to load your image such as a filename or for the case of images held in a database structure, the primary key.
Now resize the subreport to the size that you want and the image will be resized.
The issue I have with this method is that the images aren't resized properly, so the report runs out of memory after about 8 pages of high resolution images
I am trying to show a "check" or "X" image inside a tablix cell based on a Condition. I have added both Images to the image Folder and am setting the BackGroundImage Value property to this expression...
=IIF(Fields!PASS.Value = 1,"CheckMark","XMark")
I've also set Background Repeat to Clip. Inside Preview view it looks fine, but when pushing the rdl to the server and running the report locally, the image continues to repeat to fill the textbox.
I am running IE8 and SSRS 2008. Is there a better approach in doing this without setting Background Image property, realistically I'd like to just set the TextBox value property.
I found that I was only getting the repeating Background image 'feature' despite having BackgroundRepeat set to 'Clip' when using an image encoded in a database field or where the name of the embeded image was coming from the database i.e. where Value was set to an Expression.
What I found worked was to set BackgroundRepeat to the Expression ="Clip".
Note that I'm working in 2013/2014 RDL/RDLC but it seems to be the same issue.
One alternative would be to use the show/hide parameter in the text box to control which of the images gets hidden. I'm not sure if this would solve your not repeating option, but it is something you can try. You would set both images to show in each box and write a conditional formula (the inverse of your formula above, pretty much) to hide an image based on value. I'm not sure if that would mess up the alignment for you though, unless you can place the two images on top of eachother since only 1 should show anyway.
It seems that you are not alone with this issue, as there are several other posts about it going back as far as 2010 when I google it. The last status I saw was that it was submitted as a bug to Microsoft, and it seems all of the users had to find workarounds.
I was having the same problem. I found by setting the MIMEtype and setting BackgroundRepeat to Clip fixed the issue.
I have a report in MS Access with 4 image controls. In the format event of the detail section I have code that sets the picture property based on the values of fields in DAO.recordset. Below is an example of my code.
For i = 0 To 3
If Not rs.EOF Then
Me.Controls("img" & i).Picture = blobGet(rs!phBlobId)
rs.MoveNext
Else
Me.Controls("img" & i).Picture = ""
End If
Next i
Basically the rs!phBlobId field is a file name. The blobGet function returns the full path to the picture which then sets the picture property of the correct control in the detail section of my report.
I'm not sure all of the causes but under certain circumstances the pictures will not show up in the controls. I have a similar set up on a form and have no trouble at all there, I only have the issue when on a report.
One thing that seems to possibly be the cause is the size of the picture. If I insert a large picture (say over 5 megs) it sometimes won't show up. With different combination of pictures different ones show up.
I am open to both solutions to my problem as described above or to alternative ideas how to show these pictures on the report. One absolute requirement is that the pictures be set with VBA as the exact arrangement of the pictures varies based on an unrelated variable.
The solution I came up with was to simply resize the images using imageMagick. This actually provides me with a couple advantages. Not the least of which is a substantial performance improvement since I am dealing with smaller images.