Which code segment should you use in the report header?

You create a SQL Server 2008 Reporting Services (SSRS) report.
The report contains a table that displays a list of products. The list of products includes the
three fields named ProductName, ProductCategory, and ProductPrice. The table contains a
textbox named ProductCategory that displays the ProductCategory field.
The dataset is sorted by ProductCategory.
You need to ensure that the report header displays the ProductCategory of the first product
listed on each page of the report.
Which code segment should you use in the report header?

You create a SQL Server 2008 Reporting Services (SSRS) report.
The report contains a table that displays a list of products. The list of products includes the
three fields named ProductName, ProductCategory, and ProductPrice. The table contains a
textbox named ProductCategory that displays the ProductCategory field.
The dataset is sorted by ProductCategory.
You need to ensure that the report header displays the ProductCategory of the first product
listed on each page of the report.
Which code segment should you use in the report header?

A.
=Fields!ProductCategory.Value

B.
=First (Fields(ProductCategory.Value )

C.
=First( ReportItems (“ProductCategory “).Value)

D.
=ReportItems (” ProductCategory “) .Value

Explanation:
Page headers and footers can contain static content, but they are more commonly used to
display varying content like page numbers or information about the contents of a page. To
display variable data that is different on each page, you must use an expression. If there is
only one dataset defined in the report, you can add simple expressions such as [FieldName]
to a page header or footer. Drag the field from the Report Data pane dataset field collection
or the Built-in Fields collection to the page header or page footer. A text box with the
appropriate expression is automatically added for you. To calculate sums or other
aggregates for values on the page, you can use aggregate expressions that specify
ReportItems or the name of a dataset. The ReportItems collection is the collection of text
boxes on each page after report rendering occurs. The dataset name must exist in the report
definition.



Leave a Reply 0

Your email address will not be published. Required fields are marked *