Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2715
2 reportviewer on same page
posted

I have a mvc 5 project with to report views

each in it own tabs

the second is always zoom out

is there a way to avoid this

see images

<div id="tabs">
<ul>
<li><a href="#tabs-1">BEKRÆFTIGELSE</a></li>
<li><a href="#tabs-2">OPLYSNINGER TIL OMVISER</a></li>
</ul>
<div id="tabs-1">
<div style="text-align:center; width:850px" id="viewer1"></div>
</div>
<div id="tabs-2">
<div style="text-align:center; width:850px" id="viewer2"></div>
</div>
</div>

var rangeParameters = [{ Key: "ID", Value: 1 }];
$(document).ready(function () {
$("#tabs").tabs();
var _ID = '@ViewBag.ID';
var bekraeft = '@ViewBag.Bekraeft';
var sxs = '@ViewBag.SXS';
rangeParameters[0].Value = _ID;
$("#viewer2").igReportViewer({
renderSettings: {
definitionUri: "/Reports/Oplysninger_Omviser.igr",
serviceEndpointUri: "/ReportService1.svc/ajaxAddress/"
},
parameters: rangeParameters,
width: 800,
height: 550,
pageFit: 'fitToWidth'
});
if (bekraeft != 'Nej') {
$("#viewer1").igReportViewer({
renderSettings: {
definitionUri: "/Reports/Bekraeftigelse.igr",
serviceEndpointUri: "/ReportService1.svc/ajaxAddress/"
},
parameters: rangeParameters,
width: 800,
height: 550,
pageFit: 'fitToWidth'
});
}
});

Report.zip
Parents
  • 29417
    Offline posted

    Hello Christian,

     

    Thank you for posting in our forum.

     

    The second report that’s in the hidden tab will be initiated when the page loads together with the one from the first tab.

    However due to the following setting:

    pageFit: 'fitToWidth'

    When its initially created inside a hidden container, the content will not be properly fitted.

    You would need to refresh it in order for it to be properly fitted.

    For example you can use the activate event of the tab and when the second tab is selected refresh the second report viewer:

    $("#tabs").on("tabsactivate", function (event, ui) {

                if (ui.oldTab.attr("tabindex") == 0) {

                    $("#viewer2").igReportViewer("refresh");

                }

            });

     

    Let me know if you have any questions.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

Reply Children