-
Notifications
You must be signed in to change notification settings - Fork 0
Readme #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Readme #1
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b452fb
readme
khamlyuk d99d7d8
README auto update [skip ci]
dbb1f88
fix invisible columns
khamlyuk 7313f63
Merge branch 'readme-text' of https://github.com/DevExpress-Examples/…
khamlyuk 60ff2b4
Update README.md
khamlyuk ca1020f
README auto update [skip ci]
6d7d6fb
apply suggestions from Vova
khamlyuk 9fe4a76
Merge branch 'readme-text' of https://github.com/DevExpress-Examples/…
khamlyuk 08f922f
README auto update [skip ci]
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,10 @@ | |
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <base href="/" /> | ||
| <link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" asp-append-version="true" /> | ||
|
|
||
| @DxResourceManager.RegisterScripts() | ||
| @DxResourceManager.RegisterTheme(Themes.Fluent) | ||
| <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous"> | ||
| <link href="css/site.css" rel="stylesheet" /> | ||
| <link href="ExportImagesAndRichText.styles.css" rel="stylesheet" /> | ||
| <HeadOutlet /> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,12 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="DevExpress.Blazor" Version="25.1.3" /> | ||
| <PackageReference Include="DevExpress.Document.Processor" Version="25.1.3" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="DevExpress.Blazor" Version="25.1.5" /> | ||
| <PackageReference Include="DevExpress.Document.Processor" Version="25.1.5" /> | ||
| <Folder Include="Images\" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,33 +1,45 @@ | ||||||
| <!-- default badges list --> | ||||||
|  | ||||||
| [](https://supportcenter.devexpress.com/ticket/details/T1302036) | ||||||
| [](https://docs.devexpress.com/GeneralInformation/403183) | ||||||
| [](#does-this-example-address-your-development-requirementsobjectives) | ||||||
| <!-- default badges end --> | ||||||
| # Blazor Grid - How to export images and rich text using Spreadsheet Document API | ||||||
| # Blazor Grid - Export Images/Rich Text Using Spreadsheet Document APIs | ||||||
|
|
||||||
| This example demonstrates how you can use Spreadsheet Document API to create a custom export mechanism to export images and rich text. | ||||||
| This example uses Spreadsheet Document APIs to implement an export mechanism for cells that contain images and rich text. | ||||||
|
|
||||||
| ## Overview | ||||||
| > [!IMPORTANT] | ||||||
| > You need a license for the [DevExpress Office File API Subscription](https://www.devexpress.com/products/net/office-file-api/) or [DevExpress Universal Subscription](https://www.devexpress.com/subscriptions/universal.xml) to use these capabilities in production code. | ||||||
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| Create a [Workbook](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.Workbook) instance. Iterate through Grid's data columns (you can obtain them through the [GetDataColumns](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGrid.GetRowValue(System.Int32-System.String)) method) and create corresponding header cells in the Workbook's active worksheet. You can use the [BeginUpdateFormatting](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.CellRange.BeginUpdateFormatting?p=netframework) and [EndUpdateFormatting](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.CellRange.EndUpdateFormatting(DevExpress.Spreadsheet.Formatting)) methods to format the header as required. | ||||||
|  | ||||||
|
|
||||||
| Then, use Grid's [GetVisibleRowCount](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGrid.GetVisibleRowCount) and [GetRowValue](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGrid.GetRowValue(System.Int32-System.String)) methods to iterate through its visible rows and obtain field values from each row. Use those values to populate the worksheet. To set a Cell's value, you can use the [SetValue](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.CellRange.SetValue(System.Object)?p=netframework) method. To set cell value to an image, you can pass the image in the form of a stream or a byte array as a parameter to the **SetValue** method. | ||||||
| ## Implementation Details | ||||||
|
|
||||||
| To place rich text into a cell, you can use a similar approach to the one demonstrated in our [WinForms Spreadsheet Control - How to Edit Rich Text in SpreadsheetControl](https://github.com/DevExpress-Examples/winforms-spreadsheet-how-to-edit-rich-text/tree/19.1.4%2B) example. | ||||||
| ### Set Up Grid | ||||||
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| After populating the worksheet, create a [table](https://docs.devexpress.com/OfficeFileAPI/403308/spreadsheet-document-api/spreadsheet-tables#create-a-table) to enable filtering and sorting of the dataset in the document. | ||||||
| Create a DevExpress Blazor Grid and populate it with data. Use [CellDisplayTemplate](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGridDataColumn.CellDisplayTemplate) to display an [image](./CS/ExportImagesAndRichText/Components/Pages/Index.razor#L43) or [rich text](./CS/ExportImagesAndRichText/Components/Pages/Index.razor#L35) in a cell. | ||||||
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| To download the document in Excel format, use the [SaveDocument{Async}](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.Workbook.SaveDocument.overloads?p=netframework) method to save it to a stream or byte array and use standard Blazor techniques to send the byte array on the client. | ||||||
| ### Implement Export Engine | ||||||
|
||||||
| ### Implement Export Engine | |
| ### Implement an Export Engine |
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
khamlyuk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.