How can I add more margin in the documentviewer?

北城以北 提交于 2019-12-10 11:44:38

问题


I have a report and this is the code for my html page:

@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()

The problem is that in the browser I see my report document correctly, but I can´t see the borders of my report correctly, I have attached an image for the view.

Is there any way to put more margin in the document viewer?

I have to stress that when I print my report, it seems good, the problem is only in the preview document viewer.


回答1:


You have to add only this line in your code:

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()


来源:https://stackoverflow.com/questions/32819618/how-can-i-add-more-margin-in-the-documentviewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!