本文整理汇总了C#中VNS.Libs.frmPrintPreview类的典型用法代码示例。如果您正苦于以下问题:C# frmPrintPreview类的具体用法?C# frmPrintPreview怎么用?C# frmPrintPreview使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
frmPrintPreview类属于VNS.Libs命名空间,在下文中一共展示了frmPrintPreview类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Baocaohuychot
public static void Baocaohuychot(DataTable m_dtReport, string kieuthuoc_vt, string sTitleReport, string dieukienbaocao, bool theonhom)
{
string tieude = "", reportname = "", reportcode = "thuoc_baocao_huychot_theonhom";
ReportDocument crpt = null;
if (kieuthuoc_vt .Contains("THUOC"))
{
if (theonhom)
{
reportcode = "thuoc_baocao_huychot_theonhom";
}
else
{
reportcode = "thuoc_baocao_huychot";
}
}
else//VTTH
{
if (theonhom)
{
reportcode = "vt_baocao_huychot_theonhom";
}
else
{
reportcode = "vt_baocao_huychot";
}
}
crpt = Utility.GetReport(reportcode, ref tieude, ref reportname);
if (crpt == null) return;
MoneyByLetter _moneyByLetter = new MoneyByLetter();
var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = reportcode;
Utility.UpdateLogotoDatatable(ref m_dtReport);
try
{
if (theonhom)
m_dtReport.DefaultView.Sort = "stt_hthi_nhom,tenbietduoc";
else
m_dtReport.DefaultView.Sort = "tenbietduoc";
m_dtReport.AcceptChanges();
crpt.SetDataSource(m_dtReport.DefaultView);
Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt, "dieukienbaocao", dieukienbaocao);
Utility.SetParameterValue(crpt, "sTitleReport", tieude);
Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
Utility.SetParameterValue(crpt, "txttrinhky","");
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
// Utility.DefaultNow(this);
}
catch (Exception ex)
{
Utility.CatchException(ex);
}
}
示例2: Inphieunhapvien
public static void Inphieunhapvien(DataTable m_dtReport, string sTitleReport, DateTime NgayIn)
{
string tieude = "", reportname = "";
var crpt = Utility.GetReport("noitru_phieunhapvien", ref tieude, ref reportname);
if (crpt == null) return;
THU_VIEN_CHUNG.CreateXML(m_dtReport, "noitru_phieunhapvien.xml");
MoneyByLetter _moneyByLetter = new MoneyByLetter();
var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
// string tinhtong = TinhTong(m_dtReport);
Utility.UpdateLogotoDatatable(ref m_dtReport);
try
{
crpt.SetDataSource(m_dtReport);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = "noitru_phieunhapvien";
Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
Utility.SetParameterValue(crpt,"sTitleReport", tieude);
Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
catch (Exception ex)
{
if (globalVariables.IsAdmin)
{
Utility.ShowMsg(ex.ToString());
}
}
}
示例3: btnPrint_Click
private void btnPrint_Click(object sender, EventArgs e)
{
try
{
string s ="";
if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
{
s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy"));
}
else
{
s = string.Format("{0}{1}", s,
string.Format("Thời gian từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"),
dtpToDate.Value.ToString("dd/MM/yyyy")));
}
var crpt = new Crp_DSBN_TestType();
var oForm = new frmPrintPreview("In Báo cáo lưu", crpt, true, true);
crpt.SetDataSource(dt);
crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count);
crpt.SetParameterValue("TestType_Name",cboTestType.Text.ToUpper());
crpt.SetParameterValue("strFromDateToDate", s);
crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
crpt.SetParameterValue("sCurrentDate", dtCreatePrint.Value);
oForm.crptViewer.ReportSource = crpt;
oForm.ShowDialog();
oForm.Dispose();
}
catch (Exception ex)
{
Utility.ShowMsg(ex.Message);
}
}
示例4: btnPrint_Click
private void btnPrint_Click(object sender, EventArgs e)
{
try
{
ReportDocument crpt;
string s;
if (cboTestType.SelectedValue.ToString() == "-1")
{
s = "TẤT CẢ CÁC LOẠI XÉT NGHIỆM";
}
else
{
s = string.Format("XÉT NGHIỆM {0}", cboTestType.SelectedText.ToUpper());
}
var ds =
SPs.SpBaoCaoXoaKetQua(dtpFromDate.Value.ToString("yyyy/MM/dd"),
dtpToDate.Value.ToString("yyyy/MM/dd"),
Utility.Int32Dbnull(cboTestType.SelectedValue, -1),
Utility.sDbnull(cboUserName.SelectedValue, "")).GetDataSet();
if (cboReportType.SelectedIndex == 1)
{
crpt = new crpt_BAOCAO_XOA_KETQUA_TONGHOP();
dt = ds.Tables[0];
}
else
{
crpt = new crpt_BAOCAO_SUAXOA_KETQUA_CHITIET();
dt = ds.Tables[1];
}
if (dt.Rows.Count <= 0)
{
Utility.ShowMsg("Không có dữ liệu để báo cáo");
}
else
{
var oForm = new frmPrintPreview("In báo cáo sửa xóa", crpt, true, true);
crpt.SetDataSource(dt);
crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
//crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count);
crpt.SetParameterValue("TestType_Name", s);
crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
//crpt.SetParameterValue("sCurrentDate", dtpDatePrintFrom.Value);
oForm.crptViewer.ReportSource = crpt;
oForm.ShowDialog();
oForm.Dispose();
}
}
catch (Exception ex)
{
Utility.ShowMsg(ex.Message);
}
}
示例5: cmdPrint_Click
private void cmdPrint_Click(object sender, EventArgs e)
{
try
{
LayDuLieu();
if (dt.Rows.Count<=0 || dtRawResult == null)
{
Utility.ShowMsg("Không có dữ liệu để báo cáo");
}
else
{
string s = "";
if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
{
s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy"));
}
else
{
s = string.Format("{0}{1}", s,
string.Format("Từ ngày {0} đến ngày {1}",
dtpFromDate.Value.ToString("dd/MM/yyyy"),
dtpToDate.Value.ToString("dd/MM/yyyy")));
}
var crpt = new VD_crpt_DailyParamTestReport();
var oForm = new frmPrintPreview("In Báo cáo lưu", crpt, true, true);
crpt.SetDataSource(dt);
crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
crpt.SetParameterValue("sFromDateToDate", s);
crpt.SetParameterValue("TongSoBenhNhan", dt.Rows.Count);
crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
crpt.SetParameterValue("sPrintDate", dtpDatePrint.Value.ToString("dd/MM/yyyy"));
oForm.crptViewer.ReportSource = crpt;
oForm.ShowDialog();
oForm.Dispose();
}
}
catch (Exception ex)
{
Utility.ShowMsg("Lỗi" + ex, "Thông Báo", MessageBoxIcon.Warning);
}
}
示例6: InphieuDieuTri
public static void InphieuDieuTri(DataTable dtPrint, DateTime ngayin)
{
string tieude = "", reportname = "";
var crpt = Utility.GetReport("noitru_phieudieutri", ref tieude, ref reportname);
if (crpt == null) return;
//var crpt = new crpt_PhieuDieuTri();
var objForm = new frmPrintPreview("IN PHIẾU ĐIỀU TRỊ", crpt, true, true);
crpt.SetDataSource(dtPrint);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = "noitru_phieudieutri";
Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(ngayin));
Utility.SetParameterValue(crpt,"sTitleReport", tieude);
Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
objForm.Dispose();
}
示例7: InphieuHuythuoc
public static void InphieuHuythuoc(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
{
DataTable m_dtReport = SPs.ThuocLaythongtininphieuXuatkhothuoc(IDPhieuNhap).GetDataSet().Tables[0];
if (m_dtReport.Rows.Count <= 0)
{
Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
return;
}
MoneyByLetter _moneyByLetter = new MoneyByLetter();
string tinhtong = TinhTong(m_dtReport, TPhieuNhapxuatthuocChitiet.ThanhTienColumn.ColumnName);
THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_bienban_huythuoc");
string tieude = "", reportname = "";
var crpt = Utility.GetReport("thuoc_bienban_huythuoc", ref tieude, ref reportname);
Utility.UpdateLogotoDatatable(ref m_dtReport);
var objForm = new frmPrintPreview(sTitleReport, crpt, true, true);
try
{
m_dtReport.AcceptChanges();
crpt.SetDataSource(m_dtReport);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = "thuoc_bienban_huythuoc";
Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
Utility.SetParameterValue(crpt,"sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
Utility.SetParameterValue(crpt,"sTitleReport", tieude);
Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
catch (Exception ex)
{
if (globalVariables.IsAdmin)
{
Utility.ShowMsg(ex.ToString());
}
}
}
示例8: cmdINPHIEU_Click
private void cmdINPHIEU_Click(object sender, EventArgs e)
{
try
{
string s = "";
if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
{
s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy"));
}
else
{
s = string.Format("{0}{1}", s,
string.Format("Từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"),
dtpToDate.Value.ToString("dd/MM/yyyy")));
}
dtSoghichep = BaocaoSoghichep(dtpFromDate.Value,dtpToDate.Value).GetDataSet().Tables[0];
int totalBN = dtSoghichep.Rows.Count;
if (dtSoghichep.Rows.Count <= 0)
{
Utility.ShowMsg("Không có dữ liệu để in");
}
else
{
var crpt = new crpt_SoGhiChep();
var objForm = new frmPrintPreview("In Báo Cáo", crpt, true, true);
crpt.SetDataSource(dtSoghichep);
crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
crpt.SetParameterValue("TestDate",s);
crpt.SetParameterValue("PrintDate",dtpPrintDate.Value);
crpt.SetParameterValue("TotalBN", totalBN);
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
}
catch (Exception exception)
{
Utility.ShowMsg("Lỗi trong quá trình xuất báo cáo" + exception);
}
}
示例9: cmdINPHIEU_Click
private void cmdINPHIEU_Click(object sender, EventArgs e)
{
try
{
dtPatient = SPs.BaocaoSluongXetnghiemTheodoituong(dtpFromDate.Value.Date, dtpToDate.Value.Date).GetDataSet().Tables[0];
if (dtPatient.Rows.Count < 0)
{
Utility.ShowMsg("Không có dữ liệu để in");
}
else
{
string s = "";
s = string.Format("{0}{1}", s,
string.Format("Từ ngày {0} đến ngày {1}",
dtpFromDate.Value.ToString("dd/MM/yyyy"),
dtpToDate.Value.ToString("dd/MM/yyyy")));
Utility.UpdateLogotoDatatable(ref dtPatient);
CRPT_GTVT_BAOCAO_SLUONG_BNHAN_THEODOITUONG crpt = new CRPT_GTVT_BAOCAO_SLUONG_BNHAN_THEODOITUONG();
var objForm = new frmPrintPreview("In Báo Cáo", crpt, true, true);
crpt.SetDataSource(dtPatient);
crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
crpt.SetParameterValue("sTitleReport", label7.Text);
crpt.SetParameterValue("sTuNgayDenNgay", s);
crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTime(dtNgayInPhieu.Value));
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
Utility.DefaultNow(this);
}
}
catch (Exception ex)
{
Utility.ShowMsg(ex.ToString());
}
}
示例10: InphieuDutru
public static void InphieuDutru(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
{
DataTable m_dtReport = SPs.ThuocLaydulieuinphieuchuyenkho2lien(IDPhieuNhap).GetDataSet().Tables[0];
if (m_dtReport.Rows.Count <= 0)
{
Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
return;
}
THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_phieudutru");
string tieude = "", reportname = "";
var crpt = Utility.GetReport("thuoc_phieudutru", ref tieude, ref reportname);
Utility.UpdateLogotoDatatable(ref m_dtReport);
frmPrintPreview objForm = new frmPrintPreview(sTitleReport, crpt, true, true);
try
{
m_dtReport.AcceptChanges();
crpt.SetDataSource(m_dtReport);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = "thuoc_phieudutru";
Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
Utility.SetParameterValue(crpt,"sTitleReport", tieude);
Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
catch (Exception ex)
{
if (globalVariables.IsAdmin)
{
Utility.ShowMsg(ex.ToString());
}
}
}
示例11: KYDONG_INPHIEU_DICHVU
public void KYDONG_INPHIEU_DICHVU(DataTable m_dtReportPhieuThu, DateTime NgayInPhieu, string sTitleReport,string khogiay)
{
Utility.UpdateLogotoDatatable(ref m_dtReportPhieuThu);
ReportDocument reportDocument = new ReportDocument();
string tieude="", reportname = "";
switch (khogiay)
{
case "A4":
reportDocument = Utility.GetReport("thanhtoan_Bienlai_Dichvu_A4" ,ref tieude,ref reportname);
break;
case "A5":
reportDocument = Utility.GetReport("thanhtoan_13" ,ref tieude,ref reportname);
break;
}
if (reportDocument == null) return;
var crpt = reportDocument;
decimal tong = m_dtReportPhieuThu.AsEnumerable().Sum(c => c.Field<decimal>("TONG_BN"));
var objForm = new frmPrintPreview("", crpt, true, true);
//try
//{
crpt.SetDataSource(m_dtReportPhieuThu);
//crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + " ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"Telephone", globalVariables.Branch_Phone);
Utility.SetParameterValue(crpt,"Address", globalVariables.Branch_Address);
// Utility.SetParameterValue(crpt,"DateTime", Utility.FormatDateTime(dtCreateDate.Value));
Utility.SetParameterValue(crpt,"CurrentDate", Utility.FormatDateTime(NgayInPhieu));
Utility.SetParameterValue(crpt,"sTitleReport", sTitleReport);
Utility.SetParameterValue(crpt,"sMoneyCharacter",
new MoneyByLetter().sMoneyToLetter(Utility.sDbnull(tong)));
Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
示例12: InPhieuKCB_DV
public static void InPhieuKCB_DV(DataTable m_dtReport, string sTitleReport,string KhoGiay)
{
ReportDocument reportDocument=new ReportDocument();
string tieude="", reportname = "";
switch (KhoGiay)
{
case "A4":
reportDocument =Utility.GetReport("tiepdon_PhieuKCB_Dvu_A4",ref tieude,ref reportname);
break;
case "A5":
reportDocument = Utility.GetReport("tiepdon_PhieuKCB_Dvu_A5" ,ref tieude,ref reportname);
break;
}
if (reportDocument == null) return;
var crpt = reportDocument;
var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
try
{
m_dtReport.AcceptChanges();
crpt.SetDataSource(m_dtReport);
//crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + " PHÒNG TIẾP ĐÓN ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
Utility.SetParameterValue(crpt,"Phone", globalVariables.Branch_Phone + globalVariables.SOMAYLE);
Utility.SetParameterValue(crpt,"Address", globalVariables.Branch_Address);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"CurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
Utility.SetParameterValue(crpt,"sTitleReport", sTitleReport);
Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInPhieuKCB, PropertyLib._MayInProperties.PreviewPhieuKCB))
{
objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInPhieuKCB, 0);
objForm.ShowDialog();
}
else
{
objForm.addTrinhKy_OnFormLoad();
crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInPhieuKCB;
crpt.PrintToPrinter(1, false, 0, 0);
}
}
catch (Exception ex)
{
Utility.ShowMsg(ex.ToString());
}
}
示例13: InPhieuKCB
private void InPhieuKCB()
{
try
{
int IdKham = -1;
string tieude="", reportname = "";
ReportDocument crpt = Utility.GetReport("tiepdon_PHIEUKHAM_NHIET",ref tieude,ref reportname);
if (crpt == null) return;
var objPrint = new frmPrintPreview("IN PHIẾU KHÁM", crpt, true, true);
IdKham = GetrealRegID();
KcbDangkyKcb objRegExam = KcbDangkyKcb.FetchByID(IdKham);
DmucKhoaphong lDepartment = DmucKhoaphong.FetchByID(objRegExam.IdPhongkham);
Utility.SetParameterValue(crpt,"PHONGKHAM", Utility.sDbnull(lDepartment.MaKhoaphong));
Utility.SetParameterValue(crpt,"STT", Utility.sDbnull(objRegExam.SttKham, ""));
Utility.SetParameterValue(crpt,"BENHAN", Utility.sDbnull(grdList.CurrentRow.Cells[KcbLuotkham.Columns.MaLuotkham].Value, ""));
Utility.SetParameterValue(crpt,"TENBN", Utility.sDbnull(grdList.CurrentRow.Cells[KcbDanhsachBenhnhan.Columns.TenBenhnhan].Value, ""));
Utility.SetParameterValue(crpt,"GT_TUOI", Utility.sDbnull(grdList.CurrentRow.Cells[KcbDanhsachBenhnhan.Columns.GioiTinh].Value, "") + ", " + Utility.sDbnull(grdList.CurrentRow.Cells["Tuoi"].Value, "") + " tuổi");
string SOTHE = "Không có thẻ";
SOTHE = Utility.sDbnull(grdList.CurrentRow.Cells[KcbLuotkham.Columns.MatheBhyt].Value, "Không có thẻ");
Utility.SetParameterValue(crpt,"SOTHE", SOTHE);
if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInPhieuKCB, PropertyLib._MayInProperties.PreviewPhieuKCB))
objPrint.ShowDialog();
else
{
crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInPhieuKCB;
crpt.PrintToPrinter(1, false, 0, 0);
}
}
catch (Exception ex)
{
Utility.ShowMsg("Có lỗi trong quá trình in phiếu khám-->\n" + ex.Message);
}
}
示例14: PrintPhieuThu_DM
/// <summary>
/// hàm thực hiện việc in phieus thu của dệt may
/// </summary>
/// <param name="sTitleReport"></param>
private void PrintPhieuThu_DM(string sTitleReport,decimal TONG_TIEN)
{
Utility.WaitNow(this);
string tieude="", reportname = "";
var crpt = Utility.GetReport("thanhtoan_PhieuThu_DM",ref tieude,ref reportname);
if (crpt == null) return;
var objForm = new frmPrintPreview("", crpt, true, true);
try
{
crpt.SetDataSource(m_dtReportPhieuThu);
// //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + " Nhân viên ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt,"DateTime", Utility.FormatDateTime(globalVariables.SysDate));
Utility.SetParameterValue(crpt,"CurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
Utility.SetParameterValue(crpt,"sTitleReport", sTitleReport);
Utility.SetParameterValue(crpt,"CharacterMoney", new MoneyByLetter().sMoneyToLetter(TONG_TIEN.ToString()));
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
Utility.DefaultNow(this);
}
catch (Exception ex)
{
Utility.DefaultNow(this);
}
}
示例15: cmdInPhieuXN_Click
/// <summary>
/// hàm thực hiện việc in phiếu báo cáo tổng hợp
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cmdInPhieuXN_Click(object sender, EventArgs e)
{
_dtData =BAOCAO_NGOAITRU.BaocaoMiengiam(Utility.Int16Dbnull(txtNhanvien.MyID,-1),chkByDate.Checked?dtFromDate.Value.ToString("dd/MM/yyyy"):"01/01/1900",
chkByDate.Checked?dtToDate.Value.ToString("dd/MM/yyyy"):"01/01/1900");
Utility.SetDataSourceForDataGridEx(grdList, _dtData, false, true, "1=1", "");
Utility.UpdateLogotoDatatable(ref _dtData);
THU_VIEN_CHUNG.CreateXML(_dtData, "baocao_miengiam.xml");
if (_dtData.Rows.Count <= 0)
{
Utility.ShowMsg("Không tìm thấy dữ liệu báo cáo theo điều kiện bạn chọn", "Thông báo", MessageBoxIcon.Information);
return;
}
string Condition = string.Format("Từ ngày {0} đến {1} - Thu ngân viên :{2} ", dtFromDate.Text, dtToDate.Text,txtNhanvien.Text);
var crpt = Utility.GetReport("baocao_miengiam", ref tieude, ref reportname);
if (crpt == null) return;
string StaffName = globalVariables.gv_strTenNhanvien;
if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) StaffName = globalVariables.UserName;
try
{
frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, _dtData.Rows.Count <= 0 ? false : true);
//try
//{
crpt.SetDataSource(_dtData);
objForm.mv_sReportFileName = Path.GetFileName(reportname);
objForm.mv_sReportCode = "baocao_miengiam";
Utility.SetParameterValue(crpt,"StaffName", StaffName);
Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
Utility.SetParameterValue(crpt, "FromDateToDate", Condition);
Utility.SetParameterValue(crpt, "sTitleReport", tieude);
Utility.SetParameterValue(crpt, "Tongtien_chu", new MoneyByLetter().sMoneyToLetter(_dtData.Compute("SUM(tongtien_chietkhau)", "1=1").ToString()));
Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value));
Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
objForm.crptViewer.ReportSource = crpt;
objForm.ShowDialog();
}
catch (Exception ex)
{
Utility.CatchException(ex);
}
}