private string GenerateSpreadsheetforGroupedWorksheet(long ScopeId, HttpContext context) { String result = String.Empty; ScopeServices objScopeService = new ScopeServices(); objScopeService.SQLConnection = ConnectDb.SQLConnection; ManagementService objManagementService = new ManagementService(); objManagementService.SQLConnection = ConnectDb.SQLConnection; Scope objScope = objScopeService.GetScopeByScopeId(ScopeId); Project objProject = objManagementService.GetProjectByProjectId(objScope.ProjectId); DataSet dsQuery = new DataSet(); int intFootTotalStartRow; int intFootTotalStartColum; int intCompanyInfoStartRow; int intCompanyInfoStartColum; String strExcelFile; String strNewExcelFileName; DataSet dsProjectGroup = new DataSet(); String strClaimNo = ""; String strClaimant = ""; String strSiteLocation = ""; String strEQRSupervisor = ""; String strContractorEmail = ""; String strScopeDate = ""; String strContractor = ""; String strAddress = ""; String strAccreditationNo = ""; String strContractorPhone = ""; String strGSTNo = ""; String strTotalPrice = ""; DataSet dsProject = new DataSet(); ProjectOwner projectOwner = new ProjectOwner(); String strLogo = ""; dsProjectGroup = objScopeService.GetProjectGroupsByProjectOwnerId(objProject.ProjectOwnerId); dsProject = objManagementService.GetProjectInfoByProjectId(objScope.ProjectId); //get project group email if (dsProjectGroup.Tables.Count > 0) { if (dsProjectGroup.Tables[0].Rows.Count > 0) { if (!Convert.IsDBNull(dsProjectGroup.Tables[0].Rows[0]["Email"])) { strContractorEmail = dsProjectGroup.Tables[0].Rows[0]["Email"].ToString(); } } } //get claimant detail if (!Convert.IsDBNull(dsProject.Tables[0].Rows[0]["EQCClaimNumber"])) { strClaimNo = dsProject.Tables[0].Rows[0]["EQCClaimNumber"].ToString(); } if (!Convert.IsDBNull(dsProject.Tables[0].Rows[0]["ScopeDate"])) { strScopeDate = dsProject.Tables[0].Rows[0]["ScopeDate"].ToString(); } if (!Convert.IsDBNull(dsProject.Tables[0].Rows[0]["ScopeDate"])) { strScopeDate = Convert.ToDateTime(dsProject.Tables[0].Rows[0]["ScopeDate"]).ToString("dd/MM/yyyy"); } if (!Convert.IsDBNull(dsProject.Tables[0].Rows[0]["Address"])) { strSiteLocation = dsProject.Tables[0].Rows[0]["Address"].ToString(); } if (!Convert.IsDBNull(dsProject.Tables[0].Rows[0]["ContactName"])) { strClaimant = dsProject.Tables[0].Rows[0]["ContactName"].ToString(); } //get project owner detail projectOwner = objManagementService.GetProjectOwnerByProjectOwnerId(objProject.ProjectOwnerId); strEQRSupervisor = projectOwner.EQRSupervisor; strContractor = projectOwner.Name; strContractorPhone = projectOwner.Contact1; strAddress = projectOwner.Address; strGSTNo = projectOwner.GSTNumber; strAccreditationNo = projectOwner.AccreditationNumber; String ApprovedexcludeGstCost = objScope.Cost.ToString("c"); String ApprovedGSTCost = (objScope.Total - objScope.Cost).ToString("c"); String ApprovedInGSTCost = objScope.Total.ToString("c"); String GrandExGSTCost = (objScope.Cost1 + objScope.Cost).ToString("c"); String GrandInGSTCost = (objScope.Total1 + objScope.Total).ToString("c"); strTotalPrice = ApprovedInGSTCost; //Company Logo strLogo = String.Format("{0}/Images/{1}/{2}", "http://koreprojects.com", projectOwner.Identifier, projectOwner.Logo); strNewExcelFileName = String.Empty; String strExcelFileNameTemp = Strings.StrConv(strSiteLocation, VbStrConv.ProperCase); int ascChar; for (int index = 0; index < strExcelFileNameTemp.Length - 1; index++) { ascChar = Strings.Asc(strExcelFileNameTemp[index]); if ((ascChar >= 65 && ascChar <= 90) || (ascChar >= 97 && ascChar <= 122) || (ascChar >= 48 && ascChar <= 57)) { strNewExcelFileName = strNewExcelFileName + strExcelFileNameTemp[index]; } else { strNewExcelFileName = strNewExcelFileName + "-"; } } do { strNewExcelFileName = Strings.Replace(strNewExcelFileName, "--", "-"); } while (strNewExcelFileName.Contains("--")); if (strNewExcelFileName.Substring(0, 1) == "-") { strNewExcelFileName = strNewExcelFileName.Substring(1); } if (strNewExcelFileName.Substring(strNewExcelFileName.Length - 1) == "-") { strNewExcelFileName = strNewExcelFileName.Substring(0, strNewExcelFileName.Length - 1); } if (strNewExcelFileName.Length > 20) { strNewExcelFileName = strNewExcelFileName.Substring(0, 20); } strExcelFile = String.Format("../Downloads/{0}/{1}.xls", "ExcelExport", strNewExcelFileName); if ((!System.IO.Directory.Exists(String.Format("../Downloads/{0}", "ExcelExport")))) { System.IO.Directory.CreateDirectory(String.Format("../Downloads/{0}", "ExcelExport")); } WorkSheet workSheet = new WorkSheet(); //initialzing the cellexport tool cellExport = new Spire.DataExport.XLS.CellExport(); cellExport.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; //culture format setting cellExport.DataFormats.CultureName = "en-NZ"; cellExport.DataFormats.Currency = "#,###,##0.00"; cellExport.DataFormats.DateTime = "dd/MM/yyyy H:mm"; cellExport.DataFormats.Float = "#,###,##0.00"; cellExport.DataFormats.Integer = "#,###,##0"; cellExport.DataFormats.Time = "H:mm"; //set up file name and location cellExport.FileName = strExcelFile; //outlook formating cellExport.SheetOptions.AggregateFormat.Font.Name = "Arial"; cellExport.SheetOptions.CustomDataFormat.Font.Name = "Arial"; cellExport.SheetOptions.DefaultFont.Name = "Arial"; cellExport.SheetOptions.FooterFormat.Font.Name = "Arial"; cellExport.SheetOptions.HeaderFormat.Font.Name = "Arial"; cellExport.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; cellExport.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; cellExport.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; cellExport.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; cellExport.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; cellExport.SheetOptions.NoteFormat.Font.Bold = true; cellExport.SheetOptions.NoteFormat.Font.Name = "Tahoma"; cellExport.SheetOptions.NoteFormat.Font.Size = 8.0F; cellExport.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; cellExport.SheetOptions.TitlesFormat.Font.Bold = true; cellExport.SheetOptions.TitlesFormat.Font.Name = "Arial"; //worksheet culture format workSheet.FormatsExport.CultureName = "en-NZ"; workSheet.FormatsExport.Currency = "#,###,##0.00"; workSheet.FormatsExport.DateTime = "dd/MM/yyyy H:mm"; workSheet.FormatsExport.Float = "#,###,##0.00"; workSheet.FormatsExport.Integer = "#,###,##0"; workSheet.FormatsExport.Time = "H:mm"; //worksheet outlook format; workSheet.Options.AggregateFormat.Font.Name = "Arial"; workSheet.Options.CustomDataFormat.Font.Name = "Arial"; workSheet.Options.DefaultFont.Name = "Arial"; workSheet.Options.FooterFormat.Font.Name = "Arial"; workSheet.Options.HeaderFormat.Font.Name = "Arial"; workSheet.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet.Options.NoteFormat.Font.Bold = true; workSheet.Options.NoteFormat.Font.Name = "Tahoma"; workSheet.Options.NoteFormat.Font.Size = 8.0F; workSheet.Options.TitlesFormat.Font.Bold = true; workSheet.Options.TitlesFormat.Font.Name = "Arial"; workSheet.Options.CustomDataFormat.Borders.Bottom.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet.Options.CustomDataFormat.Borders.Left.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet.Options.CustomDataFormat.Borders.Right.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet.Options.CustomDataFormat.Borders.Top.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet.SheetName = "Worksheet"; workSheet.AutoFitColWidth = true; StripStyle stripStyle1 = new Spire.DataExport.XLS.StripStyle(); Cell mcell = new Spire.DataExport.XLS.Cell(); mcell.Column = 1; mcell.Row = 2; if (dsProjectGroup.Tables.Count > 0) { if (dsProjectGroup.Tables[0].Rows.Count > 0) { mcell.Value = String.Format("{0} - Contractor's Quote", dsProjectGroup.Tables[0].Rows[0]["Name"]); } else { mcell.Value = String.Format("Contractor's Quote"); } } else { mcell.Value = String.Format("Contractor's Quote"); } mcell.CellType = Spire.DataExport.XLS.CellType.String; workSheet.HeaderRows = 15; workSheet.Cells.Add(mcell); intCompanyInfoStartRow = 8; intCompanyInfoStartColum = 1; CellPicture pic1 = new Spire.DataExport.XLS.CellPicture(); pic1.FileName = strLogo; //need to find out where the logo is pic1.Name = "Logo"; cellExport.Pictures.Add(pic1); CellImage img1 = new Spire.DataExport.XLS.CellImage(); img1.Column = 3; img1.PictureName = "Logo"; img1.Row = 1; workSheet.Images.Add(img1); Cell mcell1 = new Spire.DataExport.XLS.Cell(); mcell1.Column = intCompanyInfoStartColum; mcell1.Row = intCompanyInfoStartRow; mcell1.Value = "Claim No:"; mcell1.CellType = CellType.String; workSheet.Cells.Add(mcell1); Cell mcell2 = new Spire.DataExport.XLS.Cell(); mcell2.Column = intCompanyInfoStartColum; mcell2.Row = intCompanyInfoStartRow + 1; mcell2.Value = "Claimant:"; mcell2.CellType = CellType.String; workSheet.Cells.Add(mcell2); Cell mcell3 = new Spire.DataExport.XLS.Cell(); mcell3.Column = intCompanyInfoStartColum; mcell3.Row = intCompanyInfoStartRow + 2; mcell3.Value = "Site Location:"; mcell3.CellType = CellType.String; workSheet.Cells.Add(mcell3); Cell mcell4 = new Spire.DataExport.XLS.Cell(); mcell4.Column = intCompanyInfoStartColum; mcell4.Row = intCompanyInfoStartRow + 3; mcell4.Value = "EQR Supervisor:"; mcell4.CellType = CellType.String; workSheet.Cells.Add(mcell4); Cell mcell5 = new Spire.DataExport.XLS.Cell(); mcell5.Column = intCompanyInfoStartColum; mcell5.Row = intCompanyInfoStartRow + 4; mcell5.Value = "Contractor E-mail:"; mcell5.CellType = CellType.String; workSheet.Cells.Add(mcell5); Cell mcell6 = new Spire.DataExport.XLS.Cell(); mcell6.Column = intCompanyInfoStartColum; mcell6.Row = intCompanyInfoStartRow + 5; mcell6.Value = "Date:"; mcell6.CellType = CellType.String; workSheet.Cells.Add(mcell6); //'add contact detail head field contet //''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Cell mcell1_2 = new Spire.DataExport.XLS.Cell(); mcell1_2.Column = intCompanyInfoStartColum + 1; mcell1_2.Row = intCompanyInfoStartRow; mcell1_2.Value = strClaimNo; mcell1_2.CellType = CellType.String; workSheet.Cells.Add(mcell1_2); Cell mcell2_2 = new Spire.DataExport.XLS.Cell(); mcell2_2.Column = intCompanyInfoStartColum + 1; mcell2_2.Row = intCompanyInfoStartRow + 1; mcell2_2.Value = strClaimant; mcell2_2.CellType = CellType.String; workSheet.Cells.Add(mcell2_2); Cell mcell3_2 = new Spire.DataExport.XLS.Cell(); mcell3_2.Column = intCompanyInfoStartColum + 1; mcell3_2.Row = intCompanyInfoStartRow + 2; mcell3_2.Value = strSiteLocation; mcell3_2.CellType = CellType.String; workSheet.Cells.Add(mcell3_2); Cell mcell4_2 = new Spire.DataExport.XLS.Cell(); mcell4_2.Column = intCompanyInfoStartColum + 1; mcell4_2.Row = intCompanyInfoStartRow + 3; mcell4_2.Value = strEQRSupervisor; mcell4_2.CellType = CellType.String; workSheet.Cells.Add(mcell4_2); Cell mcell5_2 = new Spire.DataExport.XLS.Cell(); mcell5_2.Column = intCompanyInfoStartColum + 1; mcell5_2.Row = intCompanyInfoStartRow + 4; mcell5_2.Value = strContractorEmail; mcell5_2.CellType = CellType.String; workSheet.Cells.Add(mcell5_2); Cell mcell6_2 = new Spire.DataExport.XLS.Cell(); mcell6_2.Column = intCompanyInfoStartColum + 1; mcell6_2.Row = intCompanyInfoStartRow + 5; // 'mcell6_2.Value = IIf(strScopeDate.Trim() = String.Empty, Today.ToString("dd/MM/yyyy"), strScopeDate) mcell6_2.Value = DateTime.Now.ToString("dd/MM/yyyy"); mcell6_2.CellType = CellType.String; workSheet.Cells.Add(mcell6_2); //'second part of heading //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Cell mcell1_3 = new Spire.DataExport.XLS.Cell(); mcell1_3.Column = intCompanyInfoStartColum + 2; mcell1_3.Row = intCompanyInfoStartRow; mcell1_3.Value = "Contractor:"; mcell1_3.CellType = CellType.String; workSheet.Cells.Add(mcell1_3); Cell mcell2_3 = new Spire.DataExport.XLS.Cell(); mcell2_3.Column = intCompanyInfoStartColum + 2; mcell2_3.Row = intCompanyInfoStartRow + 1; mcell2_3.Value = "Address:"; mcell2_3.CellType = CellType.String; workSheet.Cells.Add(mcell2_3); Cell mcell3_3 = new Spire.DataExport.XLS.Cell(); mcell3_3.Column = intCompanyInfoStartColum + 2; mcell3_3.Row = intCompanyInfoStartRow + 2; mcell3_3.Value = "Accreditation No:"; mcell3_3.CellType = CellType.String; workSheet.Cells.Add(mcell3_3); Cell mcell4_3 = new Spire.DataExport.XLS.Cell(); mcell4_3.Column = intCompanyInfoStartColum + 2; mcell4_3.Row = intCompanyInfoStartRow + 3; mcell4_3.Value = "Contractor Phone:"; mcell4_3.CellType = CellType.String; workSheet.Cells.Add(mcell4_3); Cell mcell5_3 = new Spire.DataExport.XLS.Cell(); mcell5_3.Column = intCompanyInfoStartColum + 2; mcell5_3.Row = intCompanyInfoStartRow + 4; mcell5_3.Value = "GST No:"; mcell5_3.CellType = CellType.String; workSheet.Cells.Add(mcell5_3); Cell mcell6_3 = new Spire.DataExport.XLS.Cell(); mcell6_3.Column = intCompanyInfoStartColum + 2; mcell6_3.Row = intCompanyInfoStartRow + 5; mcell6_3.Value = "Total Price (incl. GST):"; mcell6_3.CellType = CellType.String; workSheet.Cells.Add(mcell6_3); //'second part of heading // ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Cell mcell1_4 = new Spire.DataExport.XLS.Cell(); mcell1_4.Column = intCompanyInfoStartColum + 3; mcell1_4.Row = intCompanyInfoStartRow; mcell1_4.Value = strContractor; mcell1_4.CellType = CellType.String; workSheet.Cells.Add(mcell1_4); Cell mcell2_4 = new Spire.DataExport.XLS.Cell(); mcell2_4.Column = intCompanyInfoStartColum + 3; mcell2_4.Row = intCompanyInfoStartRow + 1; mcell2_4.Value = strAddress; mcell2_4.CellType = CellType.String; workSheet.Cells.Add(mcell2_4); Cell mcell3_4 = new Spire.DataExport.XLS.Cell(); mcell3_4.Column = intCompanyInfoStartColum + 3; mcell3_4.Row = intCompanyInfoStartRow + 2; mcell3_4.Value = strAccreditationNo; mcell3_4.CellType = CellType.String; workSheet.Cells.Add(mcell3_4); Cell mcell4_4 = new Spire.DataExport.XLS.Cell(); mcell4_4.Column = intCompanyInfoStartColum + 3; mcell4_4.Row = intCompanyInfoStartRow + 3; mcell4_4.Value = strContractorPhone; mcell4_4.CellType = CellType.String; workSheet.Cells.Add(mcell4_4); Cell mcell5_4 = new Spire.DataExport.XLS.Cell(); mcell5_4.Column = intCompanyInfoStartColum + 3; mcell5_4.Row = intCompanyInfoStartRow + 4; mcell5_4.Value = strGSTNo; mcell5_4.CellType = CellType.String; workSheet.Cells.Add(mcell5_4); Cell mcell6_4 = new Spire.DataExport.XLS.Cell(); mcell6_4.Column = intCompanyInfoStartColum + 3; mcell6_4.Row = intCompanyInfoStartRow + 5; mcell6_4.Value = strTotalPrice; mcell6_4.CellType = CellType.String; workSheet.Cells.Add(mcell6_4); dsQuery = objScopeService.GetScopeItemsByScopeIdScopeItemStatus(ScopeId, 2); dsQuery.Tables[0].DefaultView.Sort = "ScopeGroup"; //DataRowView rowView= new DataRowView(); int intRowIndex; int intColumIndex; intRowIndex = 15; intColumIndex = 0; String strPrevScopeGroup = "****"; String strScopeGroup = String.Empty; String strPrevArea = "*****"; String strArea = String.Empty; String strAreaMeasurement = String.Empty; Boolean blnAreaMeasurementFilled = false; Cell dynamiccell_1; intRowIndex = intRowIndex + 1; int Range1 = intRowIndex; foreach (DataRowView rowView in dsQuery.Tables[0].DefaultView) { DataRow row = rowView.Row; strScopeGroup = String.Format("{0}", row["ScopeGroup"]); if (strScopeGroup != strPrevScopeGroup) { intRowIndex = intRowIndex + 1; dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 1; dynamiccell_1.Row = intRowIndex; dynamiccell_1.Value = String.Format("{0}", row["ScopeGroup"]); dynamiccell_1.CellType = CellType.String; workSheet.Cells.Add(dynamiccell_1); dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 2; dynamiccell_1.Row = intRowIndex; dynamiccell_1.Value = "Description of Works"; dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(dynamiccell_1); dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 3; dynamiccell_1.Row = intRowIndex; dynamiccell_1.Value = "Dimension"; dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(dynamiccell_1); dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 4; dynamiccell_1.Row = intRowIndex; dynamiccell_1.Value = "$ Rate"; dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(dynamiccell_1); dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 5; dynamiccell_1.Row = intRowIndex; dynamiccell_1.Value = "Contractors Quote"; dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(dynamiccell_1); intRowIndex = intRowIndex + 1; } strPrevScopeGroup = strScopeGroup; strArea = String.Format("{0}", row["Area"]); strAreaMeasurement = String.Format("{0}", row["AreaMeasurement"]); dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 1; dynamiccell_1.Row = intRowIndex; if (strArea != strPrevArea) { dynamiccell_1.Value = strArea; blnAreaMeasurementFilled = false; } else if (blnAreaMeasurementFilled) { dynamiccell_1.Value = "-"; } else { if (strAreaMeasurement.Trim() == String.Empty) { dynamiccell_1.Value = "-"; } else { dynamiccell_1.Value = strAreaMeasurement; } blnAreaMeasurementFilled = true; } strPrevArea = strArea; dynamiccell_1.CellType = CellType.String; workSheet.Cells.Add(dynamiccell_1); //'Note dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 2; dynamiccell_1.Row = intRowIndex; if (!Convert.IsDBNull(row["Description"])) { dynamiccell_1.Value = row["Description"]; } else { dynamiccell_1.Value = ""; } if (!Convert.IsDBNull(row["Item"])) { if (String.Format("{0}", row["Item"]).Trim() != String.Empty) { dynamiccell_1.Value = String.Format("{0}: {1}", row["Item"], dynamiccell_1.Value); } } dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(dynamiccell_1); //'QTY dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 3; dynamiccell_1.Row = intRowIndex; if (Convert.IsDBNull(row["Quantity"])) { dynamiccell_1.Value = Convert.ToDouble(row["Quantity"]).ToString(); } else { dynamiccell_1.Value = 0; } dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; dynamiccell_1.NumericFormat = "#,###,##0.00"; workSheet.Cells.Add(dynamiccell_1); //'Rate dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 4; dynamiccell_1.Row = intRowIndex; if (Convert.IsDBNull(row["Rate"])) { dynamiccell_1.Value = Convert.ToDouble(row["Rate"]).ToString(); } else { dynamiccell_1.Value = 0; } dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; dynamiccell_1.NumericFormat = "#,###,##0.00"; workSheet.Cells.Add(dynamiccell_1); //'Cost dynamiccell_1 = new Spire.DataExport.XLS.Cell(); dynamiccell_1.Column = 5; dynamiccell_1.Row = intRowIndex; if (Convert.IsDBNull(row["Cost"])) { dynamiccell_1.Value = Convert.ToDouble(row["Cost"]).ToString("c"); } else { dynamiccell_1.Value = Convert.ToDouble(0).ToString("c"); } dynamiccell_1.CellType = Spire.DataExport.XLS.CellType.String; dynamiccell_1.NumericFormat = "#,###,##0.00"; workSheet.Cells.Add(dynamiccell_1); intRowIndex = intRowIndex + 1; } int Range2 = intRowIndex - 1; intFootTotalStartRow = intRowIndex; intFootTotalStartColum = 4; //'heading Cell mcell1_5 = new Spire.DataExport.XLS.Cell(); mcell1_5.Column = intFootTotalStartColum; mcell1_5.Row = intFootTotalStartRow + 2; mcell1_5.Value = "Subtotal (excl. GST)"; mcell1_5.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell1_5); Cell mcell2_5 = new Spire.DataExport.XLS.Cell(); mcell2_5.Column = intFootTotalStartColum; mcell2_5.Row = intFootTotalStartRow + 3; mcell2_5.Value = "Add 15% GST"; mcell2_5.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell2_5); Cell mcell3_5 = new Spire.DataExport.XLS.Cell(); mcell3_5.Column = intFootTotalStartColum; mcell3_5.Row = intFootTotalStartRow + 4; mcell3_5.Value = "Total Incl. GST"; mcell3_5.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell3_5); Cell mcell1_7 = new Spire.DataExport.XLS.Cell(); mcell1_7.Column = intFootTotalStartColum + 1; mcell1_7.Row = intFootTotalStartRow + 2; mcell1_7.Value = ApprovedexcludeGstCost; mcell1_7.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell1_7); Cell mcell2_7 = new Spire.DataExport.XLS.Cell(); mcell2_7.Column = intFootTotalStartColum + 2; mcell2_7.Row = intFootTotalStartRow + 3; mcell2_7.Value = ApprovedGSTCost; mcell2_7.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell2_7); Cell mcell3_7 = new Spire.DataExport.XLS.Cell(); mcell3_7.Column = intFootTotalStartColum + 3; mcell3_7.Row = intFootTotalStartRow + 4; mcell3_7.Value = ApprovedInGSTCost; mcell3_7.CellType = Spire.DataExport.XLS.CellType.String; workSheet.Cells.Add(mcell3_7); DataTable InitialDataTable = new DataTable(); //'connect to dataset workSheet.DataSource = Spire.DataExport.Common.ExportSource.DataTable; //'workSheet.DataTable = dsQuery.Tables(0) workSheet.DataTable = InitialDataTable; //'workSheet.SQLCommand = oleDbCommand workSheet.StartDataCol = Convert.ToByte(1); cellExport.Sheets.Add(workSheet); try { cellExport.SaveToHttpResponse(String.Format("{0}.xls", strNewExcelFileName), context.Response); result = strExcelFile; } catch (Exception) { } return(result); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { Spire.DataExport.XLS.WorkSheet workSheet1 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.ColumnFormat columnFormat1 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.StripStyle stripStyle1 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.StripStyle stripStyle2 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.WorkSheet workSheet2 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.StripStyle stripStyle3 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.StripStyle stripStyle4 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.WorkSheet workSheet3 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.ColumnFormat columnFormat2 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.ColumnFormat columnFormat3 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.ColumnFormat columnFormat4 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.ColumnFormat columnFormat5 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.ColumnFormat columnFormat6 = new Spire.DataExport.XLS.ColumnFormat(); Spire.DataExport.XLS.CellPicture cellPicture1 = new Spire.DataExport.XLS.CellPicture(); Spire.DataExport.XLS.WorkSheet workSheet4 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.CellImage cellImage1 = new Spire.DataExport.XLS.CellImage(); Spire.DataExport.XLS.CellImage cellImage2 = new Spire.DataExport.XLS.CellImage(); Spire.DataExport.XLS.WorkSheet workSheet5 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.Chart chart1 = new Spire.DataExport.XLS.Chart(); Spire.DataExport.XLS.ChartSeries chartSeries1 = new Spire.DataExport.XLS.ChartSeries(); Spire.DataExport.XLS.StripStyle stripStyle5 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.StripStyle stripStyle6 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.WorkSheet workSheet6 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.Chart chart2 = new Spire.DataExport.XLS.Chart(); Spire.DataExport.XLS.ChartSeries chartSeries2 = new Spire.DataExport.XLS.ChartSeries(); Spire.DataExport.XLS.WorkSheet workSheet7 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.StripStyle stripStyle7 = new Spire.DataExport.XLS.StripStyle(); Spire.DataExport.XLS.StripStyle stripStyle8 = new Spire.DataExport.XLS.StripStyle(); this.oleDbCommand1 = new System.Data.OleDb.OleDbCommand(); this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection(); this.oleDbCommand2 = new System.Data.OleDb.OleDbCommand(); this.cellExport1 = new Spire.DataExport.XLS.CellExport(); this.cellExport2 = new Spire.DataExport.XLS.CellExport(); this.cellExport3 = new Spire.DataExport.XLS.CellExport(); this.cellExport5 = new Spire.DataExport.XLS.CellExport(); this.cellExport6 = new Spire.DataExport.XLS.CellExport(); this.cellExport7 = new Spire.DataExport.XLS.CellExport(); this.cellExport8 = new Spire.DataExport.XLS.CellExport(); // // oleDbCommand1 // this.oleDbCommand1.CommandText = "SELECT * FROM PARTS"; this.oleDbCommand1.Connection = this.oleDbConnection1; // // oleDbConnection1 // this.oleDbConnection1.ConnectionString = @"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data Source="".\..\database\demo.mdb"";Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"; // // oleDbCommand2 // this.oleDbCommand2.CommandText = "SELECT * FROM Employee"; this.oleDbCommand2.Connection = this.oleDbConnection1; // // cellExport1 // this.cellExport1.DataFormats.CultureName = "zh-CN"; this.cellExport1.DataFormats.Currency = "$#,###,##0.00"; this.cellExport1.DataFormats.DateTime = "yyyy-M-d"; this.cellExport1.DataFormats.Float = "#,###,##0.00"; this.cellExport1.DataFormats.Integer = "#,###,##0"; this.cellExport1.DataFormats.Time = "H:mm"; this.cellExport1.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport1.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport1.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport1.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport1.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport1.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport1.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport1.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport1.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport1.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport1.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport1.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport1.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport1.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; this.cellExport1.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport1.SheetOptions.TitlesFormat.Font.Name = "Arial"; workSheet1.AutoFitColWidth = true; workSheet1.CustomFormats.AddRange(new object[] { "OnHand=#,##0", "OnOrder=#,##0", "Cost=#,##0.0000;-#,##0.0000"}); columnFormat1.FieldName = "ListPrice"; columnFormat1.Font.Name = "Arial"; columnFormat1.Width = 8; workSheet1.ColumnFormats.Add(columnFormat1); workSheet1.FormatsExport.CultureName = "zh-CN"; workSheet1.FormatsExport.Currency = "гд#,###,##0.00"; workSheet1.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet1.FormatsExport.Float = "#,###,##0.00"; workSheet1.FormatsExport.Integer = "#,###,##0"; workSheet1.FormatsExport.Time = "H:mm"; stripStyle1.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle1.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle1.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle1.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle1.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightGreen; stripStyle1.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle1.Font.Name = "Arial"; stripStyle2.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle2.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle2.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle2.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle2.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; stripStyle2.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle2.Font.Name = "Arial"; workSheet1.ItemStyles.Add(stripStyle1); workSheet1.ItemStyles.Add(stripStyle2); workSheet1.ItemType = Spire.DataExport.XLS.CellItemType.Row; workSheet1.Options.AggregateFormat.Font.Name = "Arial"; workSheet1.Options.CustomDataFormat.Font.Name = "Arial"; workSheet1.Options.DefaultFont.Name = "Arial"; workSheet1.Options.FooterFormat.Font.Name = "Arial"; workSheet1.Options.HeaderFormat.Font.Name = "Arial"; workSheet1.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet1.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet1.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet1.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet1.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet1.Options.NoteFormat.Font.Bold = true; workSheet1.Options.NoteFormat.Font.Name = "Tahoma"; workSheet1.Options.NoteFormat.Font.Size = 8F; workSheet1.Options.TitlesFormat.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet1.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet1.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet1.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet1.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet1.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet1.Options.TitlesFormat.Font.Bold = true; workSheet1.Options.TitlesFormat.Font.Name = "Arial"; workSheet1.SheetName = "Parts"; workSheet1.SQLCommand = this.oleDbCommand1; workSheet1.StartDataCol = ((System.Byte)(0)); workSheet2.AutoFitColWidth = true; workSheet2.CustomFormats.AddRange(new object[] { "HireDate=yyyy-MM-dd"}); workSheet2.FormatsExport.CultureName = "zh-CN"; workSheet2.FormatsExport.Currency = "гд#,###,##0.00"; workSheet2.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet2.FormatsExport.Float = "#,###,##0.00"; workSheet2.FormatsExport.Integer = "#,###,##0"; workSheet2.FormatsExport.Time = "H:mm"; stripStyle3.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle3.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle3.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle3.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle3.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightGreen; stripStyle3.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle3.Font.Name = "Arial"; stripStyle4.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle4.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle4.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle4.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle4.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; stripStyle4.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle4.Font.Name = "Arial"; workSheet2.ItemStyles.Add(stripStyle3); workSheet2.ItemStyles.Add(stripStyle4); workSheet2.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet2.Options.AggregateFormat.Font.Name = "Arial"; workSheet2.Options.CustomDataFormat.Font.Name = "Arial"; workSheet2.Options.DefaultFont.Name = "Arial"; workSheet2.Options.FooterFormat.Font.Name = "Arial"; workSheet2.Options.HeaderFormat.Font.Name = "Arial"; workSheet2.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet2.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet2.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet2.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet2.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet2.Options.NoteFormat.Font.Bold = true; workSheet2.Options.NoteFormat.Font.Name = "Tahoma"; workSheet2.Options.NoteFormat.Font.Size = 8F; workSheet2.Options.TitlesFormat.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet2.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet2.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet2.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet2.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet2.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet2.Options.TitlesFormat.Font.Bold = true; workSheet2.Options.TitlesFormat.Font.Name = "Arial"; workSheet2.SheetName = "Orders"; workSheet2.SQLCommand = this.oleDbCommand2; workSheet2.StartDataCol = ((System.Byte)(0)); this.cellExport1.Sheets.Add(workSheet1); this.cellExport1.Sheets.Add(workSheet2); this.cellExport1.GetDataParams += new Spire.DataExport.Delegates.DataParamsEventHandler(this.cellExport1_GetDataParams); // // cellExport2 // this.cellExport2.DataFormats.CultureName = "zh-CN"; this.cellExport2.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport2.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport2.DataFormats.Float = "#,###,##0.00"; this.cellExport2.DataFormats.Integer = "#,###,##0"; this.cellExport2.DataFormats.Time = "H:mm"; this.cellExport2.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport2.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport2.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport2.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport2.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport2.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport2.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport2.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport2.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport2.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport2.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport2.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport2.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport2.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; this.cellExport2.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport2.SheetOptions.TitlesFormat.Font.Name = "Arial"; columnFormat2.FieldName = "PartNo"; columnFormat2.Font.Bold = true; columnFormat2.Font.Name = "Arial"; columnFormat3.FieldName = "VendorNo"; columnFormat3.Font.Color = Spire.DataExport.XLS.CellColor.Color1; columnFormat3.Font.Italic = true; columnFormat3.Font.Name = "Arial"; columnFormat4.FieldName = "Description"; columnFormat4.Font.Name = "Arial"; columnFormat4.Font.Strikeout = true; columnFormat4.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.DoubleAccounting; columnFormat5.FieldName = "OnHand"; columnFormat5.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; columnFormat5.FillStyle.Foreground = Spire.DataExport.XLS.CellColor.Pink; columnFormat5.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.ThinGorizontal; columnFormat5.Font.Name = "Arial"; columnFormat6.FieldName = "ListPrice"; columnFormat6.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; columnFormat6.FillStyle.Foreground = Spire.DataExport.XLS.CellColor.SkyBlue; columnFormat6.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.ThinVertical; columnFormat6.Font.Name = "Arial"; workSheet3.ColumnFormats.Add(columnFormat2); workSheet3.ColumnFormats.Add(columnFormat3); workSheet3.ColumnFormats.Add(columnFormat4); workSheet3.ColumnFormats.Add(columnFormat5); workSheet3.ColumnFormats.Add(columnFormat6); workSheet3.FormatsExport.CultureName = "zh-CN"; workSheet3.FormatsExport.Currency = "гд#,###,##0.00"; workSheet3.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet3.FormatsExport.Float = "#,###,##0.00"; workSheet3.FormatsExport.Integer = "#,###,##0"; workSheet3.FormatsExport.Time = "H:mm"; workSheet3.Options.AggregateFormat.Font.Name = "Arial"; workSheet3.Options.CustomDataFormat.Font.Name = "Arial"; workSheet3.Options.DefaultFont.Name = "Arial"; workSheet3.Options.FooterFormat.Font.Name = "Arial"; workSheet3.Options.HeaderFormat.Font.Name = "Arial"; workSheet3.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet3.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet3.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet3.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet3.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet3.Options.NoteFormat.Font.Bold = true; workSheet3.Options.NoteFormat.Font.Name = "Tahoma"; workSheet3.Options.NoteFormat.Font.Size = 8F; workSheet3.Options.TitlesFormat.Font.Bold = true; workSheet3.Options.TitlesFormat.Font.Name = "Arial"; workSheet3.SheetName = "Sheet 1"; workSheet3.SQLCommand = this.oleDbCommand1; workSheet3.StartDataCol = ((System.Byte)(0)); this.cellExport2.Sheets.Add(workSheet3); // // cellExport3 // this.cellExport3.DataFormats.CultureName = "zh-CN"; this.cellExport3.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport3.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport3.DataFormats.Float = "#,###,##0.00"; this.cellExport3.DataFormats.Integer = "#,###,##0"; this.cellExport3.DataFormats.Time = "H:mm"; cellPicture1.FileName = Server.MapPath("Images/sample.gif"); cellPicture1.Name = "Picture_0"; this.cellExport3.Pictures.Add(cellPicture1); this.cellExport3.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport3.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport3.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport3.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport3.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport3.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport3.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport3.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport3.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport3.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport3.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport3.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport3.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport3.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; this.cellExport3.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport3.SheetOptions.TitlesFormat.Font.Name = "Arial"; workSheet4.DataExported = false; workSheet4.FormatsExport.CultureName = "zh-CN"; workSheet4.FormatsExport.Currency = "гд#,###,##0.00"; workSheet4.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet4.FormatsExport.Float = "#,###,##0.00"; workSheet4.FormatsExport.Integer = "#,###,##0"; workSheet4.FormatsExport.Time = "H:mm"; cellImage1.Column = 1; cellImage1.PictureName = "Picture_0"; cellImage1.Row = 1; cellImage1.Title = "Image_0"; cellImage2.Column = 1; cellImage2.PictureName = "Picture_0"; cellImage2.Row = 16; cellImage2.Title = "Image_1"; workSheet4.Images.Add(cellImage1); workSheet4.Images.Add(cellImage2); workSheet4.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet4.Options.AggregateFormat.Font.Name = "Arial"; workSheet4.Options.CustomDataFormat.Font.Name = "Arial"; workSheet4.Options.DefaultFont.Name = "Arial"; workSheet4.Options.FooterFormat.Font.Name = "Arial"; workSheet4.Options.HeaderFormat.Font.Name = "Arial"; workSheet4.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet4.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet4.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet4.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet4.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet4.Options.NoteFormat.Font.Bold = true; workSheet4.Options.NoteFormat.Font.Name = "Tahoma"; workSheet4.Options.NoteFormat.Font.Size = 8F; workSheet4.Options.TitlesFormat.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet4.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet4.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet4.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet4.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet4.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet4.Options.TitlesFormat.Font.Bold = true; workSheet4.Options.TitlesFormat.Font.Name = "Arial"; workSheet4.SheetName = "Parts"; workSheet4.StartDataCol = ((System.Byte)(0)); this.cellExport3.Sheets.Add(workSheet4); // // cellExport5 // this.cellExport5.DataExported = false; this.cellExport5.DataFormats.CultureName = "zh-CN"; this.cellExport5.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport5.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport5.DataFormats.Float = "#,###,##0.00"; this.cellExport5.DataFormats.Integer = "#,###,##0"; this.cellExport5.DataFormats.Time = "H:mm"; this.cellExport5.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport5.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport5.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport5.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport5.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport5.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport5.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport5.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport5.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport5.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport5.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport5.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport5.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport5.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; this.cellExport5.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport5.SheetOptions.TitlesFormat.Font.Name = "Arial"; // // cellExport6 // this.cellExport6.DataFormats.CultureName = "zh-CN"; this.cellExport6.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport6.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport6.DataFormats.Float = "#,###,##0.00"; this.cellExport6.DataFormats.Integer = "#,###,##0"; this.cellExport6.DataFormats.Time = "H:mm"; this.cellExport6.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport6.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport6.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport6.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport6.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport6.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport6.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport6.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport6.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport6.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport6.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport6.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport6.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport6.SheetOptions.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.Gray40Percent; this.cellExport6.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport6.SheetOptions.TitlesFormat.Font.Name = "Arial"; workSheet5.AutoFitColWidth = true; chart1.CategoryLabelsColumn = "PartNo"; chart1.DataRangeSheet = ""; chart1.Position.AutoPosition.Placement = Spire.DataExport.XLS.ChartPlacement.Right; chartSeries1.DataColumn = "ListPrice"; chartSeries1.DataRangeSheet = ""; chart1.Series.Add(chartSeries1); chart1.Style = Spire.DataExport.XLS.ChartStyle.Pie3d; workSheet5.Charts.Add(chart1); workSheet5.FormatsExport.CultureName = "zh-CN"; workSheet5.FormatsExport.Currency = "гд#,###,##0.00"; workSheet5.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet5.FormatsExport.Float = "#,###,##0.00"; workSheet5.FormatsExport.Integer = "#,###,##0"; workSheet5.FormatsExport.Time = "H:mm"; stripStyle5.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle5.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle5.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle5.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle5.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightGreen; stripStyle5.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle5.Font.Name = "Arial"; stripStyle6.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle6.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle6.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle6.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle6.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; stripStyle6.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle6.Font.Name = "Arial"; workSheet5.ItemStyles.Add(stripStyle5); workSheet5.ItemStyles.Add(stripStyle6); workSheet5.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet5.Options.AggregateFormat.Font.Name = "Arial"; workSheet5.Options.CustomDataFormat.Font.Name = "Arial"; workSheet5.Options.DefaultFont.Name = "Arial"; workSheet5.Options.FooterFormat.Font.Name = "Arial"; workSheet5.Options.HeaderFormat.Font.Name = "Arial"; workSheet5.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet5.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet5.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet5.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet5.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet5.Options.NoteFormat.Font.Bold = true; workSheet5.Options.NoteFormat.Font.Name = "Tahoma"; workSheet5.Options.NoteFormat.Font.Size = 8F; workSheet5.Options.TitlesFormat.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet5.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet5.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet5.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet5.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet5.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet5.Options.TitlesFormat.Font.Bold = true; workSheet5.Options.TitlesFormat.Font.Name = "Arial"; workSheet5.SheetName = "Parts"; workSheet5.SQLCommand = this.oleDbCommand1; workSheet5.StartDataCol = ((System.Byte)(0)); this.cellExport6.Sheets.Add(workSheet5); // // cellExport7 // this.cellExport7.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport7.AutoFitColWidth = true; this.cellExport7.DataFormats.CultureName = "zh-CN"; this.cellExport7.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport7.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport7.DataFormats.Float = "#,###,##0.00"; this.cellExport7.DataFormats.Integer = "#,###,##0"; this.cellExport7.DataFormats.Time = "H:mm"; this.cellExport7.FileName = "chart2.xls"; this.cellExport7.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport7.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport7.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport7.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport7.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport7.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport7.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport7.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport7.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport7.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport7.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport7.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport7.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport7.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport7.SheetOptions.TitlesFormat.Font.Name = "Arial"; chart2.AutoColor = false; chart2.CategoryLabels.ColX = ((System.Byte)(1)); chart2.CategoryLabels.ColY = ((System.Byte)(1)); chart2.CategoryLabels.RowX = 1; chart2.CategoryLabels.RowY = 9; chart2.CategoryLabelsColumn = "PartNo"; chart2.DataRangeSheet = "Sheet 2"; chart2.Position.AutoPosition.Height = 23; chart2.Position.AutoPosition.Left = 1; chart2.Position.AutoPosition.Top = 1; chart2.Position.AutoPosition.Width = 11; chart2.Position.CustomPosition.X1 = ((System.Byte)(1)); chart2.Position.CustomPosition.X2 = ((System.Byte)(15)); chart2.Position.CustomPosition.Y1 = 1; chart2.Position.CustomPosition.Y2 = 30; chartSeries2.Color = Spire.DataExport.XLS.CellColor.Tan; chartSeries2.DataColumn = "Cost"; chartSeries2.DataRangeSheet = "Sheet 2"; chartSeries2.Title = "Cost"; chart2.Series.Add(chartSeries2); chart2.Style = Spire.DataExport.XLS.ChartStyle.Bar; chart2.Title = "Chart demo"; workSheet6.Charts.Add(chart2); workSheet6.DataExported = false; workSheet6.FormatsExport.CultureName = "zh-CN"; workSheet6.FormatsExport.Currency = "гд#,###,##0.00"; workSheet6.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet6.FormatsExport.Float = "#,###,##0.00"; workSheet6.FormatsExport.Integer = "#,###,##0"; workSheet6.FormatsExport.Time = "H:mm"; workSheet6.Options.AggregateFormat.Font.Name = "Arial"; workSheet6.Options.CustomDataFormat.Font.Name = "Arial"; workSheet6.Options.DefaultFont.Name = "Arial"; workSheet6.Options.FooterFormat.Font.Name = "Arial"; workSheet6.Options.HeaderFormat.Font.Bold = true; workSheet6.Options.HeaderFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet6.Options.HeaderFormat.Font.Name = "Arial"; workSheet6.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet6.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet6.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet6.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet6.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet6.Options.NoteFormat.Font.Bold = true; workSheet6.Options.NoteFormat.Font.Name = "Tahoma"; workSheet6.Options.NoteFormat.Font.Size = 8F; workSheet6.Options.TitlesFormat.Font.Bold = true; workSheet6.Options.TitlesFormat.Font.Name = "Times New Roman"; workSheet6.Options.TitlesFormat.Font.Size = 13F; workSheet6.SheetName = "charts"; workSheet6.StartDataCol = ((System.Byte)(0)); workSheet7.AutoFitColWidth = true; workSheet7.FormatsExport.CultureName = "zh-CN"; workSheet7.FormatsExport.Currency = "гд#,###,##0.00"; workSheet7.FormatsExport.DateTime = "yyyy-M-d H:mm"; workSheet7.FormatsExport.Float = "#,###,##0.00"; workSheet7.FormatsExport.Integer = "#,###,##0"; workSheet7.FormatsExport.Time = "H:mm"; stripStyle7.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle7.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle7.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle7.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle7.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightGreen; stripStyle7.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle7.Font.Name = "Arial"; stripStyle8.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle8.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle8.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle8.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; stripStyle8.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; stripStyle8.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; stripStyle8.Font.Name = "Arial"; workSheet7.ItemStyles.Add(stripStyle7); workSheet7.ItemStyles.Add(stripStyle8); workSheet7.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet7.Options.AggregateFormat.Font.Name = "Arial"; workSheet7.Options.CustomDataFormat.Font.Name = "Arial"; workSheet7.Options.DefaultFont.Name = "Arial"; workSheet7.Options.FooterFormat.Font.Name = "Arial"; workSheet7.Options.HeaderFormat.Font.Name = "Arial"; workSheet7.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet7.Options.HyperlinkFormat.Font.Name = "Arial"; workSheet7.Options.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; workSheet7.Options.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; workSheet7.Options.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; workSheet7.Options.NoteFormat.Font.Bold = true; workSheet7.Options.NoteFormat.Font.Name = "Tahoma"; workSheet7.Options.NoteFormat.Font.Size = 8F; workSheet7.Options.TitlesFormat.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet7.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet7.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet7.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet7.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet7.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet7.Options.TitlesFormat.Font.Bold = true; workSheet7.Options.TitlesFormat.Font.Name = "Arial"; workSheet7.SheetName = "Sheet 2"; workSheet7.SQLCommand = this.oleDbCommand1; workSheet7.StartDataCol = ((System.Byte)(0)); this.cellExport7.Sheets.Add(workSheet6); this.cellExport7.Sheets.Add(workSheet7); this.cellExport7.SQLCommand = this.oleDbCommand1; this.cellExport7.GetDataParams += new Spire.DataExport.Delegates.DataParamsEventHandler(this.cellExport1_GetDataParams); // // cellExport8 // this.cellExport8.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport8.ColumnsWidth.AddRange(new object[] { "100", "200"}); this.cellExport8.DataExported = false; this.cellExport8.DataFormats.CultureName = "zh-CN"; this.cellExport8.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport8.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport8.DataFormats.Float = "#,###,##0.00"; this.cellExport8.DataFormats.Integer = "#,###,##0"; this.cellExport8.DataFormats.Time = "H:mm"; this.cellExport8.FileName = "formula.xls"; this.cellExport8.SheetOptions.AggregateFormat.Font.Name = "Arial"; this.cellExport8.SheetOptions.CustomDataFormat.Font.Name = "Arial"; this.cellExport8.SheetOptions.DefaultFont.Name = "Arial"; this.cellExport8.SheetOptions.FooterFormat.Font.Name = "Arial"; this.cellExport8.SheetOptions.HeaderFormat.Font.Name = "Arial"; this.cellExport8.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport8.SheetOptions.HyperlinkFormat.Font.Name = "Arial"; this.cellExport8.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport8.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport8.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport8.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport8.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport8.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport8.SheetOptions.TitlesFormat.Font.Bold = true; this.cellExport8.SheetOptions.TitlesFormat.Font.Name = "Arial"; this.cellExport8.SQLCommand = this.oleDbCommand1; }