Solved

Custom code not working in page header upon PDF export

Posted on 2008-06-23
1
295 Views
Last Modified: 2012-08-13
Due to the lack of data binding support in page headers on SQL Server Reports I found this code online that allows you to grab info from fields in the details section of the report and display them in the header.  The code is as follows:

Function GetItemValue(ByVal Items As ReportItems, ByVal item As String) As String
    return Items(item).Value
End Function

This works great when viewing in HTML but when I export this report to any format the code gets ignored and the fields in my page header are blank.  Is there any way around this?
0
Comment
Question by:SYNERGYTECH
1 Comment
 
LVL 9

Accepted Solution

by:
Tone' Shelby earned 125 total points
ID: 21851824
Yes if you try to add a field from a data set or custom code to the page header, SSRS rejects the action or just doesn't show for the later.

Workaround: Place the field value in an item in the body of the report & then you can hide it with the visibility property but you are only placing it there for reference, then refer to that report item in the header (for example, =ReportItem!txtFie ldValue.Value).


hope it helps ...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now