diff --git a/B3QingDaoWanFu.Web/DFGridReportPage.cs b/B3QingDaoWanFu.Web/DFGridReportPage.cs index 1b0fb06..0acee1f 100644 --- a/B3QingDaoWanFu.Web/DFGridReportPage.cs +++ b/B3QingDaoWanFu.Web/DFGridReportPage.cs @@ -34,7 +34,10 @@ namespace BWP.Web int height; if (int.TryParse(bodyHeight, out height) && height > 180) { - mDFGrid.Height = height - 160; + if (EnableExcelExport && EnablePrint) + mDFGrid.Height = height - 160; + else + mDFGrid.Height = height - 100; } else { diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs index 55ebf6b..1270c82 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs @@ -23,6 +23,8 @@ using TSingSoft.WebControls2.DFGrids; using TSingSoft.WebPluginFramework; using BWP.B3Frameworks; using System.Web.UI; +using TSingSoft.WebPluginFramework.Controls; +using TSingSoft.WebPluginFramework.Exports; namespace BWP.Web.Pages.B3QingDaoWanFu.Reports { @@ -160,7 +162,6 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports return r; } - TextBox _reportLockCol; protected override void AddQueryControls(VLayoutPanel vPanel) { @@ -193,6 +194,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports protected override void InitQueryPanel(QueryPanel queryPanel) { base.InitQueryPanel(queryPanel); + AppendButtonPanel(queryPanel); var panel = queryPanel.CreateTab("显示字段"); var hPanel = new HLayoutPanel(); panel.EAdd(hPanel); @@ -252,6 +254,37 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports queryPanel.ConditonPanel.EAdd(CreateDataRangePanel()); } + + protected override bool EnablePrint + { + get + { + return false; + } + } + + protected override bool EnableExcelExport + { + get + { + return false; + } + } + + void AppendButtonPanel(QueryPanel queryPanel) + { + queryPanel.ButtonsPanel.EAdd(new TSButton("打印")).OnClientClick = "print();return false;"; + var exporter = new Exporter(); + var excelExporter = new DFGridServiceExcelExporter(ExportExcelName, this); + excelExporter.CreateQuerySettings = delegate + { + return new QuerySettings(SelectRange.All, mDFGrid.SortField, mDFGrid.SortDirection); + }; + + queryPanel.ButtonsPanel.EAdd(new TSButton("导出到Excel", (sender, args) => exporter.Export(excelExporter))); + queryPanel.ButtonsPanel.EAdd(exporter); + } + Control CreateDataRangePanel() { var hPanel = new HLayoutPanel();