Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Warning[] warnings;
           string[] streamIds;
           string mimeType = string.Empty;
           string encoding = string.Empty;
           string extension = string.Empty;
           String deviceInfo =
               "<DeviceInfo>" +
               "  <OutputFormat>JPEG</OutputFormat>" +
               "  <PageWidth>2.16in</PageWidth>" +
               "  <PageHeight>3.41in</PageHeight>" +
               "  <DpiX>300</DpiX>" +
               "  <DpiY>300</DpiY>" +
               "  <MarginTop>0in</MarginTop>" +
               "  <MarginLeft>0in</MarginLeft>" +
               "  <MarginRight>0in</MarginRight>" +
               "  <MarginBottom>0in</MarginBottom>" +
               "</DeviceInfo>";

           LocalReport Report = new LocalReport();
           Report.ReportPath = Path.GetFullPath(@"..\..\Report\ReportFront.rdlc");
           ReportDataSource QMRDS = new ReportDataSource("ICard_USP_EmployeeMaster_SelectAll", dt);
           Report.DataSources.Add(QMRDS);
           Byte[] mybytes = Report.Render("Image", deviceInfo, out mimeType, out encoding, out extension, out streamIds, out warnings);
           using (FileStream fs = new FileStream(Application.StartupPath + @"\Print\" + dt.Rows[0]["Id"].ToString() + "_" + dt.Rows[0]["PId"].ToString() + "_" + "Front.jpg", FileMode.Create))
           {
               fs.Write(mybytes, 0, mybytes.Length);
               fs.Flush();
               fs.Dispose();
               fs.Close();
           }
Posted
Comments
thatraja 3-Feb-14 5:23am    
What's the problem? any error? show.

1 solution

you can refer below link for more idea on this

how-to-convert-the-report-to-an-image[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900