private void ExportGridReport(GridppReport report, GRExportType exportType, string Title, string FileName) { DateTime StartTime = DateTime.Now; string msg = Pub.GetResText("", "MsgExportingData", ""); msg = string.Format(msg, Title); if (File.Exists(FileName)) { File.Delete(FileName); } if (report.DetailGrid != null) { if (report.ColumnByName("CheckBox") != null) { report.ColumnByName("CheckBox").Visible = false; } } bool ret = report.ExportDirect(exportType, FileName, true, false); if (report.DetailGrid != null) { if (report.ColumnByName("CheckBox") != null) { report.ColumnByName("CheckBox").Visible = true; } } if (!ret) { return; } msg = Pub.GetResText("", "MsgExportSuccess", ""); msg = string.Format(msg, Title); RefreshMsg(msg + Pub.GetDateDiffTimes(StartTime, DateTime.Now, true), true); Pub.MessageBoxShow(msg, MessageBoxIcon.Information); }
protected override void InitForm() { formCode = "PubDesign"; base.InitForm(); this.Text = title; Rectangle rect = Screen.PrimaryScreen.WorkingArea; this.Left = rect.Left; this.Top = rect.Top; this.Width = rect.Width; this.Height = rect.Height; this.WindowState = FormWindowState.Maximized; Pub.SetFormAppIcon(this); AddToolbarButton(mnuFileSave.Text, mnuFileSave.Image, mnuFileSave_Click); AddToolbarSeparator(); AddToolbarButton(mnuFileExit.Text, mnuFileExit.Image, mnuFileExit_Click); AddToolbarSeparator(); AddToolbarButton(mnuEditUndo.Text, mnuEditUndo.Image, mnuEditUndo_Click); AddToolbarButton(mnuEditRedo.Text, mnuEditRedo.Image, mnuEditRedo_Click); AddToolbarSeparator(); AddToolbarButton(mnuEditCut.Text, mnuEditCut.Image, mnuEditCut_Click); AddToolbarButton(mnuEditCopy.Text, mnuEditCopy.Image, mnuEditCopy_Click); AddToolbarButton(mnuEditPaste.Text, mnuEditPaste.Image, mnuEditPaste_Click); AddToolbarButton(mnuEditDelete.Text, mnuEditDelete.Image, mnuEditDelete_Click); AddToolbarButton(mnuEditAll.Text, mnuEditAll.Image, mnuEditAll_Click); grd.OnlyLayout = false; grd.ShowExplorer = true; grd.ShowInspector = true; string filename = Pub.GetTempPathFileName("report.tmp"); if (File.Exists(filename)) { File.Delete(filename); } Report.SaveToFile(filename); desReport = new GridppReport(); desReport.LoadFromFile(filename); if (File.Exists(filename)) { File.Delete(filename); } desReport.Language = Report.Language; if (desReport.ColumnByName("CheckBox") != null) { desReport.ColumnByName("CheckBox").Visible = true; } grd.Report = desReport; grd.Reload(); }
protected override void ExecItemPrint() { ShowReportHeader(true); if (Report.ColumnByName("CheckBox") != null) { Report.ColumnByName("CheckBox").Visible = false; } frmPubPreview frm = new frmPubPreview(Report, this.Text); frm.ShowDialog(); if (Report.ColumnByName("CheckBox") != null) { Report.ColumnByName("CheckBox").Visible = true; } ShowReportHeader(false); }
void Report_Initialize() { string sql = "select SiteName from T_SysConfig"; Report.ParameterByName("Title").AsString = (new DBUtil()).Get_Single_val(sql); Report.ParameterByName("ReceiptTypeID").AsString = this.strReceTypeId; sql = "select ReceName from T_ReceiptModal where ReceTypeID= '" + this.strReceTypeId + "'"; Report.ParameterByName("ReceiptName").AsString = (new DBUtil()).Get_Single_val(sql); if (b1.Checked) { SubReport.ColumnByName("单价").Visible = false; SubReport.ControlByName("SummaryBox6").Visible = false; } if (b2.Checked) { SubReport.ColumnByName("金额").Visible = false; SubReport.ControlByName("SummaryBox5").Visible = false; } }