Setting printer paper size in VB.Net for rdlc report

I built a landscape-oriented report using VB.net 2010 and made a size of 16.5 cm * 8.25 cm

When you print a report, A4 page size is directly displayed.

I need to provide the printer with a custom paper size. How can I make my report a custom paper size?

Link: http://www.uploadmb.com/dw.php?id=1379145264

+4
source share
3 answers

To change the default format (A4) of a report, you must change the report properties to accept the size of custom paper.

Set paper size by graphical interface

Step 1

Open the report and right-click (on the gray panel, not on the report itself) to select "Report Properties"

Report properties

Step 2

Select "Landscape" for orientation and select a custom format. Indicate also your width and height.

Paper size


PaperSize Software Suite

  • The paper size should be the size in inches times 100
  • Width: paper width, in hundredths of an inch
  • Height: paper height, in hundredths of an inch

Here is the code I used to programmatically set my own paper size in my report

ReportViewer1.PrinterSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", 650, 325) 

** Note. Do not forget that you may need to use the code ReportViewer1.RefreshReport() if it does not work. *

For more information, visit the MSDN PaperSettings.PaperSize Page

+5
source

I solved the problem by setting the report properties - setting the page size in inches, then setting the width to 3.0 inches and the height to 8.3 inches, the problem was solved.

0
source

Dim page As XmlElement = AddElement (reportSection, "Page", Nothing)

  'landscape AddElement(page, "PageHeight", "8.5in") AddElement(page, "PageWidth", "11in") 
-one
source

Source: https://habr.com/ru/post/1502158/


All Articles