Question

I am new in RDLC reporting. i have placed few textbox controls + image control on the left and right side of report in .rdlc file.

and through programming i am passing parameters to render its results. Everything works perfectly except report design.

it moves right content area with image and two textboxes below it to next page, could you please guide me what is the issue behind this? enter image description here Major Part Of The code

string deviceInfo =
                    "<DeviceInfo>" +
                    "  <OutputFormat>PDF</OutputFormat>" +
                    "  <PageWidth>8in</PageWidth>" +
                    "  <PageHeight>10in</PageHeight>" +
                    "  <MarginTop>0.5in</MarginTop>" +
                    "  <MarginLeft>0.25in</MarginLeft>" +
                    "  <MarginRight>0.25in</MarginRight>" +
                    "  <MarginBottom>0.5in</MarginBottom>" +
                    "</DeviceInfo>";

                    Warning[] warnings;
                    string[] streams;
                    byte[] renderedBytes;

                    //Render the report
                    renderedBytes = rv.LocalReport.Render(
                        reportType,
                        deviceInfo,
                        out mimeType,
                        out encoding,
                        out fileNameExtension,
                        out streams,
                        out warnings);
                    //Response.AddHeader("content-disposition", "attachment; filename=NorthWindCustomers." + fileNameExtension);
                    using (FileStream fs = new FileStream(Server.MapPath(strPDFFilePath), FileMode.Create))
                    {
                        fs.Write(renderedBytes, 0, renderedBytes.Length);
                        fs.Close();
                    }
Was it helpful?

Solution

Finally after spending whole day on this i figured out the solution to this issue. and following post helped me alot.

http://wraithnath.blogspot.com/2011/04/reportviewer-prints-extra-blank-pages.html

actually in my report viewer it is clearly noticeable i dragged its width(white area) and that moved beyond the 8.5in standard width and my pdf rendering of this report started showing left side content on first page and right side content having image on second page.

i tried to change that width from property window but it did'nt allow me to change them. yes you need to drag it back and then you will be able to change its width, my suggestion to keep report page property 7.5in or less and gray window area property to width: 8.5in and height: 11in including margins and in this way everything will work perfectly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top