'宣言 Public Overloads Function Export( _ ByVal grid As Infragistics.Win.UltraWinGrid.UltraGrid _ ) As Infragistics.Documents.Excel.Workbook
public Infragistics.Documents.Excel.Workbook Export( Infragistics.Win.UltraWinGrid.UltraGrid grid )
private void button2_Click(object sender, System.EventArgs e) { // overload 1 this.MyGridExporter.Export(this.ultraGrid1, "Test1.xls"); } private void button3_Click(object sender, System.EventArgs e) { // overload 2 Workbook wb1 = this.MyGridExporter.Export(this.ultraGrid1); wb1.Save("Test2.xls"); Workbook wb2 = new Workbook(); // overload 3 this.MyGridExporter.Export(this.ultraGrid1, wb2); Worksheet secondWS = wb2.Worksheets.Add("SecondSheet"); // overload 4 this.MyGridExporter.Export(this.ultraGrid1, secondWS); wb2.Save("Test3.xls"); Workbook wb3 = new Workbook(); // overload 5 this.MyGridExporter.Export(this.ultraGrid1, wb3, 1, 2); Worksheet someWS = wb3.Worksheets.Add("SomeSheet"); // overload 6 this.MyGridExporter.Export(this.ultraGrid1, someWS, 2, 3); wb3.Save("Test4.xls"); }
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' overload 1 Me.MyGridExporter.Export(Me.UltraGrid1, "Test1.xls") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim wb1, wb2, wb3 As Workbook Dim secondWS, someWS As Worksheet ' overload 2 wb1 = Me.MyGridExporter.Export(Me.UltraGrid1) wb1.Save("Test2.xls") wb2 = New Workbook() ' overload 3 Me.MyGridExporter.Export(Me.UltraGrid1, wb2) secondWS = wb2.Worksheets.Add("SecondSheet") ' overload 4 Me.MyGridExporter.Export(Me.UltraGrid1, secondWS) wb2.Save("Test3.xls") wb3 = New Workbook() ' overload 5 Me.MyGridExporter.Export(Me.UltraGrid1, wb3, 1, 2) someWS = wb3.Worksheets.Add("SomeSheet") ' overload 6 Me.MyGridExporter.Export(Me.UltraGrid1, someWS, 2, 3) wb3.Save("Test4.xls") End Sub