Beispiel #1
0
        /// <summary>
        /// 列印傳票(試作)
        /// </summary>
        public ActionResult PrintSampleTicket2()
        {
            //# 準備資料來源
            //rw.Add(new ReportParameter("stampUnit", "中和二分行"));
            //rw.Add(new ReportParameter("stampDate", "NOV 12 2018"));
            //rw.Add(new ReportParameter("stampStaff", "高某某"));

            string emptyStampPath = Server.MapPath("~/images/scb_stamp.png");

            byte[] imgBlob = ReportDemoBiz.MakeTimestampBlob(emptyStampPath, "中和二分行", "NOV 11 2018", "高某某");

            // 準備 Images 資料來源
            ReportDataSet.ImagesDataTable imgTable = new ReportDataSet.ImagesDataTable();
            var nr = imgTable.NewImagesRow();

            imgTable.AddImagesRow(1, imgBlob, null, null);
            imgTable.AcceptChanges();

            //------------------------------
            //# Set report info
            ReportWrapper rw = new ReportWrapper();

            rw.ReportPath = Server.MapPath("~/Report/rdlc/SampleTicket2.rdlc");
            rw.Add(new ReportParameter("param1", "103 / 11 / 08 15 : 30"));
            rw.Add(new ReportParameter("param2", "103110813572240001"));
            rw.Add(new ReportParameter("param3", "台幣帳戶存款"));
            rw.Add(new ReportParameter("param4", "USD 1,000"));
            rw.Add(new ReportParameter("param5", "29.594"));
            rw.Add(new ReportParameter("param6", "TWD 29,594"));
            rw.Add(new ReportParameter("param7", "0312XXXXXXX219 - TWD"));
            rw.Add(new ReportParameter("param8", "王某某"));
            rw.Add(new ReportParameter("param9", "1357224 - 7654321 - 陳某某"));

            //# 加入資料來源
            // 加入圖片
            rw.Add(new ReportDataSource("Images", (DataTable)imgTable));

            //# Pass report info via session & Go report viewer page
            Session["ReportWrapper"] = rw;
            return(Redirect("~/Report/ReportViewer.aspx"));
        }
Beispiel #2
0
        /// <summary>
        /// 列印傳票(試作)
        /// </summary>
        public ActionResult PrintSampleTicket()
        {
            //# 準備資料來源
            byte[] imgBlob = ReportDemoBiz.MakeQRCodeBlob(@"測試http://www.asiavista.com.tw/aaaaa/bbbbb?ccccc=ddddd&eeeee=fffff&ggggg=hhhhhiiiiijjjjjkkkkklllllmmmmm");

            // 準備 Images 資料來源
            ReportDataSet.ImagesDataTable imgTable = new ReportDataSet.ImagesDataTable();
            var nr = imgTable.NewImagesRow();

            imgTable.AddImagesRow(1, imgBlob, null, null);
            imgTable.AcceptChanges();

            //------------------------------
            //# Set report info
            ReportWrapper rw = new ReportWrapper();

            rw.ReportPath = Server.MapPath("~/Report/rdlc/SampleTicket.rdlc");
            rw.Add(new ReportParameter("param1", "103 / 11 / 08 15 : 30"));
            rw.Add(new ReportParameter("param2", "103110813572240001"));
            rw.Add(new ReportParameter("param3", "台幣帳戶存款"));
            rw.Add(new ReportParameter("param4", "USD 1,000"));
            rw.Add(new ReportParameter("param5", "29.594"));
            rw.Add(new ReportParameter("param6", "TWD 29,594"));
            rw.Add(new ReportParameter("param7", "0312XXXXXXX219 - TWD"));
            rw.Add(new ReportParameter("param8", "王某某"));
            rw.Add(new ReportParameter("param9", "1357224 - 7654321 - 陳某某"));
            rw.Add(new ReportParameter("param10", ""));

            //# 加入資料來源
            // 加入圖片
            rw.Add(new ReportDataSource("Images", (DataTable)imgTable));

            //# Pass report info via session & Go report viewer page
            Session["ReportWrapper"] = rw;
            return(Redirect("~/Report/ReportViewer.aspx"));
        }