views:

488

answers:

0

My issue is occuring in Sql Server 2005 Reporting Services. It is happening in the preview area within Visual Studio and when exporting the report to .pdf from the report server, but it is displaying correctly when to deployed to the report server. This wouldn't be an issue, except for that the higher ups often export these reports to .pdf.

I have a SQL Server 2005 report that I am working on that lists a persons ID # and then some other information about the person. This is being shown in a SSRS table. There is often many distinct rows of information for a person. So what I've done on the report is I am using

=IIF(Previous(Fields!PersonIdNo.Value) = Fields!PersonIdNo.Value, "", Fields!PersonIdNo.Value)

as my expression for the Value so that the Person's Id # is only shown once for all there information items and this is working great (after writing the expression I've realized that I could've used the HideDuplicates property). The problem I have is that I want to put a top border each time I start a new persons information. To do this, I've got the expression

=IIF(Previous(Fields!PersonIdNo.Value) = Fields!PersonIdNo.Value, "None", "Solid")

as the Top BorderStyle property and I've set the default BorderColor to "Black" and the default BorderWidth to "1pt". This alone will work, but where it breaks is on fields where I have conditional BackgroundColors, but the weird thing is that it only fails to show the top border every once in a while (i.e. out of 50 people, the top border won't show 3ish times). The expression for the conditional BackgroundColor is

=IIF(RunningValue(Fields!PersonItem.Value, CountDistinct, "person_grouping") MOD 2, "White", "WhiteSmoke")

I thought that using the Previous() function in the BorderStyle expression might of been breaking it so I wrote a custom function to handle the BorderStyle that has the same problem. In case it helps heres the custom code

Private previousPersonId As String

Public Function GetBorderStyle(ByVal currentPersonId As String) As String

    If previousPersonId = currentPersonId Then
        previousPersonId = currentPersonId
        Return "None"
    Else
        previousPersonId = currentPersonId
        Return "Solid"
    End If

End Function

And used the expression

=Code.GetBorderStyle(Fields!PersonIdNo.Value)

I've also played tried adjusting the Padding and VerticalAlignment with it still not working.

Anyways, I've racked my brain on it for quite a while now and figured I'd throw it up here and see if anybody has any thoughts or has encountered something similar. Thanks.