rdlc报告转换为jpg [英] rdlc Report to jpg Convert

查看:82
本文介绍了rdlc报告转换为jpg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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();
           }

推荐答案

你可以参考下面的链接了解更多的想法



如何将报告转换为-an-image [ ^ ]
you can refer below link for more idea on this

how-to-convert-the-report-to-an-image[^]


这篇关于rdlc报告转换为jpg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆