how to set the page size to a4 in windows form for pdf report generation using asp.net?
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.
Edit: Including the Page
properties of a regular A4 sized Report.
DEEPAK JAWALKAR
Updated on June 10, 2022Comments
-
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 over 8 yearsi do have done this but then also same problem I am facing
-
Oceans over 8 yearsRead 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 over 8 yearskindly go through the image and suggest me to proceed by either using table or custom design? Currently i have used custom design.
-
Oceans over 8 yearsYou'll have to add the image to your question. Perhaps include a screenshot of your Report Builder as well.
-
Oceans over 8 yearsYou 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 over 8 yearsi have completely reduced the margins