I would like to have image with caption printed below the image in XSL-FO. the caption should have right alignment.
I am using table for that. It prints images with captions but the problem is the alignemnt of the caption compared to the caption. If the alignment of the image is 'right' then all looks fine: caption is just below the image at the right side. but if the image is center or left then still at the far right of the page.
The problem is the table is full width of the page but the image is smaller. The problem can be solved if the width and the alignment of the table corresponds to the width and the alignment of the image.
will really appreciate help to resolve this issue.
regards,
rnv
You might want to ensure the table is not taking the entire width of the page, but just the width it needs. This way, the table will be as wide as the image, and your caption will be aligned to the right, neatly under the image.
However, now you want your image to be in the center of the page. The solution could be to put the table in another table and let this outer table take the entire width of the page. A fo:block might also do the trick.
Related
I created RDLC report layouts by using Visual Studio Report Designer.
I need to display image on textbox.
The image was set center align by Chris Hays 's method.
But This method must set sizing to be "Clip"
So It has a problem because when Image which it was getting from database is bigger than textbox. It would clipped like below.
I tried to use sizing with "Fit Proportional" Mode. It can't set centered image by Chris Hays 's method.
But if I use sizing with "Fit to size". I can ignore centered image. But if some image is very small. It will lose quality.
What should I do if I need to
1.Centered image
2.Fit to textbox if image is bigger than textbox.
3.Original size if image is smaller that textbox.
I can resolved this problem by created two image control.
First image control -It was set sizing "Fit"
Second image control- It was set sizing "Clip" and used Chris Hays 's method for centered image.
Both two image controls was set Visibility property by expression
if a width of image is bigger than textbox , First image control will show and second will hide.
if a width of image is smaller than textbox , First image control will hide and second will show.
I can get a width of image by this code
=(System.Drawing.Image.FromStream(new System.IO.MemoryStream(CType(First(Fields!FILE_BINARY_DATA.Value, "My Table"),Byte()))).Width /96)
96 is dpi
After I known a width of image from above expression.
I will use it for set Visibility Property of First Image like these
=iif((imgWidthInch.Value > 2.6 ),false,true)
2.6 is widht of my textbox.
And Set Visibility of Second Image by the other hand.
If you're using the same sizes of the tutorial you could try and set the Sizing property by using the following expression:
=IIF(Round((3.5-System.Drawing.Image.FromStream(new System.IO.MemoryStream(CType(Fields!LargePhoto.Value,Byte()))).Width
/96)/2,2)>0, "Clip", "Fit")
I am adding image to a table cell. I want to position the image to the right of the cell.
I've tried this:
PdfPCell imagecell= new PdfPCell();
imagecell.add element(myImage);
imagecell.setHorizontalAlignment(Element.ALIGN_RIGHT);
Actually, I have got a solution for the question so thought it might be helpful to share it here.
The image can be aligned to the right of the table cell by specifying the alignment property of the Image object as shown below:
myImage.setAlignment(Image.ALIGN_RIGHT);
I am using tables to create a grid of movie posters, the only problem is how do I put a caption under each image without affecting the images alignment or anything else? Let me know
I wanted to draw a rectangle with rounded corners in SSRS. But, after lot of research i got to know that currently there is no property for that. So, i am trying to use an image of a rectangle with rounded corners and on top of that trying to align the table and other controls within the image. But, when i am previewing it or exporting it to a PDF file, first the image is getting displayed, then below that all other controls comes. Am i doing anything wrong. Please let me know.
Why don't you try to enclose your image rectangle and other controls etc. within an SSRS Rectangle with BorderStyle = None...
Try following:
Create an image (the rectangle with rounded corners) in your favourite image drawing program. I did mine in Microsoft Paint
and save it as JPEG.
In SSRS report design, in Report Data pane, right click on Images >> Add Image and point to the image that you created in Step 1. (Untitled, in my case see the fig. below)
In SSRS report design, add a Rectangle from the Toolbox to the design surface and in the Properties Pane:
a) look for the BackgroundImage property Click its + sign. then
b) Enter values for Source as Embedded, BackgroundRepeat as Clip and the Value property , when you click the dropdown for its values, should show you the name of the image that you embedded in Step-2, select this name
Resize your rectangle to fit the shape and add your items to this rectangle.
EDIT:
Regarding the question in the Comment, I don't think that the size of the image rectangle can be increased dynamically. If that's the case then you may need to find some other work-around
HTH
I tried sample code in App Dev Center, but the code only can show images side by side and fill all scroll view, I want to realize like attached picture, who can give me some thoughts? Thanks~!
The width of a "page" when you use a paging scroll view is the width of the scroll view itself. So if you want to use that feature, the scroll view must be the width of the pix plus half the width of the borders on either side, so that the next picture will come into place correctly. Now, if you don't want to hide the picture at the right before it's been paged into the scroll view, just don't turn on clipsToBounds.