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() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); Spire.DataExport.XLS.WorkSheet workSheet1 = new Spire.DataExport.XLS.WorkSheet(); 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.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 workSheet4 = 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 workSheet5 = 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(); Spire.DataExport.XLS.WorkSheet workSheet6 = new Spire.DataExport.XLS.WorkSheet(); Spire.DataExport.XLS.ColumnFormat columnFormat1 = new Spire.DataExport.XLS.ColumnFormat(); 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(); 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.groupBox1 = new System.Windows.Forms.GroupBox(); this.txtCommandTxt1 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.button2 = new System.Windows.Forms.Button(); this.txtCommandText = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.txtConnectString = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.dgDetail = new System.Windows.Forms.DataGrid(); this.btnRun = new System.Windows.Forms.Button(); this.btnAbout = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.cellExport2 = new Spire.DataExport.XLS.CellExport(); this.button3 = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); this.button4 = new System.Windows.Forms.Button(); this.cellExport4 = new Spire.DataExport.XLS.CellExport(); this.button5 = new System.Windows.Forms.Button(); this.cellExport5 = new Spire.DataExport.XLS.CellExport(); this.cellExport3 = new Spire.DataExport.XLS.CellExport(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgDetail)).BeginInit(); this.SuspendLayout(); // // oleDbCommand1 // this.oleDbCommand1.CommandText = "select * from parts"; this.oleDbCommand1.Connection = this.oleDbConnection1; // // oleDbConnection1 // this.oleDbConnection1.ConnectionString = resources.GetString("oleDbConnection1.ConnectionString"); // // oleDbCommand2 // this.oleDbCommand2.CommandText = "select * from country"; this.oleDbCommand2.Connection = this.oleDbConnection1; // // cellExport1 // this.cellExport1.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport1.AutoFitColWidth = true; this.cellExport1.AutoFormula = true; this.cellExport1.DataFormats.CultureName = "zh-CN"; this.cellExport1.DataFormats.Currency = "$#,###,##0.00"; this.cellExport1.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport1.DataFormats.Float = "#,###,##0.00"; this.cellExport1.DataFormats.Integer = "#,###,##0"; this.cellExport1.DataFormats.Time = "H:mm"; this.cellExport1.FileName = "Sheets.xls"; this.cellExport1.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.Font.Bold = true; workSheet1.AutoFitColWidth = true; workSheet1.CustomFormats.AddRange(new object[] { "OnHand=#,##0", "OnOrder=#,##0", "Cost=#,##0.0000;-#,##0.0000"}); 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; 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; workSheet1.ItemStyles.Add(stripStyle1); workSheet1.ItemStyles.Add(stripStyle2); workSheet1.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet1.Options.HeaderFormat.Font.Bold = true; workSheet1.Options.HeaderFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet1.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.SheetName = "parts"; workSheet1.SQLCommand = this.oleDbCommand1; workSheet1.StartDataCol = ((byte)(0)); workSheet2.AutoFitColWidth = true; workSheet2.CustomFormats.AddRange(new object[] { "Area=#,##0", "Population=#,##0"}); 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; 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.Foreground = Spire.DataExport.XLS.CellColor.White; stripStyle4.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet2.ItemStyles.Add(stripStyle3); workSheet2.ItemStyles.Add(stripStyle4); workSheet2.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet2.Options.FooterFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet2.Options.HeaderFormat.Font.Bold = true; workSheet2.Options.HeaderFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet2.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.SheetName = "country"; workSheet2.SQLCommand = this.oleDbCommand2; workSheet2.StartDataCol = ((byte)(0)); this.cellExport1.Sheets.Add(workSheet1); this.cellExport1.Sheets.Add(workSheet2); this.cellExport1.SQLCommand = this.oleDbCommand1; this.cellExport1.GetDataParams += new Spire.DataExport.Delegates.DataParamsEventHandler(this.cellExport1_GetDataParams); // // groupBox1 // this.groupBox1.Controls.Add(this.txtCommandTxt1); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.button2); this.groupBox1.Controls.Add(this.txtCommandText); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.txtConnectString); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(16, 13); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(312, 203); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = " Data source "; // // txtCommandTxt1 // this.txtCommandTxt1.Location = new System.Drawing.Point(17, 144); this.txtCommandTxt1.Name = "txtCommandTxt1"; this.txtCommandTxt1.Size = new System.Drawing.Size(279, 21); this.txtCommandTxt1.TabIndex = 7; this.txtCommandTxt1.Text = "select * from country"; // // label3 // this.label3.Location = new System.Drawing.Point(16, 120); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(256, 23); this.label3.TabIndex = 6; this.label3.Text = "Command text for the second work sheet:"; // // button2 // this.button2.Location = new System.Drawing.Point(232, 173); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(64, 23); this.button2.TabIndex = 5; this.button2.Text = "Load"; this.button2.Click += new System.EventHandler(this.button2_Click); // // txtCommandText // this.txtCommandText.Location = new System.Drawing.Point(17, 95); this.txtCommandText.Name = "txtCommandText"; this.txtCommandText.Size = new System.Drawing.Size(279, 21); this.txtCommandText.TabIndex = 3; this.txtCommandText.Text = "select * from parts"; // // label2 // this.label2.Location = new System.Drawing.Point(16, 75); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(240, 23); this.label2.TabIndex = 2; this.label2.Text = "Command text for the first work sheet:"; // // txtConnectString // this.txtConnectString.Location = new System.Drawing.Point(16, 43); this.txtConnectString.Name = "txtConnectString"; this.txtConnectString.Size = new System.Drawing.Size(280, 21); this.txtConnectString.TabIndex = 1; this.txtConnectString.Text = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\\\\..\\\\..\\\\..\\\\database\\\\demo.mdb"; // // label1 // this.label1.Location = new System.Drawing.Point(15, 23); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(121, 16); this.label1.TabIndex = 0; this.label1.Text = "Connection string:"; // // dgDetail // this.dgDetail.DataMember = ""; this.dgDetail.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dgDetail.Location = new System.Drawing.Point(16, 224); this.dgDetail.Name = "dgDetail"; this.dgDetail.Size = new System.Drawing.Size(584, 128); this.dgDetail.TabIndex = 0; // // btnRun // this.btnRun.Location = new System.Drawing.Point(368, 24); this.btnRun.Name = "btnRun"; this.btnRun.Size = new System.Drawing.Size(96, 23); this.btnRun.TabIndex = 2; this.btnRun.Text = "Multi-Sheets"; this.btnRun.Click += new System.EventHandler(this.btnRun_Click); // // btnAbout // this.btnAbout.Location = new System.Drawing.Point(528, 368); this.btnAbout.Name = "btnAbout"; this.btnAbout.Size = new System.Drawing.Size(75, 23); this.btnAbout.TabIndex = 3; this.btnAbout.Text = "Close"; this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click); // // button1 // this.button1.Location = new System.Drawing.Point(368, 56); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(96, 23); this.button1.TabIndex = 2; this.button1.Text = "Chart1"; this.button1.Click += new System.EventHandler(this.button1_Click); // // cellExport2 // this.cellExport2.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport2.AutoFitColWidth = true; 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.FileName = "chart1.xls"; this.cellExport2.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.Font.Bold = true; workSheet3.AutoFitColWidth = true; chart1.CategoryLabels.ColX = ((byte)(1)); chart1.CategoryLabels.ColY = ((byte)(1)); chart1.CategoryLabels.RowX = 1; chart1.CategoryLabels.RowY = 9; chart1.CategoryLabelsColumn = "Name"; chart1.DataRangeSheet = "charts"; chart1.Position.AutoPosition.Height = 12; chart1.Position.AutoPosition.Top = 1; chart1.Position.AutoPosition.Width = 6; chartSeries1.DataColumn = "Population"; chartSeries1.DataRangeSheet = "charts"; chartSeries1.Title = "Population"; chart1.Series.Add(chartSeries1); chart1.Style = Spire.DataExport.XLS.ChartStyle.Pie3d; chart1.Title = "Chart demo"; workSheet3.Charts.Add(chart1); 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"; 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; 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; workSheet3.ItemStyles.Add(stripStyle5); workSheet3.ItemStyles.Add(stripStyle6); workSheet3.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet3.Options.HeaderFormat.Font.Bold = true; workSheet3.Options.HeaderFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet3.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.Borders.Bottom.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet3.Options.TitlesFormat.Borders.Left.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet3.Options.TitlesFormat.Borders.Right.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet3.Options.TitlesFormat.Borders.Top.Style = Spire.DataExport.XLS.CellBorderStyle.Medium; workSheet3.Options.TitlesFormat.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; workSheet3.Options.TitlesFormat.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.Solid; workSheet3.Options.TitlesFormat.Font.Bold = true; workSheet3.SheetName = "charts"; workSheet3.SQLCommand = this.oleDbCommand2; workSheet3.StartDataCol = ((byte)(0)); this.cellExport2.Sheets.Add(workSheet3); this.cellExport2.SQLCommand = this.oleDbCommand1; // // button3 // this.button3.Location = new System.Drawing.Point(368, 88); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(96, 23); this.button3.TabIndex = 2; this.button3.Text = "Misc"; this.button3.Click += new System.EventHandler(this.button3_Click); // // label4 // this.label4.ForeColor = System.Drawing.Color.Blue; this.label4.Location = new System.Drawing.Point(352, 136); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(240, 64); this.label4.TabIndex = 4; this.label4.Text = "Notes : Not needing to have Microsoft Excel installed on the machine, The Spire.D" + "ataExport can create Excel spreadsheet. "; // // button4 // this.button4.Location = new System.Drawing.Point(488, 56); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(88, 23); this.button4.TabIndex = 2; this.button4.Text = "Chart2"; this.button4.Click += new System.EventHandler(this.button4_Click); // // cellExport4 // this.cellExport4.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport4.AutoFitColWidth = true; this.cellExport4.DataFormats.CultureName = "zh-CN"; this.cellExport4.DataFormats.Currency = "гд#,###,##0.00"; this.cellExport4.DataFormats.DateTime = "yyyy-M-d H:mm"; this.cellExport4.DataFormats.Float = "#,###,##0.00"; this.cellExport4.DataFormats.Integer = "#,###,##0"; this.cellExport4.DataFormats.Time = "H:mm"; this.cellExport4.FileName = "chart2.xls"; this.cellExport4.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; this.cellExport4.SheetOptions.HyperlinkFormat.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.Single; this.cellExport4.SheetOptions.NoteFormat.Alignment.Horizontal = Spire.DataExport.XLS.HorizontalAlignment.Left; this.cellExport4.SheetOptions.NoteFormat.Alignment.Vertical = Spire.DataExport.XLS.VerticalAlignment.Top; this.cellExport4.SheetOptions.NoteFormat.Font.Bold = true; this.cellExport4.SheetOptions.NoteFormat.Font.Name = "Tahoma"; this.cellExport4.SheetOptions.NoteFormat.Font.Size = 8F; this.cellExport4.SheetOptions.TitlesFormat.Font.Bold = true; chart2.AutoColor = false; chart2.CategoryLabels.ColX = ((byte)(1)); chart2.CategoryLabels.ColY = ((byte)(1)); chart2.CategoryLabels.RowX = 1; chart2.CategoryLabels.RowY = 9; chart2.CategoryLabelsColumn = "Name"; 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 = ((byte)(1)); chart2.Position.CustomPosition.X2 = ((byte)(15)); chart2.Position.CustomPosition.Y1 = 1; chart2.Position.CustomPosition.Y2 = 30; chartSeries2.Color = Spire.DataExport.XLS.CellColor.Tan; chartSeries2.DataColumn = "Area"; chartSeries2.DataRangeSheet = "Sheet 2"; chartSeries2.Title = "Population"; chart2.Series.Add(chartSeries2); chart2.Style = Spire.DataExport.XLS.ChartStyle.Bar; chart2.Title = "Chart demo"; workSheet4.Charts.Add(chart2); 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"; workSheet4.Options.HeaderFormat.Font.Bold = true; workSheet4.Options.HeaderFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; workSheet4.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.Font.Bold = true; workSheet4.Options.TitlesFormat.Font.Name = "Times New Roman"; workSheet4.Options.TitlesFormat.Font.Size = 13F; workSheet4.SheetName = "charts"; workSheet4.StartDataCol = ((byte)(0)); workSheet5.AutoFitColWidth = true; 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"; 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; 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; workSheet5.ItemStyles.Add(stripStyle7); workSheet5.ItemStyles.Add(stripStyle8); workSheet5.ItemType = Spire.DataExport.XLS.CellItemType.Col; workSheet5.Options.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.SheetName = "Sheet 2"; workSheet5.SQLCommand = this.oleDbCommand2; workSheet5.StartDataCol = ((byte)(0)); this.cellExport4.Sheets.Add(workSheet4); this.cellExport4.Sheets.Add(workSheet5); this.cellExport4.SQLCommand = this.oleDbCommand1; // // button5 // this.button5.Location = new System.Drawing.Point(488, 24); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(88, 23); this.button5.TabIndex = 5; this.button5.Text = "Formula"; this.button5.Click += new System.EventHandler(this.button5_Click); // // cellExport5 // this.cellExport5.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; this.cellExport5.ColumnsWidth.AddRange(new object[] { "100", "200"}); 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.FileName = "formula.xls"; this.cellExport5.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.Font.Bold = true; this.cellExport5.SQLCommand = this.oleDbCommand1; // // cellExport3 // this.cellExport3.ActionAfterExport = Spire.DataExport.Common.ActionType.OpenView; 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"; this.cellExport3.FileName = "misc.xls"; this.cellExport3.SheetOptions.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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; columnFormat1.FieldName = "PartNo"; columnFormat1.Font.Bold = true; columnFormat2.FieldName = "VendorNo"; columnFormat2.Font.Color = Spire.DataExport.XLS.CellColor.Color1; columnFormat2.Font.Italic = true; columnFormat3.FieldName = "Description"; columnFormat3.Font.Strikeout = true; columnFormat3.Font.Underline = Spire.DataExport.XLS.XlsFontUnderline.DoubleAccounting; columnFormat4.FieldName = "OnHand"; columnFormat4.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightTurquoise; columnFormat4.FillStyle.Foreground = Spire.DataExport.XLS.CellColor.Pink; columnFormat4.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.ThinGorizontal; columnFormat5.FieldName = "ListPrice"; columnFormat5.FillStyle.Background = Spire.DataExport.XLS.CellColor.LightYellow; columnFormat5.FillStyle.Foreground = Spire.DataExport.XLS.CellColor.SkyBlue; columnFormat5.FillStyle.Pattern = Spire.DataExport.XLS.Pattern.ThinVertical; workSheet6.ColumnFormats.Add(columnFormat1); workSheet6.ColumnFormats.Add(columnFormat2); workSheet6.ColumnFormats.Add(columnFormat3); workSheet6.ColumnFormats.Add(columnFormat4); workSheet6.ColumnFormats.Add(columnFormat5); 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.HyperlinkFormat.Font.Color = Spire.DataExport.XLS.CellColor.Blue; 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.SheetName = "Sheet 1"; workSheet6.SQLCommand = this.oleDbCommand1; workSheet6.StartDataCol = ((byte)(0)); this.cellExport3.Sheets.Add(workSheet6); this.cellExport3.GetDataParams += new Spire.DataExport.Delegates.DataParamsEventHandler(this.cellExport1_GetDataParams); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(616, 398); this.Controls.Add(this.button5); this.Controls.Add(this.label4); this.Controls.Add(this.btnAbout); this.Controls.Add(this.btnRun); this.Controls.Add(this.dgDetail); this.Controls.Add(this.groupBox1); this.Controls.Add(this.button1); this.Controls.Add(this.button3); this.Controls.Add(this.button4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "Form1"; this.Text = "Cell demo"; this.Load += new System.EventHandler(this.Form1_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgDetail)).EndInit(); this.ResumeLayout(false); }
/// <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; }