how to set the page size to a4 in windows form for pdf report generation using asp.net?

13,573

If the content of the report doesn't fit on a single page it will expand and of course need multiple pages. Unless you're completely certain that the data would fit a single page, there is no way of stopping this from happening.

But if you're completely positive that it would fit a single page, make sure that all the elements have the property Keep contents together on a single page, if possible checked and that both properties that add a page break are unchecked (Add a page break before and Add a page break after).

Below is an image as an example.

enter image description here


Edit: Including the Page properties of a regular A4 sized Report.

enter image description here

Share:
13,573
DEEPAK JAWALKAR
Author by

DEEPAK JAWALKAR

Updated on June 10, 2022

Comments

  • DEEPAK JAWALKAR
    DEEPAK JAWALKAR almost 2 years

    I am working on a windows application wherein I am unable to set the page size to a4 sheet. While taking print or saving the report as pdf the content of the report is expanded to 2-3 pages.How to overcome this?

    I do have tried using using these

    iTextSharp.text; using iTextSharp.text.pdf; then also i am unable to get it.

  • DEEPAK JAWALKAR
    DEEPAK JAWALKAR over 8 years
    i do have done this but then also same problem I am facing
  • Oceans
    Oceans over 8 years
    Read carefully what i wrote, it's impossible to limit the report to a single page if the content exceeds the PageSize. I'll edit my answer to include the sizes of an A4 page.
  • DEEPAK JAWALKAR
    DEEPAK JAWALKAR over 8 years
    kindly go through the image and suggest me to proceed by either using table or custom design? Currently i have used custom design.
  • Oceans
    Oceans over 8 years
    You'll have to add the image to your question. Perhaps include a screenshot of your Report Builder as well.
  • Oceans
    Oceans over 8 years
    You could reduce the page Margins and set fixed widths to your Columns and TextBoxes so it doesn't grow beyond the page's maximum width.
  • DEEPAK JAWALKAR
    DEEPAK JAWALKAR over 8 years
    i have completely reduced the margins