/// <summary> /// Returns true if StatementBase instances are equal /// </summary> /// <param name="other">Instance of StatementBase to be compared</param> /// <returns>Boolean</returns> public bool Equals(StatementBase other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( PublishDate == other.PublishDate || PublishDate != null && PublishDate.Equals(other.PublishDate) ) && ( StatDate == other.StatDate || StatDate != null && StatDate.Equals(other.StatDate) )); }
public override bool Equals(object obj) { Game game = obj as Game; if (game == null) { return(false); } bool b = GameName == game.GameName && Publisher == game.Publisher && Country == game.Country && PublishDate.Equals(game.PublishDate); if (game.GenreList == null || !GenreList.Count.Equals(game.GenreList.Count)) { return(false); } if (b) { List <Genre> list1 = new List <Genre>(GenreList.OrderBy(i => i.IDGenre)); List <Genre> list2 = new List <Genre>(game.GenreList.OrderBy(i => i.IDGenre)); for (int i = 0; i < list1.Count(); i++) { b = list1[i].IDGenre.Equals(list2[i].IDGenre); } } else { return(false); } return(b); }
/// <summary> /// Formats string for display by replacing placeholder strings with actual values. /// </summary> /// <param name="Format">The <see cref="string"/></param> /// <returns>The <see cref="string"/></returns> public string FormatLine(string Format) { Dictionary <string, string> replacementTable = new Dictionary <string, string> { { "i", (Index + 1).ToString() }, { "n", Configuration.Instance.GetReadState(this.IsNew) }, { "D", Configuration.Instance.GetDownloadState(this.IsDownloaded) }, { "x", Configuration.Instance.GetDeletedState(this.Deleted) }, //only shown when article is marked as deleted, afterwards filtered out { "d", PublishDate.ToString(dateFormat) }, { "u", LastUpdated.ToString(dateFormat) }, { "t", Title }, { "s", Summary }, { "l", FeedUrl.ToString() }, { "V", Configuration.MAJOR_VERSION }, { "v", Configuration.VERSION } }; var line = Formatter.FormatLine(Format, replacementTable); if (this.IsProcessing) { return(Configuration.Instance.LoadingPrefix + line + Configuration.Instance.LoadingSuffix); } else { return(line); } }
public void Save() { String sqlUpdate = @" UPDATE Articles SET published_date = $published_date, title = $title, unread = $unread WHERE uri = $uri; "; String sqlInsert = @" INSERT INTO Articles ( feed_id, published_date, title, uri, unread ) SELECT $feed_id, $published_date, $title, $uri, $unread WHERE NOT EXISTS ( SELECT * FROM Articles WHERE uri = $uri ); "; using (SQLiteConnection m_dbConnection = new SQLiteConnection(Repository.ConnectionString)) { m_dbConnection.Open(); SQLiteCommand command = new SQLiteCommand(sqlUpdate, m_dbConnection); command.Parameters.AddWithValue("$published_date", PublishDate.ToString("s")); command.Parameters.AddWithValue("$title", Title); command.Parameters.AddWithValue("$unread", Unread); command.Parameters.AddWithValue("$uri", Location.ToString()); int rowcount = command.ExecuteNonQuery(); if (rowcount == 0) { command = new SQLiteCommand(sqlInsert, m_dbConnection); command.Parameters.AddWithValue("$feed_id", ParentFeed.Id); command.Parameters.AddWithValue("$published_date", PublishDate.ToString("s")); command.Parameters.AddWithValue("$title", Title); command.Parameters.AddWithValue("$unread", Unread); command.Parameters.AddWithValue("$uri", Location.ToString()); rowcount = command.ExecuteNonQuery(); if (rowcount == 0) { //something is wrong here: article already exists //I could reaload it from database } } } }
protected override void AddDescriptions() { base.AddDescriptions(); AddDescription(nameof(Title), Title.ToStr()); AddDescription(nameof(PublishDate), PublishDate.ToStr()); AddDescription(nameof(Content), Content.ToStr()); AddDescription(nameof(CategoryId), CategoryId.ToStr()); }
///<summary>Saves this UpdateVersion to an XML element.</summary> public XElement ToXml() { return(new XElement("Version", new XAttribute("PublishDate", PublishDate.ToString("F", CultureInfo.InvariantCulture)), new XAttribute("Version", Version.ToString()), new XText(Changes) )); }
public override int GetHashCode() { return(ID.GetHashCode() ^ AuthorID.GetHashCode() ^ PublishDate.GetHashCode() ^ ByteSize.GetHashCode() ^ Title.GetHashCode()); }
public Product Add() { string sql = @"INSERT INTO Product (Title, Description, Price, PublishDate, LastDate, SellerId, Image) VALUES ('" + Title + "', '" + Description + "', " + Price + ", " + PublishDate.ToString("dd-mm-yyyy") + ", " + LastDate.ToString("dd-mm-yyyy") + ", " + SellerId + ", '" + Image + "')"; var _id = Db.executeandGetId(sql); Id = int.Parse(_id); return(this); }
public override int GetHashCode() { unchecked { int hashCode = (Id != null ? Id.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Subject != null ? Subject.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Source != null ? Source.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PublishDate.GetHashCode(); return(hashCode); } }
public override bool Equals(object obj) { Comment comment = obj as Comment; if (comment == null) { return(false); } return(Nickname == comment.Nickname && Email == comment.Email && CommentContent.Trim() == comment.CommentContent.Trim() && CommentedGameRefID == comment.CommentedGameRefID && PublishDate.Equals(PublishDate)); }
/// <summary> /// WriteXml converts the object to Xml (serializes it) and writes it using the XmlWriter passed /// </summary> /// <remarks></remarks> /// <param name="writer">The XmlWriter that contains the xml for the object</param> public void WriteXml(XmlWriter writer) { writer.WriteStartElement("Announcement"); writer.WriteElementString("ItemID", ItemID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("ModuleID", ModuleID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Title", Title); writer.WriteElementString("URL", URL); writer.WriteElementString("ViewOrder", ViewOrder.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Description", Description); writer.WriteElementString("ImageSource", ImageSource); writer.WriteElementString("TrackClicks", TrackClicks.ToString()); writer.WriteElementString("NewWindow", NewWindow.ToString()); writer.WriteElementString("PublishDate", PublishDate.ToString()); writer.WriteElementString("ExpireDate", ExpireDate.ToString()); writer.WriteEndElement(); }
public override int GetHashCode() { var hash = 17; hash *= 31 + Author != null?Author.GetHashCode() : 0; hash *= 31 + Title != null?Title.GetHashCode() : 0; hash *= 31 + Genre != null?Genre.GetHashCode() : 0; hash *= 31 + Price.GetHashCode(); hash *= 31 + PublishDate.GetHashCode(); hash *= 31 + Description != null?Description.GetHashCode() : 0; return(hash); }
private string FormatFileName(string format) { var fullPath = format .Replace("%i", Index.ToString().PadLeft(3)) .Replace("%n", Configuration.Instance.GetReadState(this.IsNew)) .Replace("%d", PublishDate.ToString(dateFormat)) .Replace("%t", Title) .Replace("%l", FeedUrl.ToString()); var pathEndsAt = fullPath.LastIndexOf('\\'); string result; if (pathEndsAt > 0) { var pathOnly = fullPath.Substring(0, pathEndsAt).SanitizePath(); var fileNameOnly = fullPath.Substring(pathEndsAt, fullPath.Length - pathEndsAt).SanitizeFileName(); //Limit full path length to 260 chars to avoid System.IO.PathTooLongException if (System.IO.Path.GetFullPath(pathOnly).Length + fileNameOnly.Length > 260) { int dotPosition = fileNameOnly.LastIndexOf(".", StringComparison.InvariantCulture); string fileName = fileNameOnly.Substring(0, dotPosition); string extension = fileNameOnly.Substring(dotPosition, fileNameOnly.Length - dotPosition); fileNameOnly = fileName.Substring(0, fileName.Length - System.IO.Path.GetFullPath(pathOnly).Length - extension.Length) + extension; } result = pathOnly + "\\" + fileNameOnly; } else { result = fullPath.SanitizeFileName(); } if (!Path.IsPathRooted(result)) { result = System.IO.Path.GetFullPath(result); } return(result); }
/// <summary> /// Get the significant details of what needs approval /// </summary> /// <returns>A list of strings</returns> public override IDictionary <string, string> SignificantDetails() { IDictionary <string, string> returnList = base.SignificantDetails(); returnList.Add("Subject", Name); returnList.Add("Body", Body); returnList.Add("Publish Date", PublishDate.ToString()); returnList.Add("Expire Date", ExpireDate.ToString()); returnList.Add("Force Expired", Expired.ToString()); returnList.Add("Public", Public.ToString()); returnList.Add("Minimum Read Level", MinimumReadLevel.ToString()); foreach (string tag in Tags) { returnList.Add("Tag", tag); } return(returnList); }
public NoticiaNavItem(Noticia objNoticia, bool firstTitle) { FirstTitle = firstTitle; HasThumb = !string.IsNullOrEmpty(objNoticia.ImgThumb); IsVideo = objNoticia.DestaqueId == Destaque.Video.Id && !string.IsNullOrEmpty(objNoticia.Video); IsGaleria = objNoticia.DestaqueId == Destaque.Galeria.Id && objNoticia.Galeria.Imagens.Any(); if (IsGaleria) { GaleriaImgCount = objNoticia.Galeria.Imagens.Count(); } NewsId = objNoticia.Id; PublishDate = objNoticia.DataPublicacao.Value; DateShow = PublishDate.Date == DateTime.Today ? PublishDate.ToString("HH\\hmm") : PublishDate.ToString("dd \\de MMM"); NewsUrl = $"{objNoticia.UrlFull}.html"; Chamada = objNoticia.Chamada; ImgThumb = $"{Constants.UrlDominioEstaticoUploads}/noticias/{objNoticia.ImgThumb}"; }
public NoticiaNavItem(Estabelecimento establishment, bool firstTitle) { FirstTitle = firstTitle; HasThumb = !string.IsNullOrEmpty(establishment.ImgThumb); IsVideo = establishment.DestaqueId == Destaque.Video.Id && !string.IsNullOrEmpty(establishment.Video); IsGaleria = establishment.DestaqueId == Destaque.Galeria.Id; if (IsGaleria) { GaleriaImgCount = establishment.Galeria.Imagens.Count(); } NewsId = establishment.Id; PublishDate = establishment.DataCadastro; DateShow = PublishDate.Date == DateTime.Today ? PublishDate.ToString("HH\\hmm") : PublishDate.ToString("dd \\de MMM"); NewsUrl = $"{establishment.UrlFull}.html"; Chamada = establishment.Titulo; ImgThumb = $"{Constants.UrlDominioEstaticoUploads}/noticias/{establishment.ImgThumb}"; }
public string ToString(out StringBuilder sbHeader) { sbHeader = new StringBuilder(); sbHeader.Append("Region, PublishedDateTime, Day1Date, SpecialStatement, BottomLineSummary, ForecastUrl, "); sbHeader.Append("Day1DangerAboveTreeline, Day1DangerNearTreeline, Day1DangerBelowTreeline, Day1DetailedForecast, Day1Warning, Day1WarningEnd, Day1WarningText, "); sbHeader.Append("Day2DangerAboveTreeline, Day2DangerNearTreeline, Day2DangerBelowTreeline, Day2DetailedForecast, Day2Warning, Day2WarningEnd, Day2WarningText, "); var sbBody = new StringBuilder(); sbBody.Append(Zone + ","); sbBody.Append(PublishDate.ToUniversalTime().ToString("yyyyMMdd HH:00" + ",")); sbBody.Append(Day1Date.ToUniversalTime().ToString("yyyyMMdd") + ","); sbBody.Append(Utilities.CleanStringForCSVExport(SpecialStatement) + ","); //replace commas and quotes & \n since we are exporting to csv sbBody.Append(Utilities.CleanStringForCSVExport(BottomLineSummary) + ","); sbBody.Append(ResourceUri + ","); sbBody.Append(Day1DangerElevationHigh + ","); sbBody.Append(Day1DangerElevationMiddle + ","); sbBody.Append(Day1DangerElevationLow + ","); sbBody.Append(Utilities.CleanStringForCSVExport(Day1DetailedForecast) + ","); sbBody.Append(Utilities.CleanStringForCSVExport(Day1Warning) + ","); sbBody.Append((Day1WarningEnd.HasValue ? Day1WarningEnd.Value.ToUniversalTime().ToString("yyyyMMdd HH:00") + "," : DateTime.MinValue.ToString("yyyyMMdd HH:00") + ",")); sbBody.Append(Utilities.CleanStringForCSVExport(Day1WarningText) + ","); sbBody.Append(Day2DangerElevationHigh + ","); sbBody.Append(Day2DangerElevationMiddle + ","); sbBody.Append(Day2DangerElevationLow + ","); sbBody.Append(Utilities.CleanStringForCSVExport(Day2DetailedForecast) + ","); sbBody.Append(Utilities.CleanStringForCSVExport(Day2Warning) + ","); sbBody.Append((Day2WarningEnd.HasValue ? Day2WarningEnd.Value.ToUniversalTime().ToString("yyyyMMdd HH:00") + "," : DateTime.MinValue.ToString("yyyyMMdd HH:00") + ",")); sbBody.Append(Utilities.CleanStringForCSVExport(Day2WarningText) + ","); ExtractAvalancheProblem("Cornices", sbHeader, sbBody); ExtractAvalancheProblem("Glide", sbHeader, sbBody); ExtractAvalancheProblem("Loose Dry", sbHeader, sbBody); ExtractAvalancheProblem("Loose Wet", sbHeader, sbBody); ExtractAvalancheProblem("Persistent Slab", sbHeader, sbBody); ExtractAvalancheProblem("Deep Persistent Slab", sbHeader, sbBody); //TODO: need to check this is actually what NWAC uses ExtractAvalancheProblem("Storm Slabs", sbHeader, sbBody); ExtractAvalancheProblem("Wet Slabs", sbHeader, sbBody); ExtractAvalancheProblem("Wind Slab", sbHeader, sbBody); return(sbBody.ToString()); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (PublishDate != null) { hashCode = hashCode * 59 + PublishDate.GetHashCode(); } if (StatDate != null) { hashCode = hashCode * 59 + StatDate.GetHashCode(); } return(hashCode); } }
private bool Equals(Article other) { bool authorsEquals = Authors.Count == other.Authors.Count; if (!authorsEquals) { return(false); } for (int i = 0; i < Authors.Count; i++) { authorsEquals = Authors[i].Equals(other.Authors[i]); if (!authorsEquals) { return(false); } } return(string.Equals(Id, other.Id) && string.Equals(Source, other.Source) && string.Equals(Subject, other.Subject) && string.Equals(Title, other.Title) && PublishDate.Equals(other.PublishDate) && LastUpdateTime.Equals(other.LastUpdateTime) && Content.Equals(other.Content) && authorsEquals && string.Equals(Summary, other.Summary)); }
public bool IsPublished(DateTime now) { return(PublishDate.IsPublished(now)); }
public override int GetHashCode() { return(((int)Name?.GetHashCode() + (int)Author?.GetHashCode() + PublishDate.GetHashCode()) ^ PageNumber); }
public string GetPublishDateFormatted() { return(PublishDate.ToString("f")); }
public string GetDataLikeString() { string result = MangaId.ToString() + "|" + Name + "|" + PublishDate.GetDateTime() + "|" + PageNumbers.ToString() + "|" + Colorization.ToString(); return(result); }
public void Publish() { Console.WriteLine($"{User.NickName}\t在{PublishDate?.ToString("D")}发布了一篇标题为《{Title}》的文章"); }
public MemoryStream GetExcelPackage() { using (var fs = new MemoryStream()) { var workbook = new XSSFWorkbook(); var sheet = workbook.CreateSheet(SheetName); sheet.DefaultColumnWidth = 4; sheet.DisplayGridlines = false; SetCell(workbook, sheet, 2, 2, 22, 29, $"発行年月日 {PublishDate.ToString("yyyy年MM月dd日")}", 12, false, BorderStyle.None, false, 700); SetCell(workbook, sheet, 5, 11, 1, 13, $"{ToCompany} 御中", 10, true, BorderStyle.Medium, true); SetCell(workbook, sheet, 5, 5, 17, 29, FromCompany, 12, false, BorderStyle.None, false); SetCell(workbook, sheet, 6, 6, 17, 29, FromDepartment, 12, false, BorderStyle.None, true); //设置标题 var titleFont = workbook.CreateFont(); titleFont.FontHeightInPoints = 16; titleFont.Underline = FontUnderlineType.Single; SetCell(workbook, sheet, 16, 17, 0, 30, titleFont, titleFont, false, BorderStyle.None, true); //设置周期 var periodFont = workbook.CreateFont(); periodFont.FontHeightInPoints = 14; periodFont.Underline = FontUnderlineType.Single; SetCell(workbook, sheet, 20, 20, 1, 12, Period.ToString("yyyy年MM月度"), periodFont, false, BorderStyle.None, true); #region 代理商信息 SetCell(workbook, sheet, 22, 23, 1, 4, "代理店コード", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 22, 23, 5, 13, AgentMessage.AgentCode, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 1, 4, "振込日", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 5, 13, AgentMessage.DemittanceDate?.ToString("yyyy年MM月dd日"), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 1, 4, "振込金額", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 5, 13, AgentMessage.DemittanceAmount.ToString(), 12, true, BorderStyle.Thin, true); //SetBoard(sheet, 22, 27, 1, 13, BorderStyle.Medium); #endregion #region 代理商帐户信息 SetCell(workbook, sheet, 22, 23, 17, 20, "金融機関名", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 22, 23, 21, 29, AgentAccount.BankName, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 17, 20, "支店名", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 21, 29, AgentAccount.BranchBankName, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 17, 20, "口座番号", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 21, 22, AgentAccount.AccountMode, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 23, 29, AgentAccount.Account, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 28, 29, 17, 20, "口座名義", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 28, 29, 21, 29, AgentAccount.AccountOwner, 12, true, BorderStyle.Thin, true); #endregion #region 列表 SetCell(workbook, sheet, 32, 32, 1, 1, null, 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 2, 4, "コード", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 5, 9, "加盟店", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 10, 14, "対象期間", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 15, 18, "決済利用額", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 19, 21, "手数料率", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 22, 25, "手数料額", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 26, 29, "備考", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); var rowIndex = 33; var sn = 1; var total = 0m; foreach (var item in Data) { total += item.RateAmount; SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, sn++.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, item.Code, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, item.Name, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, item.TimeSection, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, item.Amount.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, item.Rate.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, item.RateAmount.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, item.Memo, 12, true, BorderStyle.Thin, true); rowIndex++; } SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, "計", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, "税抜き", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, total.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, "", 12, true, BorderStyle.Thin, true); #endregion workbook.Write(fs); return(fs); } }
/// <summary> /// Provides a string representation of the current item /// </summary> /// <returns>The title of the feed item</returns> public override string ToString() { return(PublishDate.ToString().PadRight(20) + Title); }
public String ToCSV() { return($"{TumbleNumber};{ISBN};{Title};{Genre};{PublishDate.ToString("dd/MM/yyyy")};{Author}"); }
public MemoryStream GetExcelPackage() { using (var fs = new MemoryStream()) { var workbook = new HSSFWorkbook(); //var img = Image.FromFile(System.IO.Directory.GetCurrentDirectory() + "/gitea-sm.png"); //var stream = new MemoryStream();// img.Size //img.Save(stream, System.Drawing.Imaging.ImageFormat.Png); //FileStream stream = new FileStream(System.IO.Directory.GetCurrentDirectory() + "/gitea-sm.png", FileMode.Open, FileAccess.Read); //var arr = new byte[stream.Length]; //stream.Read(arr, 0, arr.Length); //var arr = File.ReadAllBytes(System.IO.Directory.GetCurrentDirectory() + "/gitea-sm.png"); // workbook.AddPicture(arr, PictureType.PNG); //stream.Close(); LoadStyle(workbook); var sheet = workbook.CreateSheet(SheetName); //添加图片 var data = File.ReadAllBytes(System.IO.Directory.GetCurrentDirectory() + "/gitea-sm.png"); var pictureIndex = workbook.AddPicture(data, PictureType.PNG); var helper = workbook.GetCreationHelper(); var drawing = sheet.CreateDrawingPatriarch(); var anchor = helper.CreateClientAnchor(); anchor.Col1 = 0; //0 index based column anchor.Row1 = 0; //0 index based row var picture = drawing.CreatePicture(anchor, pictureIndex); picture.Resize(1, 2); sheet.DefaultColumnWidth = 4; sheet.DisplayGridlines = false; SetCell(workbook, sheet, 2, 2, 22, 29, $"発行年月日 {PublishDate.ToString("yyyy年MM月dd日")}", _style12); SetCell(workbook, sheet, 5, 11, 1, 13, $"{ToCompany} 御中", _style10); SetCell(workbook, sheet, 5, 5, 17, 29, FromCompany, _style12); SetCell(workbook, sheet, 6, 6, 17, 29, FromDepartment, _style11); ////设置标题 SetCell(workbook, sheet, 16, 17, 0, 30, Title, _style16); //设置周期 SetCell(workbook, sheet, 20, 20, 1, 12, Period.ToString("yyyy年MM月度"), _style14); #region 代理商信息 SetCell(workbook, sheet, 22, 23, 1, 4, "代理店コード", _styleTopLeft); SetCell(workbook, sheet, 22, 23, 5, 13, AgentMessage.AgentCode, _styleTopRight); SetCell(workbook, sheet, 24, 25, 1, 4, "振込日", _styleLeft); SetCell(workbook, sheet, 24, 25, 5, 13, AgentMessage.DemittanceDate?.ToString("yyyy年MM月dd日"), _styleRight); SetCell(workbook, sheet, 26, 27, 1, 4, "振込金額", _styleBottomLeft); SetCell(workbook, sheet, 26, 27, 5, 13, AgentMessage.DemittanceAmount.ToString(), _styleBottomRight); #endregion #region 代理商帐户信息 SetCell(workbook, sheet, 22, 23, 17, 20, "金融機関名", _styleTopLeft); SetCell(workbook, sheet, 22, 23, 21, 29, AgentAccount.BankName, _styleTopRight); SetCell(workbook, sheet, 24, 25, 17, 20, "支店名", _styleLeft); SetCell(workbook, sheet, 24, 25, 21, 29, AgentAccount.BranchBankName, _styleRight); SetCell(workbook, sheet, 26, 27, 17, 20, "口座番号", _styleLeft); SetCell(workbook, sheet, 26, 27, 21, 22, AgentAccount.AccountMode, _dataStyle); SetCell(workbook, sheet, 26, 27, 23, 29, AgentAccount.Account, _styleRight); SetCell(workbook, sheet, 28, 29, 17, 20, "口座名義", _styleBottomLeft); SetCell(workbook, sheet, 28, 29, 21, 29, AgentAccount.AccountOwner, _styleBottomRight); #endregion #region 列表 HSSFPalette palette = workbook.GetCustomPalette(); //调色板实例 palette.SetColorAtIndex(11, 252, 228, 214); _colotStyle.FillForegroundColor = 11; SetCell(workbook, sheet, 32, 32, 1, 1, null, _colotStyle); SetCell(workbook, sheet, 32, 32, 2, 4, "コード", _colotStyle); SetCell(workbook, sheet, 32, 32, 5, 9, "加盟店", _colotStyle); SetCell(workbook, sheet, 32, 32, 10, 14, "対象期間", _colotStyle); SetCell(workbook, sheet, 32, 32, 15, 18, "決済利用額", _colotStyle); SetCell(workbook, sheet, 32, 32, 19, 21, "手数料率", _colotStyle); SetCell(workbook, sheet, 32, 32, 22, 25, "手数料額", _colotStyle); SetCell(workbook, sheet, 32, 32, 26, 29, "備考", _colotStyle); var rowIndex = 33; var sn = 1; var total = 0m; foreach (var item in Data) { total += item.RateAmount; SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, sn++.ToString(), _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, item.Code, _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, item.Name, _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, item.TimeSection, _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, item.Amount.ToString(), _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, item.Rate.ToString(), _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, item.RateAmount.ToString(), _dataStyle); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, item.Memo, _dataStyle); rowIndex++; } SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, "計", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, "", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, "", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, "税抜き", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, "", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, "", _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, total.ToString(), _styleTotal); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, "", _styleTotal); #endregion workbook.Write(fs); return(fs); } }
public ExcelPackage GetExcelPackage() { //表格边框色 var baseColor = Color.Black; var package = new ExcelPackage(); var worksheet = package.Workbook.Worksheets.Add(SheetName); worksheet.View.ShowGridLines = false; worksheet.DefaultColWidth = 5; //添加图片 var img = worksheet.Drawings.AddPicture("gitea", Image.FromFile(System.IO.Directory.GetCurrentDirectory() + "/gitea-sm.png")); img.SetPosition(80, 500); img.SetSize(60, 60); //R3 C23-30 worksheet.Cells[3, 23, 3, 30].Merge = true;//合并单元格 worksheet.Cells[3, 23, 3, 30].Style.Font.Size = 12; worksheet.Cells[3, 23, 3, 30].Value = PublishDate.ToString("発行年月日 yyyy年MM月dd日"); //R6 C18 worksheet.Cells[6, 18].Value = FromCompany; worksheet.Cells[6, 18].Style.Font.Size = 12; //R7 C18 worksheet.Cells[7, 18].Value = FromDepartment; worksheet.Cells[7, 18].Style.Font.Size = 11; //R6-12 C2-14 worksheet.Cells[6, 2, 12, 14].Style.Border.BorderAround(ExcelBorderStyle.Medium, baseColor); //R2 C2-14 worksheet.Cells[9, 2, 9, 14].Merge = true;//合并单元格 worksheet.Cells[9, 2, 9, 14].Value = ToCompany + " 御中"; worksheet.Cells[9, 2, 9, 14].Style.Font.Size = 12; worksheet.Cells[9, 2, 9, 14].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[9, 2, 9, 14].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 //R17-18 C1-31 worksheet.Cells[17, 1, 18, 31].Merge = true; //合并单元格 worksheet.Cells[17, 1, 18, 31].Value = Title; worksheet.Cells[17, 1, 18, 31].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[17, 1, 18, 31].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 worksheet.Cells[17, 1, 18, 31].Style.Font.Size = 16; worksheet.Cells[17, 1, 18, 31].Style.Font.Bold = true; worksheet.Cells[17, 1, 18, 31].Style.Font.UnderLine = true; worksheet.Cells[17, 1, 18, 31].Style.Font.UnderLineType = ExcelUnderLineType.Single; //R21 C2-13 worksheet.Cells[21, 2, 21, 13].Merge = true;//合并单元格 worksheet.Cells[21, 2, 21, 13].Value = Period.ToString("yyyy年MM月度"); worksheet.Cells[21, 2, 21, 13].Style.Font.Size = 14; worksheet.Cells[21, 2, 21, 13].Style.Font.UnderLine = true; worksheet.Cells[21, 2, 21, 13].Style.Font.UnderLineType = ExcelUnderLineType.Single; #region 代理商信息 R23-28 C2-14 //设置代理商信息 void SetAgentMessageCell(int r, int c, int tor, int toc, dynamic value) { worksheet.Cells[r, c, tor, toc].Merge = true;//合并单元格 worksheet.Cells[r, c, tor, toc].Value = value; worksheet.Cells[r, c, tor, toc].Style.Font.Size = 12; worksheet.Cells[r, c, tor, toc].Style.Border.BorderAround(ExcelBorderStyle.Thin, baseColor); worksheet.Cells[r, c, tor, toc].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[r, c, tor, toc].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 } //R23-24 C2-5 SetAgentMessageCell(23, 2, 24, 5, "代理店コード"); //R23-24 C6-14 SetAgentMessageCell(23, 6, 24, 14, AgentMessage.AgentCode); //R25-26 C2-5 SetAgentMessageCell(25, 2, 26, 5, "振込日"); //R25-26 C6-14 SetAgentMessageCell(25, 6, 26, 14, AgentMessage.DemittanceDate); //R27-28 C2-5 SetAgentMessageCell(27, 2, 28, 5, "振込金額"); //R27-28 C6-14 SetAgentMessageCell(27, 6, 28, 14, AgentMessage.DemittanceAmount); //R23-28 C2-14 worksheet.Cells[23, 2, 28, 14].Style.Border.BorderAround(ExcelBorderStyle.Medium, baseColor); #endregion #region 代理产帐户 R23-30 C18-30 //设置帐户内容 void SetAgentAccountCell(int r, int c, int tor, int toc, dynamic value) { worksheet.Cells[r, c, tor, toc].Merge = true;//合并单元格 worksheet.Cells[r, c, tor, toc].Value = value; worksheet.Cells[r, c, tor, toc].Style.Font.Size = 12; worksheet.Cells[r, c, tor, toc].Style.Border.BorderAround(ExcelBorderStyle.Thin, baseColor); worksheet.Cells[r, c, tor, toc].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[r, c, tor, toc].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 } //R23-24 C18-21 SetAgentAccountCell(23, 18, 24, 21, "金融機関名"); //R23-24 C22-30 SetAgentAccountCell(23, 22, 24, 30, AgentAccount.BankName); //R25-26 C18-21 SetAgentAccountCell(25, 18, 26, 21, "支店名"); //R25-26 C22-30 SetAgentAccountCell(25, 22, 26, 30, AgentAccount.BranchBankName); //R27-28 C18-21 SetAgentAccountCell(27, 18, 28, 21, "口座番号"); //R27-28 C22-23 SetAgentAccountCell(27, 22, 28, 23, AgentAccount.AccountMode); //R27-28 C24-30 SetAgentAccountCell(27, 24, 28, 30, AgentAccount.Account); //R29-30 C18-21 SetAgentAccountCell(29, 18, 30, 21, "口座名義"); //R29-30 C22-30 SetAgentAccountCell(29, 22, 30, 30, AgentAccount.AccountOwner); //R23-30 C18-30 worksheet.Cells[23, 18, 30, 30].Style.Border.BorderAround(ExcelBorderStyle.Medium, baseColor); #endregion #region 数据表格填充 int dataRowHeight = 25; #region 设置列表标题 void SetTitle(int r, int c, int tor, int toc, string value) { worksheet.Row(r).Height = dataRowHeight; worksheet.Cells[r, c, tor, toc].Merge = true;//合并单元格 worksheet.Cells[r, c, tor, toc].Value = value; worksheet.Cells[r, c, tor, toc].Style.Font.Size = 12; worksheet.Cells[r, c, tor, toc].Style.Border.BorderAround(ExcelBorderStyle.Thin, baseColor); worksheet.Cells[r, c, tor, toc].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[r, c, tor, toc].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 worksheet.Cells[r, c, tor, toc].Style.Fill.PatternType = ExcelFillStyle.Solid; worksheet.Cells[r, c, tor, toc].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(252, 228, 214)); } //R33 C2-2 SetTitle(33, 2, 33, 2, ""); //R33 C3-5 SetTitle(33, 3, 33, 5, "コード"); //R33 C6-10 SetTitle(33, 6, 33, 10, "加盟店"); //R33 C11-15 SetTitle(33, 11, 33, 15, "対象期間"); //R33 C16-19 SetTitle(33, 16, 33, 19, "決済利用額"); //R33 C20-22 SetTitle(33, 20, 33, 22, "手数料率"); //R33 C23-26 SetTitle(33, 23, 33, 26, "手数料額"); //R33 C27-30 SetTitle(33, 27, 33, 30, "備考"); #endregion #region 设置列表内容 void SetContent(int r, int c, int tor, int toc, dynamic value) { worksheet.Row(r).Height = dataRowHeight; worksheet.Cells[r, c, tor, toc].Merge = true;//合并单元格 worksheet.Cells[r, c, tor, toc].Value = value; worksheet.Cells[r, c, tor, toc].Style.Font.Size = 12; worksheet.Cells[r, c, tor, toc].Style.Border.BorderAround(ExcelBorderStyle.Thin, baseColor); worksheet.Cells[r, c, tor, toc].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[r, c, tor, toc].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 } int beginRow = 34; decimal total = 0; int sn = 1; foreach (var item in Data) { total += item.RateAmount; //C2-2 SetContent(beginRow, 2, beginRow, 2, sn++); //C3-5 SetContent(beginRow, 3, beginRow, 5, item.Code); //C6-10 SetContent(beginRow, 6, beginRow, 10, item.Name); //C11-15 SetContent(beginRow, 11, beginRow, 15, item.TimeSection); //C16-19 SetContent(beginRow, 16, beginRow, 19, item.Amount); //C20-22 SetContent(beginRow, 20, beginRow, 22, item.Rate); //C23-26 SetContent(beginRow, 23, beginRow, 26, item.RateAmount); //C27-30 SetContent(beginRow, 27, beginRow, 30, item.Memo); beginRow++; } #endregion #region 设置汇总行 void SetTotal(int r, int c, int tor, int toc, dynamic value) { worksheet.Row(r).Height = dataRowHeight; worksheet.Cells[r, c, tor, toc].Merge = true;//合并单元格 worksheet.Cells[r, c, tor, toc].Value = value; worksheet.Cells[r, c, tor, toc].Style.Font.Size = 12; worksheet.Cells[r, c, tor, toc].Style.Border.BorderAround(ExcelBorderStyle.Thin, baseColor); worksheet.Cells[r, c, tor, toc].Style.Border.Top.Style = ExcelBorderStyle.Double; worksheet.Cells[r, c, tor, toc].Style.Border.Top.Color.SetColor(baseColor); worksheet.Cells[r, c, tor, toc].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; //水平居中 worksheet.Cells[r, c, tor, toc].Style.VerticalAlignment = ExcelVerticalAlignment.Center; //垂直居中 } //C2-2 SetTotal(beginRow, 2, beginRow, 2, "計"); //C3-5 SetTotal(beginRow, 3, beginRow, 5, ""); //C6-10 SetTotal(beginRow, 6, beginRow, 10, ""); //C11-15 SetTotal(beginRow, 11, beginRow, 15, "税抜き"); //C16-19 SetTotal(beginRow, 16, beginRow, 19, ""); //C20-22 SetTotal(beginRow, 20, beginRow, 22, ""); //C23-26 SetTotal(beginRow, 23, beginRow, 26, total); //C27-30 SetTotal(beginRow, 27, beginRow, 30, ""); #endregion #endregion return(package); }
public MemoryStream GetExcelPackage() { using (var fs = new MemoryStream()) { var workbook = new SXSSFWorkbook(); workbook.RandomAccessWindowSize = 1000; var sheet = workbook.CreateSheet(SheetName) as SXSSFSheet; for (var r = 0; r < 50 + Data.Count; r++) { var newrow = sheet.CreateRow(r); for (var c = 0; c < 40; c++) { newrow.CreateCell(c); } } sheet.DefaultColumnWidth = 4; sheet.DisplayGridlines = false; //var rang = new CellRangeAddress(0, 1, 1, 10); //var merI = sheet.AddMergedRegion(rang); //var row = sheet._rows[0]; //var cell = row.Cells[1]; //var style = workbook.CreateCellStyle(); //var font = workbook.CreateFont(); //font.FontHeightInPoints = 16; //style.SetFont(font); //style.BorderTop = BorderStyle.Medium; //style.BorderLeft = BorderStyle.Medium; //style.BorderRight = BorderStyle.Medium; //cell.CellStyle = style; //cell.SetCellValue(123); //RegionUtil.SetBorderBottom(2, rang, sheet, workbook); //RegionUtil.SetBorderLeft(2, rang, sheet, workbook); //RegionUtil.SetBorderRight(2, rang, sheet, workbook); //RegionUtil.SetBorderTop(2, rang, sheet, workbook); SetCell(workbook, sheet, 2, 2, 22, 29, $"発行年月日 {PublishDate.ToString("yyyy年MM月dd日")}", 12, false, BorderStyle.None, false, 700); SetCell(workbook, sheet, 5, 11, 1, 13, $"{ToCompany} 御中", 10, true, BorderStyle.Medium, true); SetCell(workbook, sheet, 5, 5, 17, 29, FromCompany, 12, false, BorderStyle.None, false); SetCell(workbook, sheet, 1, 1, 1, 30, FromDepartment, 12, false, BorderStyle.None, true); //设置标题 var titleFont = workbook.CreateFont(); titleFont.FontHeightInPoints = 16; titleFont.Underline = FontUnderlineType.Single; SetCell(workbook, sheet, 16, 17, 0, 30, "adfdsf", titleFont, false, BorderStyle.None, true); //设置周期 var periodFont = workbook.CreateFont(); periodFont.FontHeightInPoints = 16; periodFont.Underline = FontUnderlineType.Single; SetCell(workbook, sheet, 20, 20, 1, 12, Period.ToString("yyyy年MM月度"), periodFont, false, BorderStyle.None, false); #region 代理商信息 SetCell(workbook, sheet, 22, 23, 1, 4, "代理店コード", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 22, 23, 5, 13, AgentMessage.AgentCode, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 1, 4, "振込日", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 5, 13, AgentMessage.DemittanceDate?.ToString("yyyy年MM月dd日"), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 1, 4, "振込金額", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 5, 13, AgentMessage.DemittanceAmount.ToString(), 12, true, BorderStyle.Thin, true); #endregion #region 代理商帐户信息 SetCell(workbook, sheet, 22, 23, 17, 20, "金融機関名", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 22, 23, 21, 29, AgentAccount.BankName, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 17, 20, "支店名", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 24, 25, 21, 29, AgentAccount.BranchBankName, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 17, 20, "口座番号", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 21, 22, AgentAccount.AccountMode, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 26, 27, 23, 29, AgentAccount.Account, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 28, 29, 17, 20, "口座名義", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, 28, 29, 21, 29, AgentAccount.AccountOwner, 12, true, BorderStyle.Thin, true); #endregion #region 列表 SetCell(workbook, sheet, 32, 32, 1, 1, null, 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 2, 4, "コード", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 5, 9, "加盟店", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 10, 14, "対象期間", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 15, 18, "決済利用額", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 19, 21, "手数料率", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 22, 25, "手数料額", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); SetCell(workbook, sheet, 32, 32, 26, 29, "備考", 12, true, BorderStyle.Thin, true, null, HSSFColor.Rose.Index); var rowIndex = 33; var sn = 1; var total = 0m; foreach (var item in Data) { total += item.RateAmount; SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, sn++.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, item.Code, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, item.Name, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, item.TimeSection, 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, item.Amount.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, item.Rate.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, item.RateAmount.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, item.Memo, 12, true, BorderStyle.Thin, true); rowIndex++; } SetCell(workbook, sheet, rowIndex, rowIndex, 1, 1, "計", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 2, 4, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 5, 9, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 10, 14, "税抜き", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 15, 18, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 19, 21, "", 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 22, 25, total.ToString(), 12, true, BorderStyle.Thin, true); SetCell(workbook, sheet, rowIndex, rowIndex, 26, 29, "", 12, true, BorderStyle.Thin, true); #endregion workbook.Write(fs); return(fs); } }