Blazor Grid PDF export € symbol

When I export a grid to pdf, it does not put the € symbol. I'm using Syncfusion.Blazor.Grid (19.3.0.57)

Grid


Pdf Document


Thank you very much


6 Replies

RN Rahul Narayanasamy Syncfusion Team February 25, 2022 01:45 PM UTC

Hi Gerardo, 

Greetings from Syncfusion. 

We are currently checking the reported query with the provided details and we will update the further details within two business days. Until then we appreciate your patience. 

Regards, 
Rahul 
 



VN Vignesh Natarajan Syncfusion Team March 1, 2022 05:42 AM UTC

Hi Gerardo,  
 
Thanks for the patience.  
 
Query: “When I export a grid to pdf, it does not put the € symbol.  
 
We are able to reproduce the reported issue in the provided sample after changing the currency format to german (“€”). While exporting the Grid to PDF format some characters will not be considered as its default language is en-US. This can be overcome by defining True Type font information as base64 string to PdfTrueTypeFont option while exporting. Refer the below code example.  
 
public void ToolbarClick(Syncfusion.Blazor.Navigations.ClickEventArgs args)        {            if (args.Item.Id == "Grid_pdfexport")            {                PdfExportProperties ExportProperties = new PdfExportProperties();                PdfTheme Theme = new PdfTheme();                PdfThemeStyle RecordThemeStyle = new PdfThemeStyle()                {                    FontColor = "#64FA50",                    FontName = "Calibri",                    FontSize = 17,                    Font = new PdfGridFont() { IsTrueType = true, FontStyle = "Italic", FontSize = 8, FontFamily = "AAEAAA…. /gAtAdUALQIDYQNrA3IDqgAA" },/*you fonts famiy in form of base64string*/                                };            Theme.Record = RecordThemeStyle;            ExportProperties.Theme = Theme;            this.Grid.PdfExport(ExportProperties);        }        if (args.Item.Id == "Grid_excelexport")        {            this.Grid.ExcelExport();        }        if (args.Item.Id == "Grid_csvexport")        {            this.Grid.CsvExport();        }    }
 
 
Note : We request you to use the corresponding custom font base64 string in your application, based on your requirement. Please follow the below steps to get the base64 string for the custom font. 
  1. Download TTF file for the corresponding (custom) font (https://www.fontsquirrel.com/fonts/list/language/german  )
  2. Then convert the TTF file into base64 string (https://www.giftofspeed.com/base64-encoder/).
  3. Finally apply the base64 string to pdfTrupetypeFont.
 
For your convenience we have modified the same sample to export in Pdf format. Kindy download the sample from below  
 
 
Refer our UG documentation for your reference 
 
 
Kindly get back to us if you have further queries  
 
Regards, 
Vignesh Natarajan 
 



GL Gerardo Lopez Ruiz March 1, 2022 05:41 PM UTC

When there are aggregates the € symbol does not appear, in the cells it does.





VN Vignesh Natarajan Syncfusion Team March 2, 2022 06:29 AM UTC

Hi Gerardo,  
 
Query: “When there are aggregates the € symbol does not appear, in the cells it does. 
 
We are unable to reproduce the reported issue at our end when we enable Aggregates in the sample provided in previous update. From your screenshot, we understand that custom font is applied to Grid content (solution provided in previous) is not applied to the aggregate values. So we request you to ensure that you have defined the custom font style to header, content and caption content.  
 
Refer the below code example.  
 
    public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args) 
    { 
        if (args.Item.Id == "Grid_pdfexport")  //Id is combination of Grid's ID and itemname 
        { 
            PdfExportProperties ExportProperties = new PdfExportProperties(); 
            PdfTheme Theme = new PdfTheme(); 
 
            PdfThemeStyle ThemeStyle = new PdfThemeStyle() 
                { 
                    Font = new PdfGridFont { IsTrueType = true, FontSize = 8, FontFamily = "AAE...A" },   //apply your custom font base64 string to FontFamily 
                }; 
            //to apply style to Grid header 
            Theme.Header = ThemeStyle; 
            //to apply style to Grid content 
            Theme.Record = ThemeStyle; 
            //to apply style to Grid aggregates 
            Theme.Caption = ThemeStyle; 
            ExportProperties.Theme = Theme; 
            await this.DefaultGrid.PdfExport(ExportProperties); 
        } 
    } 
 
Kindly refer the below sample for your reference 
 
 
Please get back to us with more details if you are still facing the reported issue.  
 
Regards, 
Vignesh Natarajan 



GL Gerardo Lopez Ruiz replied to Vignesh Natarajan March 2, 2022 05:10 PM UTC

Perfect, thank you very much!



RN Rahul Narayanasamy Syncfusion Team March 3, 2022 04:58 AM UTC

Hi Gerardo, 
 
Thanks for the update. 
 
We are happy to hear that the provided solution was helpful to achieve your requirement. Please get back to us if you need further assistance. 
 
Regards, 
Rahul 


Loader.
Up arrow icon