WindowsForms - C # - ReportViewer - "Full HD Resolution" Remove Borders

0

I'm using Report Viewer, data appears normal, but a blank border appears on computers with high resolution like FULL HD for example.

Formloadingcode.

Reportproperties.

I installed the EXE on another smaller resolution machine and the report was generated without the border. I would like to remove this border or know if it has any settings for the report to expand with resolution.

    
asked by anonymous 05.05.2018 / 02:27

1 answer

0

Greetings.

In my project I solved the following code:

First, create the ConfigureMargs method.

private void ConfigurarMargens()
{
   // Configura as margens do relatório
   System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
   pg.Margins.Top = 0;
   pg.Margins.Bottom = 0;
   pg.Margins.Left = 0;
   pg.Margins.Right = 0;
   pg.Landscape = false;
   this.reportViewer1.SetPageSettings(pg);
   this.reportViewer1.RefreshReport();
}

In the Load Event of the Form do so:

private void frmMeuForm_Load(object sender, EventArgs e)
{
   this.reportViewer1.RefreshReport();
   ConfigurarMargens(); 
}

Make sure you're using the library:

using System.Drawing;

I hope this code serves as it served me.

    
05.05.2018 / 21:05