@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.XtraReports.Web.DocumentViewer
@using Xafari.Mvc.Templates
@using Xafari.ReportsV2.Mvc.MVCx

@model Xafari.ReportsV2.Mvc.MVCx.ReportViewerDetailItem

@{
	Guard.ArgumentNotNull(this.Model.queryReport.Report, "queryReport.report");
}

@Html.DevExpress().DocumentViewer(settings =>
{
	settings.Name = "xafReportViewer";
	settings.CallbackRouteValues = new
	{
		Controller = "ReportViewerDetailItem",
		Action = "ReportViewerDetailItemPartial",
		frameId = this.ViewData.Frame().FrameId(),
		editorId = this.Model.Id
	};
	settings.ExportRouteValues = new
	{
		Controller = "ReportViewerDetailItem",
		Action = "ReportViewerDetailItemPartialExport",
		frameId = this.ViewData.Frame().FrameId(),
		editorId = this.Model.Id
	};
	settings.Report = this.Model.queryReport.Report;
	settings.SettingsSplitter.SidePanePosition = DocumentViewerSidePanePosition.Left;
	settings.Init += (sender, args) =>
	{
		var mvcxDocumentViewer = sender as MVCxDocumentViewer;
		if (mvcxDocumentViewer == null) return;

		mvcxDocumentViewer.CustomizeParameterEditors += this.Model.ReportViewer_CustomizeParameterEditors;
		//new ReportViewerDetailItem.ReportViewerReportDisposeManager().Attach(mvcxDocumentViewer, this.Model.queryReport.Report);// it is not necessary for the MVC
	};
}).GetHtml()