Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying input params in Report Header 1

Status
Not open for further replies.

jrenae

Programmer
Jan 18, 2006
142
US
Hello,

I have an existing report to which I'm trying to add a report header. The report takes some parameters like, startdate, enddate, type, etc. I would like those parameters to show in the report header.

First off, how do I add the header? The report automatically entered a textbox with the report name in it. I was trying to expand the area so I could put labels and other info there, but it messed up the layout.

Thanks
 
first - get the header area
In Visual Studio - on a layout tab - click on the Report Menu - one of the choices at the bottom is 'Page Header' - click in - voila new region of the report

Second putting the date into the report title
I would drag the old title to the new region. THEN right click on the title and go to Expression . In here you can click any of the paramaters and it should look like this when you are done
Code:
="International Revenue " & Parameters!EndDate.Value
I usually also include my other cascading paramters in the title

make sense?

Personally I also add the footer. It includes this code
Code:
  <PageFooter>
    <PrintOnFirstPage>true</PrintOnFirstPage>
    <ReportItems>
      <Line Name="lineFooter_breaker">
        <Top>0.075cm</Top>
        <Width>-24.66191cm</Width>
        <Style>
          <BorderStyle>
            <Default>Solid</Default>
          </BorderStyle>
        </Style>
        <ZIndex>3</ZIndex>
        <Left>24.87064cm</Left>
        <Height>0cm</Height>
      </Line>
      <Textbox Name="txtFooter_PageNumber">
        <Top>0.24246cm</Top>
        <Width>3.46561cm</Width>
        <Style>
          <FontFamily>Tahoma</FontFamily>
          <FontSize>8pt</FontSize>
          <TextAlign>Right</TextAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <ZIndex>2</ZIndex>
        <CanGrow>true</CanGrow>
        <Left>21.37858cm</Left>
        <Height>0.25in</Height>
        <Value>="Page " + Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString()</Value>
      </Textbox>
      <Textbox Name="txtFooter_TimeTaken">
        <Top>0.175cm</Top>
        <Width>4.5119cm</Width>
        <Style>
          <FontFamily>Tahoma</FontFamily>
          <FontSize>8pt</FontSize>
          <TextAlign>Left</TextAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <ZIndex>1</ZIndex>
        <CanGrow>true</CanGrow>
        <Left>0.35874cm</Left>
        <Height>0.63492cm</Height>
        <Value>="Execution Time: " +
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).TotalSeconds &lt; 1, "0 seconds", 
(
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours &gt; 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours &amp; " hour(s), ", "") +
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes &gt; 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes &amp; " minute(s), ", "") +
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds &gt; 0, System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds &amp; " second(s)", ""))
)</Value>
      </Textbox>
      <Textbox Name="txtFooter_PrintBy">
        <Top>0.175cm</Top>
        <Width>15.55555cm</Width>
        <Style>
          <FontFamily>Tahoma</FontFamily>
          <FontSize>8pt</FontSize>
          <TextAlign>Center</TextAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <CanGrow>true</CanGrow>
        <Left>5.18811cm</Left>
        <Height>0.63492cm</Height>
        <Value>=" Printed by " + User!UserID + " on " + Globals!ExecutionTime.ToString()</Value>
      </Textbox>
    </ReportItems>
    <Height>0.375in</Height>
    <PrintOnLastPage>true</PrintOnLastPage>
  </PageFooter>
in your rdl - to do this right click on the rdl in your solution - select 'view code'. Go WAY to the bottom. Insert this code right after
Code:
  <Language>en-US</Language>

THis gives who ran the report, page numbers... kinda slick.
 
Thank you so much...this worked perfectly!
 
no prob - glad I could help

on mandatory evacuation from my office because of flooding (estimated at 1 foot in first floor of my building).

should be an interesting time --- good luck all.
 
flooding is bad bad bad...

bridges - interstates... everything - covered in water or closed.

Instead of 24 feet in front of my office the river crest is now at almost 32 - so first floor will have 7 feet of water in it instead of nothing or very little... so much for their initial predicitons.

fortunatly we grabbed most of the servers off of 2nd floor and have our email & servers going out of another of our sites... but head quarters is toast... manufacturing is out for at least a week... this stinks

thanks for the thoughts though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top