/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = "SELECT * FROM UV2_Dev_GBJCLRDts WHERE 1=1"; if (SysConvert.ToInt32(drpGBStatusID.EditValue) != 0) { sql += " AND GBStatusID=" + SysString.ToDBString(SysConvert.ToInt32(drpGBStatusID.EditValue)); } sql += " AND MainID=" + SysConvert.ToInt32(HTDataID); DataTable dt = SysUtils.Fill(sql); FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); return(true); }
/// <summary> /// 设计 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void btnDesign_Click(object sender, EventArgs e) { try { //base.btnDesign_Click(sender, e); if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.提交3)) { this.ShowMessage("你没有此操作权限"); return; } if (HTDataID == 0) { this.ShowMessage("请选择要操作的记录"); return; } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 0) { this.ShowMessage("请选择报表模板"); return; } FastReportX.ReportRun(tempReportID, (int)ReportPrintType.设计, new string[] { "ID", "MainID" }, new string[] { HTDataID.ToString(), HTDataID.ToString() }); } catch { } }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); int tempReportID = SysConvert.ToInt32(drpReport.EditValue); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } int ID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID")); if (ID == 0) { this.ShowMessage("请选择需要打印的数据!"); return(false); } string sql = "SELECT * FROM UV1_WH_IOFormDtsInputPack WHERE ID=" + SysString.ToDBString(ID); DataTable dt = SysUtils.Fill(sql); FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); string GBCodeStr = ""; for (int i = 0; i < gridView1.RowCount; i++) { if (SysConvert.ToString(gridView1.GetRowCellValue(i, "GBCode")) != "") { if (GBCodeStr != "") { GBCodeStr += ","; } GBCodeStr += SysString.ToDBString(SysConvert.ToString(gridView1.GetRowCellValue(i, "GBCode"))); } } if (GBCodeStr == "") { this.ShowMessage("没有归还数据"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = "SELECT * FROM UV1_Data_ItemGB WHERE GBCode IN(" + GBCodeStr + ")"; DataTable dt = SysUtils.Fill(sql); dt.Columns.Add("LYFlag", typeof(int)); foreach (DataRow dr in dt.Rows) { sql = "SELECT LYFlag FROM UV1_Dev_GBJCDts WHERE GBCode=" + SysString.ToDBString(dr["GBCode"].ToString()); sql += " AND SubmitFlag=1 "; sql += " AND GBStatusID=" + SysString.ToDBString((int)EnumGBStatus.归还); sql += " ORDER BY GHTime,FormNo DESC "; DataTable dto = SysUtils.Fill(sql); if (dto.Rows.Count > 0) { dr["LYFlag"] = SysConvert.ToInt32(dto.Rows[0][0]); } else { dr["LYFlag"] = 0; } } FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); string GBIDStr = ""; for (int i = 0; i < gridView1.RowCount; i++) { if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "SelectFlag")) == 1) { if (GBIDStr != "") { GBIDStr += ","; } GBIDStr += SysConvert.ToInt32(gridView1.GetRowCellValue(i, "ID")); } } if (GBIDStr == "") { this.ShowMessage("请勾选需要打印的挂板条码"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = "SELECT * FROM Data_Item WHERE ID IN (" + GBIDStr + ")"; DataTable dtSource = SysUtils.Fill(sql); dtSource.Columns.Add(new DataColumn("ERCode", typeof(Image))); //dtSource.Columns.Add(new DataColumn("ERCode2", typeof(Image))); foreach (DataRow dr in dtSource.Rows) { string EWM1 = SysConvert.ToString(dr["ItemCode"]); string MSG = ""; dr["ERCode"] = HTERCode.HTERBarcode.Create(EWM1, 2, 0, "", out MSG); } FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dtSource); return(true); }
bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); string BoxIDStr = ""; for (int i = 0; i < gridView1.RowCount; i++) { if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "SelectFlag")) == 1) { if (BoxIDStr != "") { BoxIDStr += ","; } BoxIDStr += SysConvert.ToInt32(gridView1.GetRowCellValue(i, "ID")); } } if (BoxIDStr == "") { this.ShowMessage("请勾选需要打印的挂板条码"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = "SELECT * FROM UV1_WH_PackBox WHERE ID IN (" + BoxIDStr + ")"; DataTable dtSource = SysUtils.Fill(sql); FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dtSource); //FastReportX.ReportRun(tempReportID, p_ReportPrintType, new string[] { "ID" }, new string[] { BoxIDStr }); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); if (HTDataID == 0) { this.ShowMessage("请先保存数据后打印"); return(false); } string IDStr = ""; for (int i = 0; i < gridView1.RowCount; i++) { if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "JYFlag")) == 1) { if (IDStr != "") { IDStr += ","; } IDStr += SysConvert.ToInt32(gridView1.GetRowCellValue(i, "DtsID")); } } if (IDStr == "") { this.ShowMessage("没有留样需要打印"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } FastReportX.ReportRun(tempReportID, p_ReportPrintType, new string[] { "ID" }, new string[] { IDStr }); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); string GBIDStr = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID")); if (GBIDStr == "") { this.ShowMessage("请选择需要打印的条码"); return(false); } //DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); //if (ci.SelectedItem == null) //{ // this.ShowMessage("请选择报表模板"); // return false; //} //int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); int tempReportID = SysConvert.ToInt32(drpReport.EditValue); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } //2012/9/18 CJH 测试传入数据表代码 string sql = "SELECT * FROM UV1_WH_IOFormDtsPack WHERE DtsPackID IN(" + GBIDStr + ")"; DataTable dt = SysUtils.Fill(sql); dt.TableName = "Dts"; FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); //FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, new DataTable[] { dt }); //2012/9/18CJH 为了测试传入数据表打印报表而进行注释 //FastReportX.ReportRun(tempReportID, p_ReportPrintType, new string[] { "ID" }, new string[] { GBIDStr }); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } IOFormRule rule = new IOFormRule(); DataTable dt = rule.RShowDts(HTDataConditionStr, "*"); SetGrid(dt); DataTable dtnew = dt.Clone(); if (gridView1.RowFilter != string.Empty) { DataRow[] rows = dt.Select(gridView1.RowFilter); foreach (DataRow row in rows) { dtnew.ImportRow(row); } } else { dtnew = dt; } FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dtnew); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); if (HTDataID == 0) { this.ShowMessage("请保存面料后打印"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = "SELECT * FROM Data_Item WHERE ID = " + SysString.ToDBString(HTDataID); DataTable dtSource = SysUtils.Fill(sql); dtSource.Columns.Add(new DataColumn("ERCode", typeof(Image))); foreach (DataRow dr in dtSource.Rows) { string EWM1 = SysConvert.ToString(dr["ItemCode"]); string MSG = ""; dr["ERCode"] = HTERCode.HTERBarcode.Create(EWM1, 2, 0, "", out MSG); } FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dtSource); return(true); }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } DataTable dt = (DataTable)gridView1.GridControl.DataSource; FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); return(true); }
/// <summary> /// 浏览 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void btnPreview_Click(object sender, EventArgs e) { try { //base.btnPreview_Click(sender, e); if (HTDataID == 0) { this.ShowMessage("请选择要操作的记录"); return; } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 0) { this.ShowMessage("请选择报表模板"); return; } FastReportX.ReportRun(tempReportID, (int)ReportPrintType.预览, new string[] { "ID", "MainID" }, new string[] { HTDataID.ToString(), HTDataID.ToString() }); } catch { } }
/// <summary> /// 打印共用条码 /// </summary> /// <returns></returns> bool btnPrintAbount(int p_ReportPrintType) { this.BaseFocusLabel.Focus(); string GBIDStr = ""; for (int i = 0; i < gridView1.RowCount; i++) { if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "SelectFlag")) == 1) { if (GBIDStr != "") { GBIDStr += ","; } if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5014)))//面料定义界面不要显示原料信息管理内容 { GBIDStr += SysConvert.ToInt32(gridView1.GetRowCellValue(i, "ID")); } else { GBIDStr += SysConvert.ToInt32(gridView1.GetRowCellValue(i, "DtsID")); } } } if (GBIDStr == "") { this.ShowMessage("请勾选需要打印的挂板条码"); return(false); } DevComponents.DotNetBar.ComboBoxItem ci = this.ToolBarCItemGet(-1, ToolButtonName.drpPrintFile.ToString()); if (ci.SelectedItem == null) { this.ShowMessage("请选择报表模板"); return(false); } int tempReportID = SysConvert.ToInt32(((DevComponents.Editors.ComboItem)ci.SelectedItem).Tag); if (tempReportID == 1) { this.ShowMessage("请选择报表模板"); return(false); } string sql = ""; if (SysConvert.ToBoolean(ProductParamSet.GetIntValueByID(5014)))//面料定义界面不要显示原料信息管理内容 { sql = "SELECT * FROM UV1_Data_ItemGB WHERE ID IN (" + GBIDStr + ")"; } else { sql = "SELECT * FROM UV1_Data_ItemGB WHERE DtsID IN (" + GBIDStr + ")"; } DataTable dt = SysUtils.Fill(sql); dt.Columns.Add("TableTitle", typeof(string)); foreach (DataRow dr in dt.Rows) { dr["TableTitle"] = txtTableTitle.Text.Trim(); } FastReportX.ReportRunTable(tempReportID, p_ReportPrintType, dt); //FastReportX.ReportRun(tempReportID, p_ReportPrintType, new string[] { "ID" }, new string[] { GBIDStr }); return(true); }