GridDesktop.ImportExcelFile

ImportExcelFile(Stream)

Imports from an excel file stream, including disk file stream or memory stream.

public void ImportExcelFile(Stream stream)

Examples

[C#]
private void button1_Click(object sender, System.EventArgs e)
{
	FileStream fs = new FileStream("d:\\bookx.xls", FileMode.Open);
	try
	{
		gridDesktop1.ImportExcelFile(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.Open)
	Try
		gridDesktop1.ImportExcelFile(fs)
	Catch ex As Exception
		Throw ex
	Finally
		fs.Close()
	End Try
End Sub

See Also


ImportExcelFile(Stream, bool)

Imports from an excel file stream, including disk file stream or memory stream.

public void ImportExcelFile(Stream stream, bool runFormulas)
ParameterTypeDescription
streamStreamstream object.
runFormulasBooleanif true, this method will invoke RunAllFormulas method.

See Also


ImportExcelFile(string)

Imports from an excel file.

public void ImportExcelFile(string fileName)

Examples

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

[Visual Basic]
Private Sub menuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menuItem6.Click
	gridDesktop1.ImportExcelFile("FinancialPlan.xls")
End Sub

See Also


ImportExcelFile(string, bool)

Imports from an excel file.

public void ImportExcelFile(string fileName, bool runFormulas)
ParameterTypeDescription
fileNameStringexcel file name.
runFormulasBooleanif true, this method will invoke RunAllFormulas method.

See Also


ImportExcelFile(Stream, string, string, bool, bool)

Imports from an excel file.

public void ImportExcelFile(Stream stream, string passwordtoOpen, string passwordtoModify, 
    bool openasReadOnly, bool runFormulas)
ParameterTypeDescription
streamStreamstream of excel file .
passwordtoOpenStringthe open password for the file which is encrypted .
passwordtoModifyStringthe modify password for the file which is protected .
openasReadOnlyBooleanwhether to open the file as ReadOnly .
runFormulasBooleanif true, this method will invoke RunAllFormulas method.

See Also


ImportExcelFile(string, string, string, bool, bool)

Imports from an excel file.

public void ImportExcelFile(string fileName, string passwordtoOpen, string passwordtoModify, 
    bool openasReadOnly, bool runFormulas)
ParameterTypeDescription
fileNameStringexcel file name.
passwordtoOpenStringthe open password for the file which is encrypted .
passwordtoModifyStringthe modify password for the file which is protected .
openasReadOnlyBooleanwhether to open the file as ReadOnly .
runFormulasBooleanif true, this method will invoke RunAllFormulas method.

See Also


ImportExcelFile(string, int)

Imports a worksheet from an excel file.

public void ImportExcelFile(string fileName, int sheetIndex)
ParameterTypeDescription
fileNameStringexcel file name.
sheetIndexInt32index of sheet to be imported.

See Also