i have generated pdf from a rdlc report by the following code
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;
byte[] bytes = reportViewer1.LocalReport.Render(
"PDF", null, out mimeType, out encoding, out filenameExtension,
out streamids, out warnings);
using (FileStream fs = new FileStream(@"D:\PrintPage.pdf", FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;
byte[] bytes = reportViewer1.LocalReport.Render(
"PDF", null, out mimeType, out encoding, out filenameExtension,
out streamids, out warnings);
using (FileStream fs = new FileStream(@"D:\PrintPage.pdf", FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}
but the pdf is in a full A4 size. i want to generate only in the actual size of rdlc report . what to make for this . how to make page settings for this
Manish Kumar ChoudharyPosted Mar 4, 2015, 2:03 AM
Go through following links it will help you
http://www.aspsnippets.com/Articles/Create-PDF-Report-from-database-in-ASPNet-using-C-and-VBNet.aspx
http://www.aspsnippets.com/Articles/Dynamically-add-and-display-external-Image-in-RDLC-Report-from-code-behind-in-ASPNet.aspx