internal void InternalExport(string location, ExportType exportType, bool showMessage) { string AmountLabel = null; TerminologyUnit TermUnit = 0; DataSheet dsterm = this.Project.GetDataSheet(Strings.DATASHEET_TERMINOLOGY_NAME); ExportColumnCollection columns = this.CreateColumnCollection(); TerminologyUtilities.GetAmountLabelTerminology(dsterm, ref AmountLabel, ref TermUnit); string WorksheetName = string.Format(CultureInfo.InvariantCulture, "{0} by Transition and State", AmountLabel); if (exportType == ExportType.ExcelFile) { this.ExcelExport(location, columns, this.CreateReportQuery(false), WorksheetName); } else { columns.Remove("ScenarioName"); this.CSVExport(location, columns, this.CreateReportQuery(true)); if (showMessage) { FormsUtilities.InformationMessageBox("Data saved to '{0}'.", location); } } }
/// <summary> /// Chooses a new raster file /// </summary> /// <remarks> /// Just store the filename. For now, no path required. In the future may want to support absolute path, differentiated by x:\\ /// </remarks> private void ChooseRasterFile(int rowIndex, int colIndex) { string FileName = RasterUtilities.ChooseRasterFileName("Initial Conditions Raster File", this); if (FileName == null) { return; } Application.DoEvents(); using (HourGlass h = new HourGlass()) { try { StochasticTimeRaster rast = new StochasticTimeRaster(FileName, RasterDataType.DTInteger); if (colIndex == PRIMARY_STRATUM_FILE_NAME_COLUMN_INDEX && rast.Projection == null) { const string msg = "There is no projection associated with this raster file. The model will still run but outputs will also have no projection."; FormsUtilities.InformationMessageBox(msg); } SetICSpatialFile(rowIndex, colIndex, FileName); } catch (Exception e) { FormsUtilities.ErrorMessageBox(e.Message); return; } } }
internal void InternalExport(string location, ExportType exportType, bool showMessage) { if (exportType == ExportType.ExcelFile) { this.CreateExcelReport(location); } else { this.CreateCSVReport(location); if (showMessage) { FormsUtilities.InformationMessageBox("Data saved to '{0}'.", location); } } }
internal void InternalExport(string location, ExportType exportType, bool showMessage) { ExportColumnCollection columns = this.CreateColumnCollection(); if (exportType == ExportType.ExcelFile) { this.ExcelExport(location, columns, this.CreateReportQuery(false), "Transition Based Attributes"); } else { columns.Remove("ScenarioName"); this.CSVExport(location, columns, this.CreateReportQuery(true)); if (showMessage) { FormsUtilities.InformationMessageBox("Data saved to '{0}'.", location); } } }