Thursday, April 26, 2012

difference between Parameters and Fields in SSRS reports

Having this in a report:

<Value>= "Logged Hours during the period from " & Parameters!StartDate.Value & " to " & Parameters!EndDate.Value</Value>

 
 

...assumes that StartDate and EndDate are handed in as parameters while having this in a report:

<Value>= "Logged Hours during the period from " & Fields!StartDate.Value & " to " & Fields!EndDate.Value</Value>

 
 

...assumes that StartDate and EndDate are handed in back from a stored procedure or other query as part of the dataset:

<DataSets>
   <DataSet Name="MyDataSet">
      <Fields>
         <Field Name="StartDate">
            <DataField>StartDate</DataField>
            <rd:TypeName>System.DateTime</rd:TypeName>
         </Field>
         <Field Name="EndDate">
            <DataField>EndDate</DataField>
            <rd:TypeName>System.DateTime</rd:TypeName>
         </Field>
         <Field Name="MoreStuff">
            <DataField>MoreStuff</DataField>
            <rd:TypeName>System.String</rd:TypeName>
         </Field>

No comments:

Post a Comment