We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Vertical text alignment and text wrapping is not applied

Hello,

I want my Excel export to have custom colours, borders, text wrapping and vertical alignment, but only the colours, font style and curstom borders are applied.

if (args.Item.Id == "sfGrid_excelexport")

            {

                ExcelExportProperties ExportProperties = new ExcelExportProperties();

                ExportProperties.FileName = $"ApplicationList_{DateTime.Now.ToString(GlobalConstants.DATE_FORMAT_DELETED_FILE)}.xlsx";

                ExportProperties.IncludeTemplateColumn = true;

                ExportProperties.Columns = this.SetGridColumnsForExport();

                ExcelTheme Theme = new ExcelTheme();

                Border border = new Border();

                border.LineStyle = LineStyle.Thin;

                border.Color = "#000000";

                ExcelStyle HeaderThemeStyle = new ExcelStyle()

                {

                    BackColor = "#00BCD4",

                    FontSize = 12,

                    Bold = true,

                    FontColor = "#FFFFFF",

                    Borders = border,

                    WrapText = true,

                    VAlign = ExcelVerticalAlign.Top

                };


                ExcelStyle RecordThemeStyle = new ExcelStyle()

                {

                    Borders = border,

                    WrapText = true,

                    VAlign = ExcelVerticalAlign.Top

                };

                Theme.Header = HeaderThemeStyle;

                Theme.Record = RecordThemeStyle;


                ExportProperties.Theme = Theme;

                await this.sfGrid.ExportToExcelAsync(ExportProperties);

            }

Here is the  SetGridColumnsForExport() method:

 private List<GridColumn> SetGridColumnsForExport()

        {

            List<GridColumn> ExportColumns = new List<GridColumn>();


            ExportColumns.Add(new GridColumn() { Field = "ProviderOwner", HeaderText = "Provider", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "PoviderBulstat", HeaderText = "Bulstat", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "LocationCorrespondence.LocationName", HeaderText ="Location", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "ProviderAddressCorrespondence", HeaderText = "Contact", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "TypeApplication", HeaderText = "Type", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "ApplicationStatus", HeaderText = "Status", TextAlign = TextAlign.Left });

            ExportColumns.Add(new GridColumn() { Field = "LicenceNumber", HeaderText = "Licence", TextAlign = TextAlign.Left });


            return ExportColumns;

        }


2 Replies

PS Prathap Senthil Syncfusion Team April 24, 2023 07:26 AM UTC

Hi Alexander,

Greetings from syncfusion,

We were able to reproduce the reported issue, and we have considered it a bug and logged an issue ("Vertical text alignment and text wrapping is not applied") for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and the Product Development Life Cycle), and this fix will be included in our any upcoming patch release.

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.

https://www.syncfusion.com/feedback/42732/vertical-text-alignment-and-text-wrapping-is-not-applied

Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors, including but not limited to QA checks and work reprioritization."

Until then, we appreciate your patience.


Regards,
Prathap S



PS Prathap Senthil Syncfusion Team May 8, 2023 05:53 AM UTC

Hi Alexander,


We are glad to announce that, we have included the fix for the issue “Vertical text alignment and text wrapping is not applied” in our 21.2.3 release.  So please upgrade to our latest version of the Syncfusion NuGet package to resolve the reported issue. Please find the NuGet package for the latest fixes and features below.


NuGet: https://www.nuget.org/packages/Syncfusion.Blazor.Grid

Release notes: https://blazor.syncfusion.com/documentation/release-notes/21.2.3?type=all#grid


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 


Regards,

Prathap s


Loader.
Live Chat Icon For mobile
Up arrow icon