private void CtrlViewReport_Load(object sender, EventArgs e) { sheetTags = new WorksheetTagCollection(reportSheet.Document); sheetTags.SetWorkSheetVisible("Raw Data", false); sheetTags.Clear(); calorieTags = new List <string>(); calorieTags.Add("324"); calorieTags.Add("325"); calorieTags.Add("326"); calorieTags.Add("327"); calorieTags.Add("328"); calorieTags.Add("329"); calorieTags.Add("330"); calorieTags.Add("331"); calorieTags.Add("332"); calorieTags.Add("333"); calorieTags.Add("334"); calorieTags.Add("335"); calorieTags.Add("336"); calorieTags.Add("337"); calorieTags.Add("338"); calorieTags.Add("339"); calorieTags.Add("341"); calorieTags.Add("394"); calorieTags.Add("342"); calorieTags.Add("343"); calorieTags.Add("344"); calorieTags.Add("345"); calorieTags.Add("346"); calorieTags.Add("347"); calorieTags.Add("348"); calorieTags.Add("349"); calorieTags.Add("350"); calorieTags.Add("351"); calorieTags.Add("352"); calorieTags.Add("353"); calorieTags.Add("354"); calorieTags.Add("355"); calorieTags.Add("356"); calorieTags.Add("357"); calorieTags.Add("358"); calorieTags.Add("359"); calorieTags.Add("360"); calorieTags.Add("361"); calorieTags.Add("362"); calorieTags.Add("363"); calorieTags.Add("365"); calorieTags.Add("366"); calorieTags.Add("367"); calorieTags.Add("368"); calorieTags.Add("369"); thermoTags = new List <string>(); for (int i = 0; i < 60; i++) { thermoTags.Add($"{525 + i}"); } }
private void SetSheetTitle(Dictionary <string, Cell> sheet, DataBookDataSet bookSet, DataSheetDataSet sheetSet) { sheetTags.SetWorkSheetVisible(sheetSet.SheetName, sheetSet.Use); if (sheetSet.Use == true) { sheet["{300}"].Value = bookSet.Company; sheet["{302}"].Value = bookSet.TestName; sheet["{304}"].Value = bookSet.TestNo; sheet["{306}"].Value = bookSet.Observer; sheet["{308}"].Value = bookSet.Maker; sheet["{310}"].Value = bookSet.Model1; sheet["{312}"].Value = bookSet.Serial1; sheet["{314}"].Value = bookSet.Model2; sheet["{316}"].Value = bookSet.Serial2; string str = bookSet.Model3 + " / " + bookSet.Serial3; if (str.Trim() == "/") { sheet["{318}"].Value = ""; } else { sheet["{318}"].Value = str; } sheet["{320}"].Value = sheetSet.IDTemp; sheet["{322}"].Value = sheetSet.IDState; sheet["{301}"].Value = bookSet.Capacity; sheet["{303}"].Value = bookSet.PowerInput; sheet["{305}"].Value = bookSet.EER_COP; sheet["{307}"].Value = bookSet.PowerSource; sheet["{309}"].Value = bookSet.ExpDevice; sheet["{311}"].Value = bookSet.Refrige; sheet["{313}"].Value = bookSet.RefCharge; sheet["{315}"].Value = bookSet.BeginTime; sheet["{321}"].Value = sheetSet.ODTemp; sheet["{323}"].Value = sheetSet.ODState; sheet["{299}"].Value = ""; if (sheetSet.SheetName.EndsWith("TC") == false) { sheet["{365}"].Value = sheetSet.NozzleName; } } }
private void SetSpreadSheetTitleItems(TestSpreadSheetArgs sheet) { ValueRow row; ConditionNote note = sheet.Report.Note; ConditionRated rated = sheet.Report.Rated; reportSheet.BeginUpdate(); sheet.Report.Lock(); try { foreach (KeyValuePair <string, Dictionary <string, Cell> > tags in sheetTags.Sheets) { if (tags.Key == "Raw Data") { sheetTags.SetWorkSheetVisible(tags.Key, false); continue; } bool sheetUse = sheet.Report.ValueSheets[tags.Key].Use; sheetTags.SetWorkSheetVisible(tags.Key, sheetUse); if (sheetUse == false) { continue; } tags.Value["{300}"].Value = note.Company; tags.Value["{302}"].Value = note.Name; tags.Value["{304}"].Value = note.No; tags.Value["{306}"].Value = note.Observer; tags.Value["{308}"].Value = note.Maker; tags.Value["{310}"].Value = note.Model1; tags.Value["{312}"].Value = note.Serial1; tags.Value["{314}"].Value = note.Model2; tags.Value["{316}"].Value = note.Serial2; string str = note.Model3 + " / " + note.Serial3; if (str.Trim() == "/") { tags.Value["{318}"].Value = ""; } else { tags.Value["{318}"].Value = str; } tags.Value["{320}"].Value = $"{sheet.Report.ValueSheets[tags.Key].IndoorDB:f2} / {sheet.Report.ValueSheets[tags.Key].IndoorWB:f2} ℃"; if (sheet.Report.ValueSheets[tags.Key].IndoorUse == EIndoorUse.NotUsed) { tags.Value["{322}"].Value = sheet.Report.ValueSheets[tags.Key].IndoorUse.ToDescription(); } else { tags.Value["{322}"].Value = $"{sheet.Report.ValueSheets[tags.Key].IndoorUse.ToDescription()}, {sheet.Report.ValueSheets[tags.Key].IndoorMode.ToDescription()}"; } row = context.Value.Calcurated["Total.Capacity"]; tags.Value["{301}"].Value = $"{rated.Capacity.ToString(row.Format)} {row.Unit.ToDescription}"; row = context.Value.Calcurated["Total.Power"]; tags.Value["{303}"].Value = $"{rated.PowerInput.ToString(row.Format)} {row.Unit.ToDescription}"; row = context.Value.Calcurated["Total.EER_COP"]; tags.Value["{305}"].Value = $"{rated.EER_COP.ToString(row.Format)} {row.Unit.ToDescription}"; tags.Value["{307}"].Value = $"{rated.Voltage}V / {rated.Current}A / {rated.Frequency}Hz / {EnumHelper.GetNames<EWT330Wiring>()[(int)rated.Wiring]}"; tags.Value["{309}"].Value = note.ExpDevice; tags.Value["{311}"].Value = note.Refrigerant; tags.Value["{313}"].Value = note.RefCharge; tags.Value["{315}"].Value = sheet.Report.RegTime.ToString(Resource.csDateTimeFormat); tags.Value["{321}"].Value = $"{sheet.Report.ValueSheets[tags.Key].OutdoorDB:f2} / {sheet.Report.ValueSheets[tags.Key].OutdoorWB:f2} ℃";; if (sheet.Report.ValueSheets[tags.Key].OutdoorDP == EEtcUse.Use) { tags.Value["{323}"].Value = $"{sheet.Report.ValueSheets[tags.Key].OutdoorUse.ToDescription()}, DP Used"; } else { tags.Value["{323}"].Value = $"{sheet.Report.ValueSheets[tags.Key].OutdoorUse.ToDescription()}"; } tags.Value["{299}"].Value = note.Memo; if (tags.Key.EndsWith("TC") == false) { tags.Value["{365}"].Value = " " + sheet.Report.ValueSheets[tags.Key].NozzleName; } string cellTag; for (int i = 0; i < 7; i++) { cellTag = "{" + $"min-{i + 1}" + "}"; tags.Value[cellTag].Value = (i < sheet.Report.Method.IntegralCount) ? $"{(i + 1) * sheet.Report.Method.IntegralTime} min" : ""; } foreach (KeyValuePair <string, ReportRow> sheetRow in sheet.Report.ValueSheets[tags.Key].Rows) { cellTag = "{" + sheetRow.Value.Tag + "}"; if (sheetRow.Key.EndsWith("Nozzle") == false) { if (sheetRow.Value.Row == null) { tags.Value[cellTag].Value = ""; } else { tags.Value[cellTag].Value = sheetRow.Value.Row.Unit.ToDescription; } } if (tags.Key.EndsWith("TC") == true) { if (sheetRow.Value.Row == null) { tags.Value[cellTag].Value = ""; } else { cellTag = "{" + sheetRow.Value.Tag + "-N}"; tags.Value[cellTag].Value = sheetRow.Value.Alias; } } } } } finally { sheet.Report.Unlock(); reportSheet.EndUpdate(); } }