PDF Export is not working properly on latest version Grid Control

Hi Team,

Today I was using the latest version of Grid control i.e.18.4.0.31,

There are option to Export to PDF

<SfGrid DataSource="model" @ref="Grid"
                    Height="100%" Width="100%"
                    ID="Grid"
                    AllowPaging="true" 
                    Toolbar="@(new List<string>() { "ExcelExport", "CsvExport", "PdfExport" })"
                    AllowExcelExport="true"
                    AllowPdfExport="true"
                    AllowSorting="true">
                <GridEvents OnToolbarClick="ToolbarClick" TValue="AztcQuery"></GridEvents>
                <GridPageSettings PageSize="10"></GridPageSettings

Pdf file is generating, but it is not taking all columns of Grid. It is taking only 5 Columns. But "ExcelExport", "CsvExport" is working fine. Could you please let me the workaround of issue ?


Regards
Chandradev

1 Reply 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team January 4, 2021 02:22 PM UTC

Hi Chandradev, 

Greetings from Syncfusion. 
 
Query: PDF Export is not working properly on latest version Grid Control - Pdf file is generating, but it is not taking all columns of Grid. It is taking only 5 Columns. But "ExcelExport", "CsvExport" is working fine. Could you please let me the workaround of issue ?  

We have validated your query and we might suspect that you want to export all the columns in a single page. You can export all the columns in a single page by AllowHorizontalOverFlow property of ExportProperties as false. Please refer the below code snippet and the documentation link for your reference. 
 
public void ToolbarClick(Syncfusion.Blazor.Navigations.ClickEventArgs args) 
    { 
        if (args.Item.Id == "Grid_pdfexport") 
        { 
            PdfExportProperties ExportProperties = new PdfExportProperties(); 
            ExportProperties.AllowHorizontalOverflow = false; 
            this.Grid.PdfExport(ExportProperties); 
        } 
        if (args.Item.Id == "Grid_excelexport") 
        { 
            this.Grid.ExcelExport(); 
        } 
        if (args.Item.Id == "Grid_csvexport") 
        { 
            this.Grid.CsvExport(); 
        } 
    } 
 
 
Reference Links: 

Please let us know if you have any concerns. 
 
Regards, 
Rahul 



Marked as answer
Loader.
Up arrow icon