diff --git a/File-Formats-toc.html b/File-Formats-toc.html index f5548652e..f2a8476db 100644 --- a/File-Formats-toc.html +++ b/File-Formats-toc.html @@ -1688,6 +1688,7 @@
  • How to fix the ArgumentOutOfRangeException when accessing a large number of rows and columns?
  • How to set Logarithmic axis for chart in Excel document?
  • How to resolve performance issue when deleting a large number of rows?
  • +
  • How to hide columns using column name?
  • diff --git a/File-Formats/DocIO/Working-with-Word-document.md b/File-Formats/DocIO/Working-with-Word-document.md index 693221d18..54a8c0286 100644 --- a/File-Formats/DocIO/Working-with-Word-document.md +++ b/File-Formats/DocIO/Working-with-Word-document.md @@ -248,9 +248,18 @@ using (WordDocument document = new WordDocument(sourceStreamPath, FormatType.Aut //Accesses the built-in document properties Console.WriteLine("Title - {0}",document.BuiltinDocumentProperties.Title); Console.WriteLine("Author - {0}", document.BuiltinDocumentProperties.Author); - //Modifies or sets the category and company Built-in document properties - document.BuiltinDocumentProperties.Category = "Sales reports"; - document.BuiltinDocumentProperties.Company = "Northwind traders"; + //Modifies or sets the Built-in document properties. + document.BuiltinDocumentProperties.Author = "Andrew"; + document.BuiltinDocumentProperties.LastAuthor = "Steven"; + document.BuiltinDocumentProperties.CreateDate = new DateTime(1900, 12, 31, 12, 0, 0); + document.BuiltinDocumentProperties.LastSaveDate = new DateTime(1900, 12, 31, 12, 0, 0); + document.BuiltinDocumentProperties.LastPrinted = new DateTime(1900, 12, 31, 12, 0, 0); + document.BuiltinDocumentProperties.Title = "Sample Document"; + document.BuiltinDocumentProperties.Subject = "Adventure Works Cycle"; + document.BuiltinDocumentProperties.Category = "Technical documentation"; + document.BuiltinDocumentProperties.Comments = "This is sample document."; + document.BuiltinDocumentProperties.RevisionNumber = "2"; + document.BuiltinDocumentProperties.Company = "Adventure Works Cycle"; //Saves and closes the destination document to MemoryStream MemoryStream stream = new MemoryStream(); document.Save(stream, FormatType.Docx); @@ -264,9 +273,18 @@ WordDocument document = new WordDocument(inputFileName); //Accesses the built-in document properties Console.WriteLine("Title - {0}",document.BuiltinDocumentProperties.Title); Console.WriteLine("Author - {0}", document.BuiltinDocumentProperties.Author); -//Modifies or sets the category and company Built-in document properties -document.BuiltinDocumentProperties.Category = "Sales reports"; -document.BuiltinDocumentProperties.Company = "Northwind traders"; +//Modifies or sets the Built-in document properties. +document.BuiltinDocumentProperties.Author = "Andrew"; +document.BuiltinDocumentProperties.LastAuthor = "Steven"; +document.BuiltinDocumentProperties.CreateDate = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.LastSaveDate = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.LastPrinted = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.Title = "Sample Document"; +document.BuiltinDocumentProperties.Subject = "Adventure Works Cycle"; +document.BuiltinDocumentProperties.Category = "Technical documentation"; +document.BuiltinDocumentProperties.Comments = "This is sample document."; +document.BuiltinDocumentProperties.RevisionNumber = "2"; +document.BuiltinDocumentProperties.Company = "Adventure Works Cycle"; document.Save(outputFileName, FormatType.Docx); document.Close(); {% endhighlight %} @@ -277,9 +295,18 @@ Dim document As New WordDocument(inputFileName) 'Accesses the built-in document properties Console.WriteLine("Title - {0}", document.BuiltinDocumentProperties.Title) Console.WriteLine("Author - {0}", document.BuiltinDocumentProperties.Author) -'Modifies or sets the category and company Built-in document properties -document.BuiltinDocumentProperties.Category = "Sales reports" -document.BuiltinDocumentProperties.Company = "Northwind traders" +'Modifies or sets the Built-in document properties. +document.BuiltinDocumentProperties.Author = "Andrew"; +document.BuiltinDocumentProperties.LastAuthor = "Steven"; +document.BuiltinDocumentProperties.CreateDate = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.LastSaveDate = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.LastPrinted = new DateTime(1900, 12, 31, 12, 0, 0); +document.BuiltinDocumentProperties.Title = "Sample Document"; +document.BuiltinDocumentProperties.Subject = "Adventure Works Cycle"; +document.BuiltinDocumentProperties.Category = "Technical documentation"; +document.BuiltinDocumentProperties.Comments = "This is sample document."; +document.BuiltinDocumentProperties.RevisionNumber = "2"; +document.BuiltinDocumentProperties.Company = "Adventure Works Cycle"; 'Saves and closes the document document.Save(outputFileName, FormatType.Docx) document.Close() diff --git a/File-Formats/Release-Notes/v25.1.40.md b/File-Formats/Release-Notes/v25.1.40.md new file mode 100644 index 000000000..641f1f9a3 --- /dev/null +++ b/File-Formats/Release-Notes/v25.1.40.md @@ -0,0 +1,98 @@ +--- +title : Essential Studio for File Formats Weekly Nuget Release Release Notes +description : Essential Studio for File Formats Weekly Nuget Release Release Notes +platform : file-formats +documentation: ug +--- + +# Essential Studio for File Formats Release Notes + +{% include release-info.html date="April 16, 2024" version="v25.1.40" %} + + +## DocIO + +* [EJ2 ASP.NET Core Release Notes](https://ej2.syncfusion.com/aspnetcore/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 ASP.NET MVC Release Notes](https://ej2.syncfusion.com/aspnetmvc/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 Angular Release Notes](https://ej2.syncfusion.com/angular/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [Blazor Release Notes](https://blazor.syncfusion.com/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 React Release Notes](https://ej2.syncfusion.com/react/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 Vue Release Notes](https://ej2.syncfusion.com/vue/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 JavaScript Release Notes](https://ej2.syncfusion.com/javascript/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [EJ2 TypeScript Release Notes](https://ej2.syncfusion.com/documentation/release-notes/25.1.40#docio){:target="_blank"} +* [.NET MAUI Release Notes](/maui/release-notes/v25.1.40#docio){:target="_blank"} +* [Xamarin.Forms Release Notes](/xamarin/release-notes/v25.1.40#docio){:target="_blank"} +* [Xamarin.Android Release Notes](/xamarin-android/release-notes/v25.1.40#docio){:target="_blank"} +* [Xamarin.iOS Release Notes](/xamarin-ios/release-notes/v25.1.40#docio){:target="_blank"} +* [Flutter Release Notes](/flutter/release-notes/v25.1.40#docio){:target="_blank"} +* [WinUI Release Notes](/winui/release-notes/v25.1.40#docio){:target="_blank"} +* [UWP Release Notes](/uwp/release-notes/v25.1.40#docio){:target="_blank"} +* [Windows Forms Release Notes](/windowsforms/release-notes/v25.1.40#docio){:target="_blank"} +* [WPF Release Notes](/wpf/release-notes/v25.1.40#docio){:target="_blank"} + + + +## PDF + +* [EJ2 ASP.NET Core Release Notes](https://ej2.syncfusion.com/aspnetcore/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 ASP.NET MVC Release Notes](https://ej2.syncfusion.com/aspnetmvc/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 Angular Release Notes](https://ej2.syncfusion.com/angular/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [Blazor Release Notes](https://blazor.syncfusion.com/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 React Release Notes](https://ej2.syncfusion.com/react/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 Vue Release Notes](https://ej2.syncfusion.com/vue/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 JavaScript Release Notes](https://ej2.syncfusion.com/javascript/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [EJ2 TypeScript Release Notes](https://ej2.syncfusion.com/documentation/release-notes/25.1.40#pdf){:target="_blank"} +* [.NET MAUI Release Notes](/maui/release-notes/v25.1.40#pdf){:target="_blank"} +* [Xamarin.Forms Release Notes](/xamarin/release-notes/v25.1.40#pdf){:target="_blank"} +* [Xamarin.Android Release Notes](/xamarin-android/release-notes/v25.1.40#pdf){:target="_blank"} +* [Xamarin.iOS Release Notes](/xamarin-ios/release-notes/v25.1.40#pdf){:target="_blank"} +* [Flutter Release Notes](/flutter/release-notes/v25.1.40#pdf){:target="_blank"} +* [WinUI Release Notes](/winui/release-notes/v25.1.40#pdf){:target="_blank"} +* [UWP Release Notes](/uwp/release-notes/v25.1.40#pdf){:target="_blank"} +* [Windows Forms Release Notes](/windowsforms/release-notes/v25.1.40#pdf){:target="_blank"} +* [WPF Release Notes](/wpf/release-notes/v25.1.40#pdf){:target="_blank"} + + +## Presentation + +* [EJ2 ASP.NET Core Release Notes](https://ej2.syncfusion.com/aspnetcore/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 ASP.NET MVC Release Notes](https://ej2.syncfusion.com/aspnetmvc/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [Blazor Release Notes](https://blazor.syncfusion.com/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 Angular Release Notes](https://ej2.syncfusion.com/angular/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 React Release Notes](https://ej2.syncfusion.com/react/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 Vue Release Notes](https://ej2.syncfusion.com/vue/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 JavaScript Release Notes](https://ej2.syncfusion.com/javascript/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [EJ2 TypeScript Release Notes](https://ej2.syncfusion.com/documentation/release-notes/25.1.40#presentation){:target="_blank"} +* [.NET MAUI Release Notes](/maui/release-notes/v25.1.40#presentation){:target="_blank"} +* [Xamarin.Forms Release Notes](/xamarin/release-notes/v25.1.40#presentation){:target="_blank"} +* [Xamarin.Android Release Notes](/xamarin-android/release-notes/v25.1.40#presentation){:target="_blank"} +* [Xamarin.iOS Release Notes](/xamarin-ios/release-notes/v25.1.40#presentation){:target="_blank"} +* [Flutter Release Notes](/flutter/release-notes/v25.1.40#presentation){:target="_blank"} +* [WinUI Release Notes](/winui/release-notes/v25.1.40#presentation){:target="_blank"} +* [Windows Forms Release Notes](/windowsforms/release-notes/v25.1.40#presentation){:target="_blank"} +* [WPF Release Notes](/wpf/release-notes/v25.1.40#presentation){:target="_blank"} +* [UWP Release Notes](/uwp/release-notes/v25.1.40#presentation){:target="_blank"} + + + +## XlsIO + +* [EJ2 ASP.NET Core Release Notes](https://ej2.syncfusion.com/aspnetcore/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 ASP.NET MVC Release Notes](https://ej2.syncfusion.com/aspnetmvc/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 Angular Release Notes](https://ej2.syncfusion.com/angular/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [Blazor Release Notes](https://blazor.syncfusion.com/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 React Release Notes](https://ej2.syncfusion.com/react/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 Vue Release Notes](https://ej2.syncfusion.com/vue/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 JavaScript Release Notes](https://ej2.syncfusion.com/javascript/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [EJ2 TypeScript Release Notes](https://ej2.syncfusion.com/documentation/release-notes/25.1.40#xlsio){:target="_blank"} +* [.NET MAUI Release Notes](/maui/release-notes/v25.1.40#xlsio){:target="_blank"} +* [Xamarin.Forms Release Notes](/xamarin/release-notes/v25.1.40#xlsio){:target="_blank"} +* [Xamarin.Android Release Notes](/xamarin-android/release-notes/v25.1.40#xlsio){:target="_blank"} +* [Xamarin.iOS Release Notes](/xamarin-ios/release-notes/v25.1.40#xlsio){:target="_blank"} +* [Flutter Release Notes](/flutter/release-notes/v25.1.40#xlsio){:target="_blank"} +* [WinUI Release Notes](/winui/release-notes/v25.1.40#xlsio){:target="_blank"} +* [UWP Release Notes](/uwp/release-notes/v25.1.40#xlsio){:target="_blank"} +* [Windows Forms Release Notes](/windowsforms/release-notes/v25.1.40#xlsio){:target="_blank"} +* [WPF Release Notes](/wpf/release-notes/v25.1.40#xlsio){:target="_blank"} + + diff --git a/File-Formats/XlsIO/FAQ.md b/File-Formats/XlsIO/FAQ.md index fb3c5eb10..480f40187 100644 --- a/File-Formats/XlsIO/FAQ.md +++ b/File-Formats/XlsIO/FAQ.md @@ -82,4 +82,5 @@ The frequently asked questions in Essential XlsIO are listed below. * [How to find and replace text in hyperlinks?](faqs/how-to-find-and-replace-text-in-hyperlinks) * [How to fix the ArgumentOutOfRangeException when accessing a large number of rows and columns?](faqs/how-to-fix-the-argument-out-of-range-exception-when-accessing-a-large-number-of-rows-and-columns) * [How to set Logarithmic axis for chart in Excel document?](faqs/how-to-set-logarithmic-axis-for-chart-in-excel-document) -* [How to resolve performance issue when deleting a large number of rows?](faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows) \ No newline at end of file +* [How to resolve performance issue when deleting a large number of rows?](faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows) +* [How to hide columns using column name](faqs/how-to-hide-columns-using-column-name) \ No newline at end of file diff --git a/File-Formats/XlsIO/faqs/how-to-hide-columns-using-column-name.md b/File-Formats/XlsIO/faqs/how-to-hide-columns-using-column-name.md new file mode 100644 index 000000000..5bf40b699 --- /dev/null +++ b/File-Formats/XlsIO/faqs/how-to-hide-columns-using-column-name.md @@ -0,0 +1,100 @@ +--- +title: How to hide columns using column name |Syncfusion. +description: This page explains how to hide columns using column name using Syncfusion .NET Excel library (XlsIO). +platform: file-formats +control: XlsIO +documentation: UG +--- + +# How to hide columns using column name? + +The following code illustrates how to hide columns using column name. + +{% tabs %} +{% highlight c# tabtitle="C# [Cross-platform]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Loads an existing file + FileStream inputStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorksheet worksheet = workbook.Worksheets[0]; + + List columnsToHide = new List { "column1", "column2", "column3" }; + + foreach (string columnName in columnsToHide) + { + IRange headerCell = worksheet.UsedRange.FindFirst(columnName, ExcelFindType.Text); + if (headerCell != null) + { + int columnIndex = headerCell.Column; + + // Hide the column + worksheet.ShowColumn(columnIndex, false); + } + } + + //Saving the workbook as stream + FileStream stream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.ReadWrite); + workbook.SaveAs(stream); + stream.Dispose(); +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Loads an existing file + IWorkbook workbook = application.Workbooks.Open("InputTemplate.xlsx"); + IWorksheet worksheet = workbook.Worksheets[0]; + + List columnsToHide = new List { "column1", "column2", "column3" }; + + foreach (string columnName in columnsToHide) + { + IRange headerCell = worksheet.UsedRange.FindFirst(columnName, ExcelFindType.Text); + if (headerCell != null) + { + int columnIndex = headerCell.Column; + + // Hide the column + worksheet.ShowColumn(columnIndex, false); + } + } + + //Saving the workbook + workbook.SaveAs("Output.xlsx"); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Using excelEngine As ExcelEngine = New ExcelEngine() + Dim application As IApplication = excelEngine.Excel + application.DefaultVersion = ExcelVersion.Xlsx + + ' Loads an existing file + Dim workbook As IWorkbook = application.Workbooks.Open("InputTemplate.xlsx") + Dim worksheet As IWorksheet = workbook.Worksheets(0) + + Dim columnsToHide As List(Of String) = New List(Of String) From {"column1", "column2", "column3"} + + For Each columnName As String In columnsToHide + Dim headerCell As IRange = worksheet.UsedRange.FindFirst(columnName, ExcelFindType.Text) + If headerCell IsNot Nothing Then + Dim columnIndex As Integer = headerCell.Column + + ' Hide the column + worksheet.ShowColumn(columnIndex, False) + End If + Next + + ' Saving the workbook + workbook.SaveAs("Output.xlsx") +End Using +{% endhighlight %} +{% endtabs %} diff --git a/File-Formats/XlsIO/faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows.md b/File-Formats/XlsIO/faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows.md index f4bfbc461..3a831614f 100644 --- a/File-Formats/XlsIO/faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows.md +++ b/File-Formats/XlsIO/faqs/how-to-resolve-performance-issue-when-deleting-a-large-number-of-rows.md @@ -81,7 +81,7 @@ using(ExcelEngine excelEngine = new ExcelEngine()) //Remove the worksheet workbook.Worksheets[0].Remove(); - //Saving the workbook as stream + //Saving the workbook workbook.SaveAs("Output.xlsx"); } {% endhighlight %}