Windowsforms - C# - Reportviewer - "Full HD Resolution" Remove Edges

Asked

Viewed 104 times

0

I am using the Report Viewer, the data appears normal, but appears a blank border on computers with high resolution as FULL HD for example.

inserir a descrição da imagem aqui

Code for loading the form.

inserir a descrição da imagem aqui

Properties of the report. inserir a descrição da imagem aqui

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

  • Please put the code in writing in the question so we can analyze it.

1 answer

0

Greetings.

In my project I solved with the following code:

First create the method Configurarmargens.

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

At the Event Load of 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 you as it served me.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.