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

Pressing pdf export is not generating any event

Hi,

Pressing pdf export is not generating any event for my gridview. Can you please send a very small demo of how to achieve this. The sample provided is perfectly working but in my case the dialogue is not appearing.

Thanks

5 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team March 20, 2017 01:19 PM UTC

Hi Salabat, 

Thanks for contacting Syncfusion support. 

Query 1: Pressing pdf export is not generating any event for my gridview. 
 
We have analyzed your query and we suspect that you need an event while press the export in Grid.  
 
So, we suggest you to use the toolbarClick event of ejGrid. Trigger the toolbarClick event while pressing the export toolbar items like excelExport, wordExport, pdfExport in Grid control. 
 
Refer the below code example. 
 
 
<ej:Grid ID="FlatGrid" runat="server"  AllowPaging="True"> 
 
            <ToolbarSettings ShowToolbar="true" ToolbarItems="excelExport,wordExport,pdfExport"></ToolbarSettings> 
 
            <ClientSideEvents ToolbarClick="toolbarClickevent" /> 
            
            <Columns> 
                 
                --------------------- 
 
           </Columns> 
                      
</ej:Grid> 
 
 
If you need the events in server side itself then you can use server events for the exporting in ejGrid control.  
 
The server event for exporting is triggered when a request to export the Grid.   
 
Refer the below code  example. 
 
 
<ej:Grid ID="FlatGrid" runat="server" IsResponsive="true"  
 
OnServerWordExporting="FlatGrid_ServerWordExporting"  /*Server event for word exporting*/ 
 
OnServerPdfExporting="FlatGrid_ServerPdfExporting" /*Server event for pdf exporting*/ 
 
 
OnServerExcelExporting="FlatGrid_ServerExcelExporting" /*Server event for excel exporting*/ 
 
 
AllowPaging="True"> 
 
            <ToolbarSettings ShowToolbar="true" ToolbarItems="excelExport,wordExport,pdfExport"></ToolbarSettings> 
 
                        
            <Columns> 
                 
                 -------------------- 
 
            </Columns> 
                      
       </ej:Grid> 
 
 
 
In addition that, the OnServerPdfQueryCellInfo event is triggered every time data is written to the cell of the PdfGrid table and also this event is triggered every time as that of the cell written to the grid table. 
 
 
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="true"  
 
OnServerPdfQueryCellInfo="OrdersGrid_ServerPdfQueryCellInfo"  
 
OnServerPdfExporting="OrdersGrid_ServerPdfExporting"> 
 
 
 
  ---------------------- 
 
</ej:Grid> 
 
 
 
Refer the below online sample. 
 
 
Refer the help documentation. 
 
 
 
 
 
 
Query 2: The sample provided is perfectly working but in my case the dialogue is not appearing. 
 
We are unclear about your query. So please elaborate your query, it will be helpful for us to analyze about your query and update you the response as early as possible. 
 
Regards, 
Thavasianand S.


SK Salabat Khan March 20, 2017 05:29 PM UTC

Hi, Nice to see your detailed reply. In the second part of my question, I wanted to say that the dialogue box which asks for file name (when exporting) is not appearing.

Anyhow, I am interested in server side export event. I am attaching the project sample in which I am unable to receive the server side call to function when any of the export buttons on toolbar is pressed.

Regards

Attachment: SyncfusionASPNETWebApplication1_c4a45819.rar


TS Thavasianand Sankaranarayanan Syncfusion Team March 22, 2017 06:03 PM UTC

Hi Salabat, 
 
Query 1:  I wanted to say that the dialogue box which asks for file name (when exporting) is not appearing. 
 
Please ensure your browser download settings for prompt dialog opening while downloading. But we have called for the default prompt type while exporting the Grid. So, change your download settings for the dialog prompt window while downloading a file. 
 
Query 2: I am unable to receive the server side call to function when any of the export buttons on toolbar is pressed 
 
We have checked your sample and in that you are not added ScriptManager control in the Site.Master page. 
 
Refer the below code example. 
 
 
<body> 
   <form runat="server"> 
        <asp:ScriptManager runat="server"> 
             
        </asp:ScriptManager> 
    <div class="page"> 
        <div class="header"> 
            <div class="title"> 
 
       ------------------- 
 
</form> 
</body> 
 
 
We have changed the sample according to the solution and it can be downloadable from the below location. 
 
 
We have already created a knowledge base for the above mentioned query. 

So, please refer the below knowledge base link. 

 
Regards, 
Thavasianand S. 



SK Salabat Khan March 22, 2017 06:29 PM UTC

Thank you. It is now working..


TS Thavasianand Sankaranarayanan Syncfusion Team March 23, 2017 08:46 AM UTC

Hi Salabat, 

We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  

Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon