asp.netreport-viewer2010

How to centralize rdl report content inside Asp.Net ReportViewer


I have a set of rdl files. I used those report rdl's inside asp.net reportviewer. It works OK with my reportviewer control. My problem is, the report content is always reders far left side. I need to make the report content always render center to that reportviewer.

Is there any default property to do this??


Solution

  • I somehow managed to centralize my content of the reportviewer using the below code.

    $(document).ready(function(){
        Sys.Application.add_load(function () {
            $find("ReportViewer1").add_propertyChanged(viewerPropertyChanged);
        });
    });
    function viewerPropertyChanged(sender, e) {
        if (e.get_propertyName() == "isLoading") {
            if ($find("ReportViewer1").get_isLoading()) {
                $("#VisibleReportContentReportViewer1_ctl09").find('div').find("table:first").attr("align","center");
            }
            else {
                $("#VisibleReportContentReportViewer1_ctl09").find('div').find("table:first").attr("align","center");
            }
        }
    };