如何在文档查看器中添加更多边距?
Posted
技术标签:
【中文标题】如何在文档查看器中添加更多边距?【英文标题】:How can I add more margin in the documentviewer? 【发布时间】:2015-12-25 11:54:20 【问题描述】:我有一份报告,这是我的 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()
问题是在浏览器中我可以正确看到我的报告文档,但我无法正确看到报告的边框,我已为视图附加了一张图片。
有什么方法可以在文档查看器中添加更多边距?
我必须强调,当我打印我的报告时,它看起来不错, 问题仅在预览文档查看器中。
【问题讨论】:
【参考方案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()
【讨论】:
以上是关于如何在文档查看器中添加更多边距?的主要内容,如果未能解决你的问题,请参考以下文章