WebSheetViewer

Use Case 1: Excel Viewer

You may ask why I need a Excel Viewer? Yes, we already have Google Docs which are more powerful, but they may not fit into your application. Here just show you how to use web sheet component as a Excel Viewer.

Demo

How to use web sheet component as Excel viewer

Set attribute readOnly="true".

ABCDE
1
2My budget
3Add your spending limit here:
4$24,000.00$2,000.00
5
6PercentYearlyMonthly
7Categories Add your spending percentages here:
8Housing (mortgage, rent)20%$4,800$400.00
9Food (groceries)8%$1,920$160.00
10Auto (loan, maintenance)8%$1,920$160.00
11Savings8%$1,920$160.00
12Debt7%$1,680$140.00
13Ent/Rec/Eating-out/Vacations 7%$1,680$140.00
14Clothing6%$1,440$120.00
15Insurance (auto, home, life)6%$1,440$120.00
16Medical/Dental/Eye5%$1,200$100.00
17Misc5%$1,200$100.00
18School/Childcare/Tuition5%$1,200$100.00
19Investments/Stocks/Bonds/Mutual Funds/other 5%$1,200$100.00
20
21
22
2390.00%$21,600.00$1,800.00
24
25* This budget is meant to be a starting point to help you begin to budget. Hire a professional financial consultant if you want a fuller understanding of your finances.
26
Source code
<h3>How to use web sheet component as Excel viewer</h3>

<p>Set attribute readOnly="true".</p>
<h:form id="form1">
        
    <tie:websheet id="sheet1" webSheetBean="#{webSheetViewer}"
        maxRowsPerPage="30" readOnly="true">
    </tie:websheet>
    
    <p:commandButton id="cmdExport" value="Download the Excel Sheet"
        ajax="false" actionListener="#{webSheetViewer.doExport()}">
        <p:fileDownload value="#{webSheetViewer.exportFile}" />
    </p:commandButton>
    
    
</h:form>