1

我有一份报告,这是我的 html 页面的代码:

@Html.DevExpress().DocumentViewer(settings =>{
    // The following settings are required for a Report Viewer.
    settings.Name = "documentViewer1";
    settings.Report = (Misteryshopper.Reports.ResumenProyecto)ViewData["Report"];
    // Callback and export route values specify corresponding controllers and their actions.
    // These settings are required as well.    

    settings.CallbackRouteValues = new { Controller = "Report", Action = "ProyectDocumentViewerPartial" };
    settings.ExportRouteValues = new { Controller = "Report", Action = "ProyectExportDocumentViewer", ReportName = ReportName };
    // Parameters

    settings.SettingsReportViewer.EnableRequestParameters = false;
    settings.SettingsSplitter.SidePaneVisible = false;  

    }).GetHtml()

问题是在浏览器中我正确地看到了我的报告文档,但是我无法正确地看到我的报告的边框,我已经为视图附加了一个图像。

有没有办法在文档查看器中放置更多边距?

我必须强调,当我打印我的报告时,它看起来不错,问题只是在预览文档查看器中。

4

1 回答 1

1

您只需在代码中添加这一行:

settings.SettingsReportViewer.EnableMargins=true;

@Html.DevExpress().DocumentViewer(settings =>{
// The following settings are required for a Report Viewer.
settings.Name = "documentViewer1";
settings.Report = (Misteryshopper.Reports.ResumenProyecto)ViewData["Report"];
// Callback and export route values specify corresponding controllers and their actions.
// These settings are required as well.    

settings.CallbackRouteValues = new { Controller = "Report", Action = "ProyectDocumentViewerPartial" };
settings.ExportRouteValues = new { Controller = "Report", Action = "ProyectExportDocumentViewer", ReportName = ReportName };
// Parameters

settings.SettingsReportViewer.EnableRequestParameters = false;
settings.SettingsSplitter.SidePaneVisible = false; 

// YOU HAVE TO ADD THIS LINE ...... 
    settings.SettingsReportViewer.EnableMargins = true; 

    }).GetHtml()
于 2015-09-28T11:46:00.407 回答