| |
ExcelDocument workbook = new ExcelDocument(1);
workbook.easy_getSheetAt(0).setSheetName("First tab");
ExcelTable xlsFirstTable =
((ExcelWorksheet)workbook.easy_getSheetAt(0)).easy_getExcelTable();
for (int column=0; column<5; column++)
{
xlsFirstTable.easy_getCell(0,column).setValue("Column " + (column + 1));
xlsFirstTable.easy_getCell(0,column).setDataType(DataType.STRING);
}
for (int row=0; row<100; row++)
{
for (int column=0; column<5; column++)
{
xlsFirstTable.easy_getCell(row+1,column).setValue(
"Data " + (row + 1) + ", " + (column + 1));
xlsFirstTable.easy_getCell(row+1,column).setDataType(DataType.STRING);
}
}
workbook.easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab");
| Click here to see Continuous Code Listing
| | |
Dim workbook As New ExcelDocument(1)
workbook.easy_getSheetAt(0).setSheetName("First tab")
Dim xlsFirstTab As ExcelWorksheet = workbook.easy_getSheetAt(0)
Dim xlsFirstTable = xlsFirstTab.easy_getExcelTable()
For column As Integer = 0 To 4
xlsFirstTable.easy_getCell(0, column).setValue("Column " & (column + 1))
xlsFirstTable.easy_getCell(0, column).setDataType(DataType.STRING)
Next
For row As Integer = 0 To 99
For column As Integer = 0 To 4
xlsFirstTable.easy_getCell(row + 1, column).setValue( _
"Data " & (row + 1) & ", " & (column + 1))
xlsFirstTable.easy_getCell(row + 1, column).setDataType(DataType.STRING)
Next
Next
workbook.easy_WriteCSVFile("C:\Samples\Export to CSV.csv", "First tab")
| Click here to see Continuous Code Listing
| | |
C++
EasyXLS::IExcelDocumentPtr workbook;
hr = CoCreateInstance(__uuidof(EasyXLS::ExcelDocument),
NULL,
CLSCTX_ALL,
__uuidof(EasyXLS::IExcelDocument),
(void**) &workbook) ;
workbook->easy_addWorksheet_2("First tab");
EasyXLS::IExcelWorksheetPtr xlsFirstTab =
(EasyXLS::IExcelWorksheetPtr)workbook->easy_getSheetAt(0);
EasyXLS::IExcelTablePtr xlsFirstTable = xlsFirstTab->easy_getExcelTable();
char* cellValue = (char*)malloc(11*sizeof(char));
char* columnNumber = (char*)malloc(sizeof(char));
for (int column=0; column<5; column++)
{
strcpy(cellValue, "Column ");
_itoa(column+ 1, columnNumber, 10);
xlsFirstTable->easy_getCell(0,column)->setValue(strcat(cellValue, columnNumber));
xlsFirstTable->easy_getCell(0,column)->setDataType(DATATYPE_STRING);
}
char* rowNumber = (char*)malloc(sizeof(char));
for (int row=0; row<100; row++)
{
for (int column=0; column<5; column++)
{
strcpy(cellValue, "Data ");
_itoa(column+ 1, columnNumber, 10);
_itoa(row + 1, rowNumber, 10);
strcat(cellValue, rowNumber);
strcat(cellValue, ", ");
strcat(cellValue, columnNumber);
xlsFirstTable->easy_getCell(row+1,column)->setValue(cellValue);
xlsFirstTable->easy_getCell(row+1,column)->setDataType(DATATYPE_STRING);
}
}
workbook->easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab");
Click here to see Continuous Code Listing
C++.NET
ExcelDocument ^workbook = gcnew ExcelDocument(1);
workbook->easy_getSheetAt(0)->setSheetName("First tab");
ExcelWorksheet ^xlsFirstTab =
safe_cast<ExcelWorksheet^>(workbook->easy_getSheetAt(0));
ExcelTable ^xlsFirstTable = xlsFirstTab->easy_getExcelTable();
for (int column=0; column<5; column++)
{
xlsFirstTable->easy_getCell(0,column)->setValue(
String::Concat("Column ",(column + 1).ToString()));
xlsFirstTable->easy_getCell(0,column)->setDataType(DataType::STRING);
}
for (int row=0; row<100; row++)
{
for (int column=0; column<5; column++)
{
xlsFirstTable->easy_getCell(row+1,column)->setValue(String::Concat(
"Data ", (row + 1).ToString(), ", ", (column + 1).ToString()));
xlsFirstTable->easy_getCell(row+1,column)->setDataType(DataType::STRING);
}
}
workbook->easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab");
Click here to see Continuous Code Listing
| |
ExcelDocument workbook = new ExcelDocument(1);
workbook.easy_getSheetAt(0).setSheetName("First tab");
ExcelTable xlsFirstTable =
((ExcelWorksheet)workbook.easy_getSheetAt(0)).easy_getExcelTable();
for (int column=0; column<5; column++)
{
xlsFirstTable.easy_getCell(0,column).setValue("Column " + (column + 1));
xlsFirstTable.easy_getCell(0,column).setDataType(DataType.STRING);
}
for (int row=0; row<100; row++)
{
for (int column=0; column<5; column++)
{
xlsFirstTable.easy_getCell(row+1,column).setValue(
"Data " + (row + 1) + ", " + (column + 1));
xlsFirstTable.easy_getCell(row+1,column).setDataType(DataType.STRING);
}
}
workbook.easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab");
| Click here to see Continuous Code Listing
| | |
.NET:
$workbook = new COM("EasyXLS.ExcelDocument");
$workbook->easy_addWorksheet_2("First tab");
$xlsFirstTable = $workbook->easy_getSheetAt(0)->easy_getExcelTable();
for ($column=0; $column<5; $column++)
{
$xlsFirstTable->easy_getCell(0,$column)->setValue("Column " . ($column + 1));
$xlsFirstTable->easy_getCell(0,$column)->setDataType($DATATYPE_STRING);
}
for ($row=0; $row<100; $row++)
{
for ($column=0; $column<5; $column++)
{
$xlsFirstTable->easy_getCell($row+1,$column)->setValue(
"Data ".($row + 1).", ".($column + 1));
$xlsFirstTable->easy_getCell($row+1,$column)->setDataType($DATATYPE_STRING);
}
}
$workbook->easy_WriteCSVFile("C:\Samples\Export to CSV.csv","First tab");
Click here to see Continuous Code Listing
Java:
$workbook = new java("EasyXLS.ExcelDocument");
$workbook->easy_addWorksheet("First tab");
$xlsFirstTable = $workbook->easy_getSheetAt(0)->easy_getExcelTable();
for ($column=0; $column<5; $column++)
{
$xlsFirstTable->easy_getCell(0,$column)->setValue("Column " . ($column + 1));
$xlsFirstTable->easy_getCell(0,$column)->setDataType($DATATYPE_STRING);
}
for ($row=0; $row<100; $row++)
{
for ($column=0; $column<5; $column++)
{
$xlsFirstTable->easy_getCell($row+1,$column)->setValue(
"Data ".($row + 1).", ".($column + 1));
$xlsFirstTable->easy_getCell($row+1,$column)->setDataType($DATATYPE_STRING);
}
}
$workbook->easy_WriteCSVFile("C:\Samples\Export to CSV file.csv", "First tab");
Click here to see Continuous Code Listing
| |
Set workbook = Server.CreateObject("EasyXLS.ExcelDocument")
workbook.easy_addWorksheet_2("First tab")
Set xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
for column = 0 to 4
xlsFirstTable.easy_getCell(0,column).setValue("Column " & (column + 1))
xlsFirstTable.easy_getCell(0,column).setDataType(DATATYPE_STRING)
next
for row = 0 to 99
for column = 0 to 4
xlsFirstTable.easy_getCell(row+1,column).setValue( _
"Data " & (row + 1) & ", " & (column + 1))
xlsFirstTable.easy_getCell(row+1,column).setDataType(DATATYPE_STRING)
next
next
workbook.easy_WriteCSVFile "C:\Samples\Export to CSV.csv", "First tab"
| Click here to see Continuous Code Listing
| | |
Set workbook = CreateObject("EasyXLS.ExcelDocument")
workbook.easy_addWorksheet_2 ("First tab")
Set xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
For Column = 0 To 4
xlsFirstTable.easy_getCell(0, Column).setValue ("Column " & (Column + 1))
xlsFirstTable.easy_getCell(0, Column).setDataType (DataType.DATATYPE_STRING)
Next
For row = 0 To 99
For Column = 0 To 4
xlsFirstTable.easy_getCell(row + 1, Column).setValue ( _
"Data " & (row + 1) & ", " & (Column + 1))
xlsFirstTable.easy_getCell(row + 1, Column).setDataType ( _
DataType.DATATYPE_STRING)
Next
Next
workbook.easy_WriteCSVFile "C:\Samples\Export to CSV.csv", "First tab"
| Click here to see Continuous Code Listing
| | |
Set workbook = CreateObject("EasyXLS.ExcelDocument")
workbook.easy_addWorksheet_2("First tab")
Set xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
For Column = 0 To 4
xlsFirstTable.easy_getCell(0,column).setValue("Column " & (Column + 1))
xlsFirstTable.easy_getCell(0,column).setDataType(DATATYPE_STRING)
Next
For row = 0 To 99
For column = 0 To 4
xlsFirstTable.easy_getCell(row+1,column).setValue( _
"Data " & (row + 1) & ", " & (column + 1))
xlsFirstTable.easy_getCell(row+1,column).setDataType(DATATYPE_STRING)
Next
Next
workbook.easy_WriteCSVFile "C:\Samples\Export to CSV.csv", "First tab"
| Click here to see Continuous Code Listing
| | |
<cfobject type="java" class="EasyXLS.ExcelDocument" name="workbook" action="CREATE">
<cfset ret = workbook.easy_addWorksheet("First tab")>
<cfset xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()>
<cfloop from="0" to="4" index="column">
<cfset xlsFirstTable.easy_getCell(0, evaluate(column)).setValue(
"Column " & evaluate(column + 1))>
<cfset xlsFirstTable.easy_getCell(0, evaluate(column)).setDataType(
DataType.STRING)>
</cfloop>
<cfloop from="0" to="99" index="row">
<cfloop from="0" to="4" index="column">
<cfset xlsFirstTable.easy_getCell(
evaluate(row + 1), evaluate(column)).setValue(
"Data " & evaluate(row + 1) & ", " & evaluate(column + 1))>
<cfset xlsFirstTable.easy_getCell(evaluate(row + 1),
evaluate(column)).setDataType(DataType.STRING)>
</cfloop>
</cfloop>
<cfset ret = workbook.easy_WriteCSVFile("C:\Samples\Export to CSV.csv", "First tab")>
| Click here to see Continuous Code Listing
| | |
.NET:
workbook = ExcelDocument(1)
workbook.easy_getSheetAt(0).setSheetName("First tab")
xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
for column in range(5):
xlsFirstTable.easy_getCell(0,column).setValue("Column " + str(column + 1))
xlsFirstTable.easy_getCell(0,column).setDataType(DataType.STRING)
for row in range(100):
for column in range(5):
xlsFirstTable.easy_getCell(row+1,column).setValue("Data " + str(row + 1) + ", " + str(column + 1))
xlsFirstTable.easy_getCell(row+1,column).setDataType(DataType.STRING)
workbook.easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab")
Click here to see Continuous Code Listing
Java:
workbook = gateway.jvm.ExcelDocument(1)
workbook.easy_getSheetAt(0).setSheetName("First tab")
xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
for column in range(5):
xlsFirstTable.easy_getCell(0,column).setValue("Column " + str(column + 1))
xlsFirstTable.easy_getCell(0,column).setDataType(gateway.jvm.DataType.STRING)
for row in range(100):
for column in range(5):
xlsFirstTable.easy_getCell(row+1,column).setValue("Data " + str(row + 1) + ", " + str(column + 1))
xlsFirstTable.easy_getCell(row+1,column).setDataType(gateway.jvm.DataType.STRING)
workbook.easy_WriteCSVFile("C:\\Samples\\Export to CSV.csv", "First tab")
Click here to see Continuous Code Listing
| |
|