Esempio n. 1
0
    /// <summary>
    /// 未列印門市檢查
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUnpringCheck_Click(object sender, EventArgs e)
    {

        try
        {
            ErrorMsgLabel.Text = "";
            this.hid_PageStatus.Value = "PRINT";

            CGDModel.CGD25_BCO BCO = new PIC.VDS2G.LGT.CGD.CGD25_BCO(ConntionDB);

            DataTable Dt;
            ParameterList.Clear();

            ParameterList.Add(slpStAcceptDate.Text.Trim());//1 門市進貨日

            Dt = BCO.CheckRouteStore(ParameterList);

            if (Dt.Rows.Count == 0)
            {
                this.hid_PageStatus.Value = "QUERY";
                this.CrystalReportViewer1.Visible = false;
                ErrorMsgLabel.Text = "查無資料";
                //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD251.aspx", "alert(' 查無資料 ');", true);

                return;
            }
            else
            {
                #region 顯示報表

                string s_FileName = "";      //設定輸出檔名
                string s_rptFilePath = "";   //設定報表路徑

                s_rptFilePath = Server.MapPath("./REPORT/CGD251R02.rpt");
                s_FileName = HttpUtility.UrlEncode("未列印門市進貨單路線.PDF", System.Text.Encoding.UTF8);


                LoadCrystalReport(s_FileName, s_rptFilePath, Dt, "PDF", "2");

                #endregion

                //ShowUnprintReport(Dt);
            }

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }