"Continued" Header on Subsequent Pages

Question:How can I repeat a group header on each page, but have it say “MyGroup (continued)” on all but the first page? Answer:Since pagination is determined long after the report has been fully processed, there’s no way for the body of the report to reference any page information.  As a result, we’re going to have…

0

Custom Report Item Image Quality

Question:How can I get print-quality output from my custom report item? Answer:Custom report items have slightly different plumbing than native report items.  Of particular note are native charts.  These are generated during report rendering, which means it is possible for us to vary both the type (raster or vector) and the DPI of the image…

0

"All" Parameter Value Redux

Question:How can I enable users to select “All” as the value of a multivalue query parameter? Answer:Since multivalue parameters cannot be null, you cannot use the approach previously described here.  Fortunately, a simple modification of that approach to use a non-null “ALL” token is all that is required. Step 1:  Start with a report that…

0

Reset Page Number On Group

Question:How can I reset my page number back to 1 every time I get a group break? Answer:Resetting the page number on group breaks isn’t natively supported, but it can be achieved by tracking group breaks in a shared variable and subtracting off the page offset of the first page of the group from the…

0

GroupPageReset.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“>  <PageHeader>    <ReportItems>      <Textbox Name=”PageNumber”>        <Style>          <PaddingLeft>2pt</PaddingLeft>          <BorderStyle>            <Default>Solid</Default>          </BorderStyle>          <PaddingBottom>2pt</PaddingBottom>          <PaddingTop>2pt</PaddingTop>          <PaddingRight>2pt</PaddingRight>        </Style>        <ZIndex>1</ZIndex>        <Height>0.375in</Height>        <Width>1.5in</Width>        <CanGrow>true</CanGrow>        <Value>=”Page: ” &amp; Globals!PageNumber</Value>      </Textbox>      <Textbox Name=”GroupPage”>        <Style>          <PaddingLeft>2pt</PaddingLeft>          <BorderStyle>            <Default>Solid</Default>          </BorderStyle>          <PaddingBottom>2pt</PaddingBottom>          <PaddingTop>2pt</PaddingTop>          <PaddingRight>2pt</PaddingRight>        </Style>        <Height>0.375in</Height>        <Width>3.625in</Width>        <CanGrow>true</CanGrow>        <Value>=”Grouped Page: ” &amp; Code.GetGroupPageNumber(ReportItems!Category.Value,Globals!PageNumber)</Value>        <Left>1.75in</Left>      </Textbox>    </ReportItems>    <PrintOnLastPage>true</PrintOnLastPage>    <PrintOnFirstPage>true</PrintOnFirstPage>    <Style />    <Height>0.5in</Height>  </PageHeader> …

0

Custom Report Items

A currently undocumented feature of SQL 2005 Reporting Services is the ability to develop custom report items for embedding in reports.  The documentation will be available in the web doc update around the time of the release.  But for those of you interested in playing around with this in the mean time, I’ve put together…

0

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

Green-Bar Matrix

Question:How can I get a green-bar effect (alternating colors) in a matrix? Answer:For a green-bar table, you can simply use a background color expression like this: =iif(RowNumber(Nothing) Mod 2,”Green”,”White”)However, there is currently no GroupNumber() function on which to base a green-bar calculation in a matrix.GroupNumber can be (mostly) simulated by using the RunningValue function to…

0

MatrixGreenBar.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“>  <RightMargin>1in</RightMargin>  <Body>    <ReportItems>      <Matrix Name=”matrix1″>        <Corner>          <ReportItems>            <Textbox Name=”textbox1″>              <Style>                <PaddingLeft>2pt</PaddingLeft>                <BorderStyle>                  <Default>Solid</Default>                </BorderStyle>                <PaddingBottom>2pt</PaddingBottom>                <PaddingTop>2pt</PaddingTop>                <PaddingRight>2pt</PaddingRight>              </Style>              <ZIndex>4</ZIndex>              <rd:DefaultName>textbox1</rd:DefaultName>              <CanGrow>true</CanGrow>              <Value />            </Textbox>          </ReportItems>        </Corner>        <Height>0.5in</Height>        <Style />        <MatrixRows>          <MatrixRow>            <MatrixCells>              <MatrixCell>                <ReportItems>                  <Textbox Name=”Qty”>                    <Style>                      <PaddingLeft>2pt</PaddingLeft>                      <BackgroundColor>=ReportItems!Color.Value</BackgroundColor>                      <BorderStyle>                        <Default>Solid</Default>                      </BorderStyle>                      <TextAlign>Right</TextAlign>                      <PaddingBottom>2pt</PaddingBottom>                      <PaddingTop>2pt</PaddingTop>                      <PaddingRight>2pt</PaddingRight>                    </Style>                    <rd:DefaultName>Qty</rd:DefaultName>                    <CanGrow>true</CanGrow>                    <Value>=Sum(Fields!Qty.Value)</Value>                 …

0