Difference between revisions of "WikiTaskTutorial/Excel"

From BITPlan Wiki
Jump to navigation Jump to search
(created by WikiTask 2020-04-27T07:42:14Z)
Line 1: Line 1:
 
{{PageSequence|prev=WikiTask Tutorial/Rythm Engine|next=WikiTaskTutorial/Excel97|category=Wikitask Tutorial|categoryIcon=document}}<br>
 
{{PageSequence|prev=WikiTask Tutorial/Rythm Engine|next=WikiTaskTutorial/Excel97|category=Wikitask Tutorial|categoryIcon=document}}<br>
 
This is an Example for accessing an Excel  <img src='http://img2.wikia.nocookie.net/__cb20120509174748/logopedia/images/thumb/3/38/It%27s_EXCELlent!.png/80px-It%27s_EXCELlent!.png'/> xlsx document from a WikiTask.
 
This is an Example for accessing an Excel  <img src='http://img2.wikia.nocookie.net/__cb20120509174748/logopedia/images/thumb/3/38/It%27s_EXCELlent!.png/80px-It%27s_EXCELlent!.png'/> xlsx document from a WikiTask.
The example file is http://cdcontent.books24x7.com/id_16959/real%20estate%20table.xlsx.
+
The example file is [[File:Air-routes.xlsx]] generated with the {{Link|target=SimpleGraph-Excel}} module.
 
=== template ===
 
=== template ===
 
This template includes {{Link|target=Office#Excel}}
 
This template includes {{Link|target=Office#Excel}}

Revision as of 09:46, 27 April 2020


This is an Example for accessing an Excel xlsx document from a WikiTask. The example file is File:Air-routes.xlsx generated with the SimpleGraph-Excel module.

template

This template includes Office#Excel

@include(wiki.Office.Excel)
Excel file: @(wikiTask.getInput()) 
@if(excel.error) {  
can not be opened due to error @(excel.error.getMessage())
} else { has the following sheets:
@for (int i=0;i<excel.workbook.getNumberOfSheets();i++) { @{XSSFSheet sheet = excel.workbook.getSheetAt(i);List<List<String>> sheetContent=excel.getSheetContent(sheet);String delim="!"} 
=== @(sheet.getSheetName()) ===
@("{")|class="wikitable sortable"
@for (List<String> row:sheetContent) { @for (col:row) {
@(delim)@col
}
|-
@{ delim="|" }
}
@("|}")
}
}
@{ try { excel.workbook.close(); }  catch (Throwable th) { }}
{{wikitask|cmd=runtemplate|input=http://cdcontent.books24x7.com/id_16959/real%20estate%20table.xlsx|engine=Rythm|template={{FULLPAGENAMEE}}#template|targetpage={{FULLPAGENAMEE}}#result}}

runtemplate -> WikiTaskTutorial/Excel#result

result

Excel file: http://cdcontent.books24x7.com/id_16959/real%20estate%20table.xlsx can not be opened due to error No valid entries or contents found, this is not a valid OOXML (Office Open XML) file