The Enterprise edition includes built-in exporting functionality to HTML, PDF, TIFF, RTF, Excel, Text and XML format. The exporting process will take client's latest UI layout such as visible columns, columns order, grouped columns, sorted columns as well as filtered columns. This allows end-users to easily grab displayed data, manipulate and represent it in other way.
The exporting functionality is controlled in AllowExport property under LayoutSettings. When it is set to Yes, the Export icon will appear in the status bar. When clicked, a menu displaying export and page output options will appear. The export options depend on the last selected object, for instance, if a row is selected in child table then the 'Export selected child table' option will appear as you can see in following snapshot:
Generally, this feature is capable for exporting two type of grid's data, one is the root table and the other is selected child table's data. The export for root table will not export any hierarchical data because of performance issues and based on common requirements. The export for selected child table will export the entire data for the selected child table and not including any hierarchical data.
The built-in exporting feature incorporates DataDynamic's ActiveReports runtime engine to generate and output the reports to HTML and PDF format. The ActiveReport's engine is only used internally by WebGrid at runtime and does not require you to add references of ActiveReport's assembly in your VS.NET solution.
The included ActiveReport's engine doesn't contain any design-time capability and hence you can't use it for development purpose. Moreover, the ActiveReport's runtime is loaded on demand when the built-in exporting is used and export command is requested by client. |
Instead of built-in exporting, WebGrid also allows you to use your own exporting codes or module to handle exporting functionality. You can handle the OnExport server side event, write customized exporting codes and set the event's ReturnValue to False for cancelling default process. You can also specify the different output file name to the provided ReportInfo object available in the event argument. When using your own custom exporting, you can skip the inclusion of built-in exporting runtime assemblies. That means WebGrid assembly does not depend on the built-in exporting runtime assemblies on deployment time. This makes the WebGrid totally independent, fully customizable and extensible.
Prior to the exporting process, you will need to create a folder to hold the generated output files. By default, the ReportPath is assigned to "~/TempReports" which means the "TempReports" folder should be created under the root of the web application. The folder also need to have enough permission to allow the asp-net worker process to write the generated output files into the folder. You can always change the ReportPath property and other report-specific property such as paper-type, orientation etc, in the ReportInfo object provided by the event argument in OnExport event.
If you have changed the default ReportPath, you also need to change the IISReportPath which is used as the relative IIS path for displaying the output file properly. The ReportPath contains the physical path of the output file such as "C:\Inetpub\wwwroot\WebApp1\TempReports\". The IISReportPath contains the relative path to the current web application, such as "TempReports/".
The exporting process also has the ability to delete temporary generated report file after a specific period of time. This setting can be changed in DeleteOutputFileTime property in the ReportInfo object provided. The DeleteOutputFileTime is based on Minute TimeSpan and has default value of 15.
Deployment Notes: This assembly needs to be installed in server's GAC for the built-in exporting to work properly: ISNet.ActiveReports.Exporting.dll |
Walkthrough & How-To Topics
Walkthrough: Allowing Export in WebGrid
How-to: Invoke Export feature programmatically
How-to: Trigger Data Export in Client-Side Programmatically
How-to: Customize Export function
How-to: Export text when WebValueList is used
How-to: Use CacheToDisk feature to reduce memory usage
How-to: Set a different location for CacheToDisk feature
Getting Started
Getting Started
Overview
WebGrid Features Overview
Other Resources
Walkthrough Topics
How-to Topics