Click here to Skip to main content
12,395,645 members (63,127 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
hi

Im using report viewer to to create a report in my application it creates perfectly and fits snuggly in one page but when i convert it to pdf and email it, it gets spread over 4 pages when viewed by a client who's recieving it.

Warning[] warnings;
            string[] streamids;
            string mimeType;
            string encoding;
            string extension;
            byte[] bytes =ReportViewer1.LocalReport.Render("PDF", null, out mimeType,
            out encoding, out extension, out streamids, out warnings); //converting into pdf
            MemoryStream s = new MemoryStream(bytes);
            //s.Seek(0, SeekOrigin.Begin);
            Attachment att = new Attachment(s, file);
            SmtpClient smtp = new SmtpClient("pod51014.outlook.com");
            MailMessage msg = new MailMessage();
            msg.Subject = "Invoice Report";
            msg.From = new MailAddress ("209@dut4life.ac.za");
            msg.To.Add(get_Email());
            msg.Attachments.Add(att);
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            smtp.EnableSsl = true;
            smtp.Credentials = new System.Net.NetworkCredential("209@dut4life.ac.za", "Dut920925");
            smtp.Port = 587;
            smtp.Send(msg);
I suspect that it gets ruined during my conversion to pdf

thanks in advance regards
Posted 28-Sep-12 12:05pm
Comments
Richard MacCutchan 29-Sep-12 5:13am
   
I suspect that it gets ruined during my conversion to pdf
And exactly how are we supposed to guess what happens during this conversion? Please edit your question and show the information relevant to your question rather than the code that sends the email.
CloudWebi 29-Sep-12 6:53am
   
You might want to change the password of that email right about now.
Is this sql report or crystal report?
mlingo209 29-Sep-12 11:14am
   
I thought this "byte[] bytes =ReportViewer1.LocalReport.Render("PDF", null, out mimeType,
out encoding, out extension, out streamids, out warnings);" Is where it gets converted I'm sorry this is copy and paste, lmao the Passwords is correct its the username that is totally off hahahah and yeah I think it is sql reports it uses controls found within the Visual Studio 2012

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100