Centered Images

Question:I have variable sized images I want to display in a table column.  How can I center these images without stretching them to fill the table cell? Answer:While there is no automatic centering behavior for the Image control, you can simulate this by writing an expression for PaddingLeft and PaddingTop to result in a centered…

0

CenteredImage.rdl

<?xml version=”1.0″ encoding=”utf-8″?><Report xmlns=”http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition” xmlns:rd=”http://schemas.microsoft.com/SQLServer/reporting/reportdesigner“>  <CodeModules>    <CodeModule>System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</CodeModule>  </CodeModules>  <RightMargin>1in</RightMargin>  <Body>    <ReportItems>      <Table Name=”table1″>        <Height>3.25in</Height>        <Style />        <Header>          <TableRows>            <TableRow>              <Height>0.25in</Height>              <TableCells>                <TableCell>                  <ReportItems>                    <Textbox Name=”textbox1″>                      <Style>                        <PaddingLeft>2pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <PaddingBottom>2pt</PaddingBottom>                        <PaddingTop>2pt</PaddingTop>                        <PaddingRight>2pt</PaddingRight>                      </Style>                      <ZIndex>5</ZIndex>                      <rd:DefaultName>textbox1</rd:DefaultName>                      <CanGrow>true</CanGrow>                      <Value>Product</Value>                    </Textbox>                  </ReportItems>                </TableCell>                <TableCell>                  <ReportItems>                    <Textbox Name=”textbox2″>                      <Style>                        <PaddingLeft>2pt</PaddingLeft>                        <BorderStyle>                          <Default>Solid</Default>                        </BorderStyle>                        <PaddingBottom>2pt</PaddingBottom>                        <PaddingTop>2pt</PaddingTop>                       …

0