private void ExportRecord(GridControl grid) { SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.Title = "导出Excel"; fileDialog.Filter = "Excel (*.xls)|*.xls"; DialogResult dialogResult = fileDialog.ShowDialog(this); if (dialogResult == DialogResult.OK) { string orderNo = inboundView.GetFocusedRowCellValue("ProductNo").ToString(); ExportGridView.ExportRecord(orderNo, this.recordView, fileDialog.FileName); if (System.IO.File.Exists(fileDialog.FileName)) { System.Diagnostics.Process.Start(fileDialog.FileName); //保存v } } }
private void PrintGrid(GridControl grid) { string orderNo = inboundView.GetFocusedRowCellValue("ProductNo").ToString(); string tempFile = AppConfig.GetTempDirectory() + Database.GetGlobalKey() + ".xls"; if (grid == detailGrid) { ExportGridView.ExportDetail(this.detailView, tempFile); } else { ExportGridView.ExportRecord(orderNo, this.recordView, tempFile); } if (System.IO.File.Exists(tempFile)) { System.Diagnostics.Process.Start(tempFile); //保存v } }