In this example, the data source is a CSV file.
The command
LNCTOXLS is used to generate Excel file.
String Destination=c:\\temp\\destination.xls";
DataSource
myDataSource = new DataSource();
myDataSource.setType("csv");
myDataSource.setPath("c:\\temp\\source.csv");
LNCTOXLS myLNCTOXLS
= new LNCTOXLS();
myLNCTOXLS.setToXls("*new");
myLNCTOXLS.setToSheet("*NONE");
myLNCTOXLS.setToName("*NONE");
myLNCTOXLS.setColPref("*NONE");
myLNCTOXLS.setAutoFmt("*NONE");
myLNCTOXLS.setAutoFit("true");
myLNCTOXLS.setFmtCells("false");
myLNCTOXLS.setAddColH("false");
myLNCTOXLS.setShowDoc("true");
myLNCTOXLS.setSourceData(myDataSource);
myLNCTOXLS.setLNCSrvAddr("192.168.1.9");
myLNCTOXLS.setSavFmt("*XLS");
myLNCTOXLS.setSavDoc(Destination);
myLNCTOXLS.setRecCnt(55); //Mandatory if Type = csv
myLNCTOXLS.execute();