Solved

Custom code not working in page header upon PDF export

Posted on 2008-06-23
1
297 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

770 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