public byte[] GetPedidoPreenchidoAzure(string nomeDocumento, DataTable dataTable, Dictionary <string, string> dicValues) { byte[] arquivoBytesTemplate = azureStorage.ReadStreamFromBlob(nomeDocumento); byte[] arquivoBytesPreenchido = WordReport.CreateOrder(arquivoBytesTemplate, dataTable, dicValues); return(arquivoBytesPreenchido); }
public static void MakeReport3T(string filename) { WordReport report = new WordReport(); report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\3T测试报告模板.dot"); report.InsertValue("报告生成时间", DateTime.Now.ToString("yyyy.MM.dd HH:mm")); report.InsertValue("芯片编号", SystemParam.DeviceID); report.InsertValue("系统增益", CCDParamTestResult.K.ToString("F6")); for (int i = 0; i < 3; i++) { if (CCD3TTestResult.delta_mid == null) { report.InsertValue("暗电流1_T" + (i + 1).ToString(), "未测试"); report.InsertValue("暗电流2_T" + (i + 1).ToString(), "未测试"); } else { report.InsertValue("暗电流1_T" + (i + 1).ToString(), CCD3TTestResult.miu_I_miu[i].ToString("F6")); report.InsertValue("暗电流2_T" + (i + 1).ToString(), CCD3TTestResult.miu_I_delta[i].ToString("F6")); } if (CCD3TTestResult.DSNU == null) { report.InsertValue("DSNU_T" + (i + 1).ToString(), "未测试"); } else { report.InsertValue("DSNU_T" + (i + 1).ToString(), CCD3TTestResult.DSNU[i].ToString("F6")); } if (CCD3TTestResult.FPN == null) { report.InsertValue("FPN_T" + (i + 1).ToString(), "未测试"); } else { report.InsertValue("FPN_T" + (i + 1).ToString(), CCD3TTestResult.DSNU[i].ToString("F6")); } if (CCD3TTestResult.delta_raed == null) { report.InsertValue("读出噪声_T" + (i + 1).ToString(), "未测试"); } else { report.InsertValue("读出噪声_T" + (i + 1).ToString(), CCD3TTestResult.DSNU[i].ToString("F6")); } if (CCDParamTestResult.bDarkICurve) { report.InsertPicture("图1_T" + (i + 1).ToString(), SystemParam.TempPicPath + "DarkI1_T" + (i + 1).ToString() + ".jpg", 300, 122); report.InsertValue("图1图题_T" + (i + 1).ToString(), "暗信号均值曲线"); report.InsertPicture("图2_T" + (i + 1).ToString(), SystemParam.TempPicPath + "DarkI2_T" + (i + 1).ToString() + ".jpg", 300, 122); report.InsertValue("图2图题_T" + (i + 1).ToString(), "暗信号均值曲线"); } } report.SaveDocument(filename); }
protected void Page_Load(object sender, EventArgs e) { WordReport wordReport = new WordReport(); wordDocument = wordReport.CreateWordDocument(); PowerPointReport excelReport = new PowerPointReport(); pptPresentation = excelReport.CreatePPTFile(); SaveFile(); }
public void MakeReport(string filename) { WordReport report = new WordReport(); //double d; if (bYaGuan != 0) { report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\弗兰克_氩.dot"); report.InsertValue("V1", tbU1.Text); report.InsertValue("V2", tbU2.Text); report.InsertValue("V3", tbU3.Text); report.InsertValue("V4", tbU4.Text); report.InsertValue("V5", tbU5.Text); report.InsertValue("V6", tbU6.Text); } else { report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\弗兰克_氖.dot"); report.InsertValue("V1", tbU1.Text); report.InsertValue("V2", tbU2.Text); report.InsertValue("V3", tbU3.Text); } report.InsertValue("实验时间", DateTime.Now.ToString("yyyy.MM.dd HH:mm")); report.InsertValue("姓名", lName.Text); report.InsertValue("班级", lClass.Text); report.InsertValue("学号", lNumber.Text); report.InsertValue("灯丝电压", UF.ToString("f02")); report.InsertValue("控制栅电压", UG1K.ToString("f02")); report.InsertValue("拒斥电压", UG2A.ToString("f02")); report.InsertValue("VAverage", tbU0.Text); string pic = System.Windows.Forms.Application.StartupPath + "\\temp\\1.tiff"; FileInfo f = new FileInfo(pic); // 如果文件所在的文件夹不存在则创建文件夹 if (!Directory.Exists(f.DirectoryName)) { Directory.CreateDirectory(f.DirectoryName); } chart1.SaveImage(pic, System.Drawing.Imaging.ImageFormat.Tiff); report.InsertPicture("曲线", pic, 350, 300); report.SaveDocument(filename); }
public static void MakeReport(string filename) { WordReport report = new WordReport(); double d; report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\测试报告模板.dot"); report.InsertValue("报告生成时间", DateTime.Now.ToString("yyyy.MM.dd HH:mm")); report.InsertValue("芯片编号", SystemParam.DeviceID); double Temperature; double E; Temperature = 0; for (int j = 0; j < Calc1.TList.Count; j++) { Temperature += Calc1.TList[j]; } Temperature = Temperature / Calc1.TList.Count; report.InsertValue("环境温度", Temperature.ToString("F1")); E = 0; for (int j = 0; j < Calc1.EList.Count; j++) { E += Calc1.EList[j]; } E = E / Calc1.EList.Count; report.InsertValue("环境光强", E.ToString("F1")); //report.InsertValue("饱和输出", Calc1.miu_y[Calc1.SaturatedIndex].ToString("F6")); report.InsertValue("饱和输出", Calc1.miu_y[SystemParam.ExposureTest_Ns - 1].ToString("F6")); report.InsertValue("系统增益", Calc1.OverAllGain_K.ToString("F6")); d = (Calc1.AverageDarkSignal_k * 1000) / Calc1.OverAllGain_K; report.InsertValue("暗电流1", d.ToString("F6")); d = (Calc1.AverageDarkSignal_k2 * 1000) / Calc1.OverAllGain_K; report.InsertValue("暗电流2", d.ToString("F6")); report.InsertValue("动态范围", Calc1.DR.ToString("F6")); report.InsertValue("量子效率", Calc1.eta.ToString("F6")); report.InsertValue("满阱容量", Calc1.FullCapacity.ToString("F6")); report.InsertValue("DSUN", Calc2.DSNU1288.ToString("F6")); report.InsertValue("PRUN", Calc2.PRNU1288.ToString("F6")); report.InsertValue("最大线性感光均值", Calc1.miu_y[Calc1.saturation - 1].ToString("F6")); report.InsertPicture("光电响应曲线", SystemParam.TempPicPath + "1.JPG", 300, 122); report.InsertPicture("平均暗信号", SystemParam.TempPicPath + "2.jpg", 300, 122); report.InsertPicture("暗信号均方差", SystemParam.TempPicPath + "3.jpg", 300, 122); report.InsertPicture("信噪比", SystemParam.TempPicPath + "4.jpg", 300, 122); report.InsertValue("亮点个数", Calc2.LightPoints.Count.ToString()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < Calc2.LightPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.LightPoints[i].col + 1).ToString(), (Calc2.LightPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("亮点前100个", "(亮点前100个)"); break; } } report.InsertValue("亮点位置", sb.ToString()); report.InsertValue("暗点个数", Calc2.DarkPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.DarkPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.DarkPoints[i].col + 1).ToString(), (Calc2.DarkPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("暗点前100个", "(暗点前100个)"); break; } } report.InsertValue("暗点位置", sb.ToString()); report.SaveDocument(filename); }
public static void RGBMakeReport(string filename) { WordReport report = new WordReport(); double d; report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\RGB测试报告模板.dot"); report.InsertValue("报告生成时间", DateTime.Now.ToString("yyyy.MM.dd HH:mm")); report.InsertValue("芯片编号", SystemParam.DeviceID); double Temperature; double E; Temperature = 0; for (int j = 0; j < Calc1.TList.Count; j++) { Temperature += Calc1.TList[j]; } Temperature = Temperature / Calc1.TList.Count; report.InsertValue("环境温度", Temperature.ToString("F1")); E = 0; for (int j = 0; j < Calc1.EList.Count; j++) { E += Calc1.EList[j]; } E = E / Calc1.EList.Count; report.InsertValue("环境光强", E.ToString("F1")); StringBuilder sb; report.InsertValue("R_饱和输出", Calc1.R_miu_y[Calc1.R_SaturatedIndex].ToString("F6")); report.InsertValue("R_系统增益", Calc1.R_OverAllGain_K.ToString("F6")); d = (Calc1.R_AverageDarkSignal_k * 1000) / Calc1.R_OverAllGain_K; report.InsertValue("R_平均暗电流", d.ToString("F6")); report.InsertValue("R_动态范围", Calc1.R_DR.ToString("F6")); report.InsertValue("R_量子效率", Calc1.R_eta.ToString("F6")); report.InsertValue("R_满阱容量", Calc1.R_FullCapacity.ToString("F6")); report.InsertValue("R_DSUN", Calc2.R_DSNU1288.ToString("F6")); report.InsertValue("R_PRUN", Calc2.R_PRNU1288.ToString("F6")); report.InsertPicture("R_光电响应曲线", SystemParam.TempPicPath + "1_R.JPG", 300, 122); report.InsertPicture("R_平均暗信号", SystemParam.TempPicPath + "2_R.jpg", 300, 122); report.InsertPicture("R_暗信号均方差", SystemParam.TempPicPath + "3_R.jpg", 300, 122); report.InsertPicture("R_信噪比", SystemParam.TempPicPath + "4_R.jpg", 300, 122); report.InsertValue("R_亮点个数", Calc2.R_LightPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.R_LightPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.R_LightPoints[i].col + 1).ToString(), (Calc2.R_LightPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("R_亮点前100个", "(亮点前100个)"); break; } } report.InsertValue("R_亮点位置", sb.ToString()); report.InsertValue("R_暗点个数", Calc2.R_DarkPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.R_DarkPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.R_DarkPoints[i].col + 1).ToString(), (Calc2.R_DarkPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("R_暗点前100个", "(暗点前100个)"); break; } } report.InsertValue("R_暗点位置", sb.ToString()); report.InsertValue("G_饱和输出", Calc1.G_miu_y[Calc1.G_SaturatedIndex].ToString("F6")); report.InsertValue("G_系统增益", Calc1.G_OverAllGain_K.ToString("F6")); d = (Calc1.G_AverageDarkSignal_k * 1000) / Calc1.G_OverAllGain_K; report.InsertValue("G_平均暗电流", d.ToString("F6")); report.InsertValue("G_动态范围", Calc1.G_DR.ToString("F6")); report.InsertValue("G_量子效率", Calc1.G_eta.ToString("F6")); report.InsertValue("G_满阱容量", Calc1.G_FullCapacity.ToString("F6")); report.InsertValue("G_DSUN", Calc2.G_DSNU1288.ToString("F6")); report.InsertValue("G_PRUN", Calc2.G_PRNU1288.ToString("F6")); report.InsertPicture("G_光电响应曲线", SystemParam.TempPicPath + "1_G.JPG", 300, 122); report.InsertPicture("G_平均暗信号", SystemParam.TempPicPath + "2_G.jpg", 300, 122); report.InsertPicture("G_暗信号均方差", SystemParam.TempPicPath + "3_G.jpg", 300, 122); report.InsertPicture("G_信噪比", SystemParam.TempPicPath + "4_G.jpg", 300, 122); report.InsertValue("G_亮点个数", Calc2.G_LightPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.G_LightPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.G_LightPoints[i].col + 1).ToString(), (Calc2.G_LightPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("G_亮点前100个", "(亮点前100个)"); break; } } report.InsertValue("G_亮点位置", sb.ToString()); report.InsertValue("G_暗点个数", Calc2.G_DarkPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.G_DarkPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.G_DarkPoints[i].col + 1).ToString(), (Calc2.G_DarkPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("G_暗点前100个", "(暗点前100个)"); break; } } report.InsertValue("G_暗点位置", sb.ToString()); report.InsertValue("B_饱和输出", Calc1.B_miu_y[Calc1.B_SaturatedIndex].ToString("F6")); report.InsertValue("B_系统增益", Calc1.B_OverAllGain_K.ToString("F6")); d = (Calc1.B_AverageDarkSignal_k * 1000) / Calc1.B_OverAllGain_K; report.InsertValue("B_平均暗电流", d.ToString("F6")); report.InsertValue("B_动态范围", Calc1.B_DR.ToString("F6")); report.InsertValue("B_量子效率", Calc1.B_eta.ToString("F6")); report.InsertValue("B_满阱容量", Calc1.B_FullCapacity.ToString("F6")); report.InsertValue("B_DSUN", Calc2.B_DSNU1288.ToString("F6")); report.InsertValue("B_PRUN", Calc2.B_PRNU1288.ToString("F6")); report.InsertPicture("B_光电响应曲线", SystemParam.TempPicPath + "1_B.JPG", 300, 122); report.InsertPicture("B_平均暗信号", SystemParam.TempPicPath + "2_B.jpg", 300, 122); report.InsertPicture("B_暗信号均方差", SystemParam.TempPicPath + "3_B.jpg", 300, 122); report.InsertPicture("B_信噪比", SystemParam.TempPicPath + "4_B.jpg", 300, 122); report.InsertValue("B_亮点个数", Calc2.B_LightPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.B_LightPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.B_LightPoints[i].col + 1).ToString(), (Calc2.B_LightPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("B_亮点前100个", "(亮点前100个)"); break; } } report.InsertValue("B_亮点位置", sb.ToString()); report.InsertValue("B_暗点个数", Calc2.B_DarkPoints.Count.ToString()); sb = new StringBuilder(); for (int i = 0; i < Calc2.B_DarkPoints.Count; i++) { sb.Append(String.Format("[{0,4},{1,4}]", (Calc2.B_DarkPoints[i].col + 1).ToString(), (Calc2.B_DarkPoints[i].row + 1).ToString())); if (((i + 1) % 5) == 0) { sb.Append("\r\n"); } else { sb.Append("\t"); } if (i > 98) { report.InsertValue("B_暗点前100个", "(暗点前100个)"); break; } } report.InsertValue("B_暗点位置", sb.ToString()); report.SaveDocument(filename); }
private void btnWord_Click(object sender, EventArgs e) { IReport objReport = new WordReport(); objReport.StartPrint(); }
public static void MakeReport(string filename) { WordReport report = new WordReport(); report.CreateNewDocument(System.Windows.Forms.Application.StartupPath + "\\测试报告模板.dot"); report.InsertValue("报告生成时间", DateTime.Now.ToString("yyyy.MM.dd HH:mm")); report.InsertValue("芯片编号", SystemParam.DeviceID); report.InsertValue("饱和输出", SystemParam.miu_sat.ToString("F6")); report.InsertValue("系统增益", CCDParamTestResult.K.ToString("F6")); if (double.IsNaN(CCDParamTestResult.eta)) { report.InsertValue("量子效率", "未测试"); } else { report.InsertValue("量子效率", CCDParamTestResult.eta.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.DR)) { report.InsertValue("动态范围", "未测试"); } else { report.InsertValue("动态范围", CCDParamTestResult.DR.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.FWC)) { report.InsertValue("满阱容量", "未测试"); } else { report.InsertValue("满阱容量", CCDParamTestResult.FWC.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.miu_I_miu)) { report.InsertValue("暗电流1", "未测试"); } else { report.InsertValue("暗电流1", CCDParamTestResult.miu_I_miu.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.miu_I_delta)) { report.InsertValue("暗电流2", "未测试"); } else { report.InsertValue("暗电流2", CCDParamTestResult.miu_I_delta.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.LE)) { report.InsertValue("线性误差LE", "未测试"); } else { report.InsertValue("线性误差LE", CCDParamTestResult.LE.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.DSNU)) { report.InsertValue("DSUN", "未测试"); } else { report.InsertValue("DSUN", CCDParamTestResult.DSNU.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.PRNU)) { report.InsertValue("PRUN", "未测试"); } else { report.InsertValue("PRUN", CCDParamTestResult.PRNU.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.FPN)) { report.InsertValue("FPN", "未测试"); } else { report.InsertValue("FPN", CCDParamTestResult.FPN.ToString("F6")); } if (double.IsNaN(CCDParamTestResult.delta_raed)) { report.InsertValue("读出噪声", "未测试"); } else { report.InsertValue("读出噪声", CCDParamTestResult.delta_raed.ToString("F6")); } int curveIndex = 1; if (CCDParamTestResult.bmiuCurve) { report.InsertPicture("图" + curveIndex.ToString(), SystemParam.TempPicPath + "K_1.jpg", 300, 122); report.InsertValue("图" + curveIndex.ToString() + "图题", "明场测试曲线"); curveIndex++; } if (CCDParamTestResult.betaCurve) { report.InsertPicture("图" + curveIndex.ToString(), SystemParam.TempPicPath + "etaCurve.jpg", 300, 122); report.InsertValue("图" + curveIndex.ToString() + "图题", "量子效率曲线"); curveIndex++; } if (CCDParamTestResult.bSNRCurve) { report.InsertPicture("图" + curveIndex.ToString(), SystemParam.TempPicPath + "SNR.jpg", 300, 122); report.InsertValue("图" + curveIndex.ToString() + "图题", "信噪比SNR曲线"); curveIndex++; } if (CCDParamTestResult.bDarkICurve) { report.InsertPicture("图" + curveIndex.ToString(), SystemParam.TempPicPath + "DarkI1.jpg", 300, 122); report.InsertValue("图" + curveIndex.ToString() + "图题", "暗信号均值曲线"); curveIndex++; report.InsertPicture("图" + curveIndex.ToString(), SystemParam.TempPicPath + "DarkI2.jpg", 300, 122); report.InsertValue("图" + curveIndex.ToString() + "图题", "暗信号方差曲线"); curveIndex++; } report.SaveDocument(filename); }
private void BtnEncargadosTC_Click(object sender, RoutedEventArgs e) { WordReport report = new WordReport(); report.ListadoEncargados(); }