/// <summary> /// EDIT DROP DOWN LIST /// </summary> protected void ddl_edit() { MCImport mc1 = new MCImport(g_user_id, g_lang); System.Data.DataTable dt = new System.Data.DataTable(); DataSet ds = new DataSet(); dt.Columns.Add(new DataColumn("DEPT_NO")); dt.Columns.Add(new DataColumn("DEPT_NAME")); dt.Rows.Add("MC", "MC"); //dt.Rows.Add("MC CKD", "MC CKD"); //dt.Rows.Add("FE", "FE"); //dt.Rows.Add("FE CKD", "FE CKD"); //dt.Rows.Add("KD", "KD"); //dt.Rows.Add("Special Part", "Special Part"); ddlTYPE.DataValueField = "DEPT_NO"; ddlTYPE.DataTextField = "DEPT_NAME"; ddlTYPE.DataSource = dt; ddlTYPE.DataBind(); ds = mc1.GetPickingOrder(); ddlFILE.DataTextField = "HEAD_NO"; ddlFILE.DataValueField = "HEAD_NO"; ddlFILE.DataSource = ds.Tables[0]; ddlFILE.DataBind(); ddlFILE.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ddlFILE.Items.Add(ds.Tables[0].Rows[i]["HEAD_NO"].ToString()); } }
protected void ddlTYPE_SelectedIndexChanged(object sender, EventArgs e) { ComLibrary com = new ComLibrary(); DataSet ds = new DataSet(); MCImport mc1 = new MCImport(g_user_id, g_lang); switch (ddlTYPE.Text.ToString()) { case "MC": ds = mc1.GetPickingOrder(); ddlFILE.DataTextField = "HEAD_NO"; ddlFILE.DataValueField = "HEAD_NO"; ddlFILE.DataSource = ds.Tables[0]; ddlFILE.DataBind(); ddlFILE.Items.Clear(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ddlFILE.Items.Add(ds.Tables[0].Rows[i]["HEAD_NO"].ToString()); } break; } }
protected void cmdPnt_Click(object sender, EventArgs e) { MCImport mc1 = new MCImport(g_user_id, g_lang); Message msg = new Message(g_user_id, g_lang); DataSet dsList = new DataSet(); //Crystal_Report.PickingListRpt pl = new Crystal_Report.PickingListRpt(); dsList = mc1.GetPickingList(); //pl.SetDataSource(dsList); ReportClass Rpt = null; //Rpt = new HondaTraceabilitySystem.Common.Report.FeOnline(); Rpt = new HondaTraceabilitySystem.Crystal_Report.PickingListRpt(); string ReportName = "PickingList"; try { //Rpt.Subreports["SubReport"].SetDataSource(prtDtTotal); Rpt.SetDataSource(dsList.Tables[0]); //Rpt.SetParameterValue("H_TITLE", "INSPECTION SHEET(SEMICONDUCTOR"); PdfRtfWordFormatOptions pdfFormatOpts = new PdfRtfWordFormatOptions(); DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions(); // exportOpts; ExportOptions exportOpts = Rpt.ExportOptions; exportOpts.ExportDestinationType = ExportDestinationType.DiskFile; exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exportOpts.FormatOptions = pdfFormatOpts; string tmpFilenm = ReportName + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf"; diskOpts.DiskFileName = Server.MapPath(WebConfigurationManager.ConnectionStrings["ReportOutDir"].ConnectionString + tmpFilenm); exportOpts.DestinationOptions = diskOpts; //print Rpt.Export(); Type cstype = this.GetType(); this.Page.ClientScript.RegisterClientScriptBlock(cstype, "a", @"<script>window.open('" + WebConfigurationManager.ConnectionStrings["ReportOutDir"].ConnectionString + tmpFilenm + "', '" + ReportName + "', 'status,resizable=yes');</script>"); } catch (Exception ex) { string strErr = ex.ToString(); lblMsg.Text = ex.ToString(); return; } lblMsg.Text = msg.GetMessage("NORMAL_PRINT"); lblMsg.ForeColor = Color.Blue; }