This example demonstrates how to export ASPxDataView control content to a PDF file. Currently, ASPxDataView does not support data export, therefore we suggest a workaround with two ASPxDataViews. One of the two ASPxDataView's has ASPxDataView.ClientVisible set to False and we export its data, the second ASPxDataView is only used to display data we export. In this example, we also use the ASPxHiddenField control to transfer data from the client side to the server. We handle the following events: ASPxDataView.CustomCallback, ASPxClientDataView.BeginCallback, ASPxClientDataView.EndCallback, ASPxButton.Click, ASPxClientButton.Click.
First, we send a callback to an invisible ASPxDataView on ASPxClientButton.Click, then ASPxDataView html is obtained and written to ASPxHiddenField for each page on ASPxClientDataView.BeginCallback. Finally, a next callback is sent by handling the ASPxClientDataView.EndCallback event. The html-markup of every ASPxDataView page is first written to the session and then to a response using RichEditDocumentServer component on the server side.
↧
How to export ASPxDataView control content to a PDF file
↧