2

I want to add to the generated table report a Css class , so I can recognize it in jQuery, and work with it later.

However - I can't find in the Vs2010 where to add it.

The generated Dom is :

<TABLE lang="en-US" class="P982bb20adb5840028f48eb24364cff1c_2_r10" border="0" cellSpacing="0" cellPadding="0" cols="4">
<TBODY>
<TR>
<TD style="WIDTH: 0mm; HEIGHT: 12.35mm">
</TD>

which doesn't help me much.

Any help ?

enter image description here

1 Answer 1

1

I didn't add a CSS class to elements to help identify, but, my approach was to find the table through navigating to it via jQuery selectors. This is my workaround and you don't mention the report viewer version so I don't know if my selector would work.

To find the selector you need yourself, use Firefox and the FireBug extension to navigation through the DOM.

Selector used for 2010 report viewer the # id depends on what you called the control if I remember correctly:

if ($.browser.msie && parseInt($.browser.version) >= 8) {
    $('#ReportViewer_fixedTable tbody').children('tr:visible:eq(2)').children('td:visible:eq(2)').addClass('blah');
} else {
    $('#ReportViewer_fixedTable body').children('tr:visible:eq(2)').children('td:visible:eq(0)').addClass('blah');
}
2
  • which selecor did you search ?
    – Royi Namir
    Jan 19, 2012 at 14:07
  • Updated answer for 2010 report viewer
    – Phil
    Jan 19, 2012 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.