SSRS center align cell with image

moondaddy 911 Reputation points
2021-09-21T03:56:46.08+00:00

Using SSRS 2019, I have a tablix which contains an image in one of the cells and as you can see in the screenshot, the images are left aligned. Is there a way to center align them?

133779-image.png

Thank you.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,849 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Joyzhao-MSFT 15,566 Reputation points
    2021-09-21T05:29:23.15+00:00

    Hi @moondaddy ,
    SSRS is a great tool for creating reports, but it has some limitations. One such limitation is right or centre aligning images.
    It is not possible to directly do auto-align / docking. By default images are placed at the top left of a cell, and will expand from there based on the Display properties you set. In order to position a static image we can either resize the cell the image is in, or modify the padding settings. For more information,please refer to: Right and Centre Align Images in a Table.

    If this does not work for you, it is possible to use custom code and element padding. please refer to: Align image logo to the right.

    Regarding where to specify the padding to adjust the position of the image:

    At first, assuming we know the width of the image, we can add padding to the left side of the image to make it separate in the entire cell. Therefore, if our cell is 5 cm wide and the image is 2 cm wide, we want to add 3 cm padding to the left of the image to align it to the right.

    I did a test locally, selected the cell, and set the values of Left, Right, Top, and Bottom in the Padding option in the properties, so that the Image was visually centered.
    In order to display clearly, I set a background color for the Table.
    133770-02.jpg
    133796-03.jpg

    Preview:
    133861-04.jpg

    Best Regards,
    Joy


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.