Intersoft WebGrid Documentation
ExportGrid(DynARInfo) Method
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class > ExportGrid Method : ExportGrid(DynARInfo) Method






reportInfo
ReportInfo object contains export behaviors.
Export datasource with current grid's layout to other formats.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ExportGrid( _
   ByVal reportInfo As DynARInfo _
) As String
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim reportInfo As DynARInfo
Dim value As String
 
value = instance.ExportGrid(reportInfo)
C# 
public string ExportGrid( 
   DynARInfo reportInfo
)
Delphi 
public function ExportGrid( 
    reportInfo: DynARInfo
): String; 
JScript 
public function ExportGrid( 
   reportInfo : DynARInfo
) : String;
Managed Extensions for C++ 
public: string* ExportGrid( 
   DynARInfo* reportInfo
) 
C++/CLI 
public:
String^ ExportGrid( 
   DynARInfo^ reportInfo
) 

Parameters

reportInfo
ReportInfo object contains export behaviors.

Return Value

Output filename of result.

Example

This sample code below shows you how to export data using a button

[C#]

private void Button1_Click(object sender, System.EventArgs e)

{

     // invoke the grid's export feature
     // through the server side

     WebGrid1.ExportGrid(SetDynInfo());

}

 

private DynARInfo SetDynInfo()
{

      // configure the DynARInfo object
      // as the parameter for the ExportGrid() method

      // need to configure 4 things :
      // dynInfo.ReportType
      // dynInfo.ReportPath
      // dynInfo.IISReportPath
      // dynInfo.DynPageOrientation

      DynARInfo dynInfo = new DynARInfo("html", Server.MapPath("~/TempReports") + @"\");
      dynInfo.IISReportPath = "/TempReports/";
      private DynARInfo SetDynInfo()

      return dynInfo;

}

Remarks

WebGrid.NET Enterprise provides 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 and filtered columns. The built-in exporting feature integrates DataDynamic's ActiveReports runtime engine to generate the reports to HTML and PDF format. The ActiveReport's engine is only used internally by WebGrid.NET at runtime and doesn't require you to add references of ActiveReport's assembly in your VS.NET solution.  

Alternatively, WebGrid.NET Enterprise also allows you to use your own exporting codes or module to handle exporting functionality instead using the built-in exporting feature. When using your own custom exporting, you can skip the inclusion of built-in exporting runtime assemblies. That means WebGrid.NET assembly does not depend on the built-in exporting runtime assemblies on deployment time. This makes the WebGrid.NET totally independent, fully customizable and extensible.

Before 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.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.