• vishrutirdesai (12/24/2007)


    hi,

    when i select the property "header should remain visible while scrolling" it works fine.

    but the problem i got : when there is no data onto the report it displays the javascript error on the left corner of the browser "line : 16

    char:634

    Error:object Required

    code:0"

    kindly guide me...

    thanks,

    vishruti.

    vishruti,

    I have a solution for this for you that I'd like to share (other than simply turning it off - like the doctor who says just don't do that). Took me awhile to first of all figure out what was causing this problem (this post pointed me in the right direction, and is 100% correct that a fixed header without data in the table will cause this error, thanks).

    To get around this problem, I came up this solution:

    1. in your sql that populates each table in your report, add a UNION clause which will add a dummy record only if the main clause doesn't have any records.

    here is some sample sql that I used in my case:

    select * from vPersonScores

    where personID = @PersonID

    union

    select -99, null, null, null, null, null, null, null

    where (select count(*) from vPersonScores

    where personID = @PersonID) = 0

    2. in the table properties, set the visibility.hidden property to check for valid records only, something like so:

    =iif(Sum(Fields!PersonID.Value, "Scores") > 0, false, true)

    3. remember to re-set the Fixed Header property back to True.

    Now this will work fine even if the main table resultset is empty. I also created another textbox field to indicate if there were no records returned using the same logic on the visibility.hidden property, only in reverse. Hope this helps.

    Cheers

    JT