none
Export to Excel result in incorrect page size RRS feed

  • Question

  • I have my report .rdlc body size 25cmx38cm which is smaller than the page size.
    and the page size 29.7cmX42cm which is A4 size.

    everything is correct with export to pdf.
    but the export to excel result in page size A3.

    What is causing the difference?
    Friday, September 4, 2009 10:04 AM

All replies

  • I mean, A4 in my design, A3 in Excel, A4 in Pdf.
    Here is the code that I render my report.

    protected void btn_printXls_Click(object sender, EventArgs e)
            {
                Warning[] warnings;
                string[] streamids;
                string mimeType;
                string encoding;
                string extension;
    
                //export to excel
                byte[] l_reportBytes = rv_waterLicenseReport.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);
                Response.ClearContent();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + "ApplicationForm" + tb_LicenseNo.Text.Trim() + ".xls");
                Response.AddHeader("Accept-Header", l_reportBytes.Length.ToString());
                Response.ContentType = "application/vnd.ms-excel";
    
                Response.OutputStream.Write(l_reportBytes, 0, l_reportBytes.Length);
                Response.Flush();
                Response.Close();
            }
    
            protected void btn_printPdf_Click(object sender, EventArgs e)
            {
                Warning[] warnings;
                string[] streamids;
                string mimeType;
                string encoding;
                string extension;
    
                //export to pdf
                byte[] l_reportBytes = rv_waterLicenseReport.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
                Response.ClearContent();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + "ApplicationForm" + tb_LicenseNo.Text.Trim() + ".pdf");
                Response.AddHeader("Accept-Header", l_reportBytes.Length.ToString());
                Response.ContentType = "application/pdf";
    
                Response.OutputStream.Write(l_reportBytes, 0, l_reportBytes.Length);
                Response.Flush();
                Response.Close();
            }
    Monday, September 7, 2009 1:39 AM