ExportExcelFile

ExportExcelFile(string)

Exporterar till en excel-fil.

public void ExportExcelFile(string fileName)

Exempel

[C#]
private void button1_Click(object sender, System.EventArgs e)
{
	gridDesktop1.Worksheets.ExportExcelFile("savedemo.xls");
}

[Visual Basic]
Private Sub menuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menuItem7.Click
	gridDesktop1.Worksheets.ExportExcelFile("savedemo.xls")
End Sub

Se även


ExportExcelFile(string, FileFormatType)

Exporterar till en excel-fil.

public void ExportExcelFile(string fileName, FileFormatType fileFormatType)
ParameterTypBeskrivning
fileNameStringNamnet på den skapade filen.
fileFormatTypeFileFormatTypeExcel-filformatstyp.

Se även


ExportExcelFile(Stream)

Exporterar till en Excel-filström, inklusive disk-IO-ström eller minnesström.

public void ExportExcelFile(Stream stream)

Exempel

[C#]
private void button1_Click(object sender, System.EventArgs e)
{
	FileStream fs = new FileStream("d:\\bookx.xls", FileMode.OpenOrCreate);
	try
	{
		gridDesktop1.Worksheets.ExportExcelFile(fs);
	}
	catch(Exception ex)
	{
	}
	finally
	{
		fs.Close();
	}
}

[Visual Basic]
Private Sub menuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menuItem6.Click
	Dim fs As FileStream =  New FileStream("d:\bookx.xls", FileMode.OpenOrCreate)
	Try
		gridDesktop1.Worksheets.ExportExcelFile(fs)
	Catch ex As Exception
		Throw ex
	Finally
		fs.Close()
	End Try
End Sub

Se även


ExportExcelFile(Stream, FileFormatType)

Exporterar till en Excel-filström, inklusive disk-IO-ström eller minnesström.

public void ExportExcelFile(Stream stream, FileFormatType fileFormatType)
ParameterTypBeskrivning
streamStreamStreama var du kan spara kalkylarket.
fileFormatTypeFileFormatTypeExcel-filformatstyp.

Se även