Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Custom code not working in page header upon PDF export

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

828 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