WebSheetReports

Use Case 2: Web Reports

One headache in application development is clients may require to change their reports from time to time. Normally this will invlove code changes even the middle tire remain the same.

Web Sheet seperate the presentation tier's modification from the application changes. Bascically you can design/change any format of reports in Excel then save it to your repository (e.g. databases). Web Sheet will pick up your changes from there without application code changes.

Demo

Set attribute readOnly="true".

Excel Template.

Sale Price Report
Price List
Item NumberNameDescriptionPrice
brief descriptionmsrp
${item.code}${item.name}${item.description}${item.price}
Note
If you require help, please email to: Jason.Jiang.ca@gmail.com

Data

CodeNameDescriptionPrice
GC1020BMWBMW Car Black85438.0
GC1021FiatFiat Green 29328.0
GC1022JaguarJaguar Car Red98289.0
GC1040MercedesMercedes Car Blue99990.0
GC1060BMWBMW White75000.0

Results

Sale Price Report
Price List
Item NumberNameDescriptionPrice
brief descriptionmsrp
GC1020BMWBMW Car Black85438.00
GC1021FiatFiat Green 29328.00
GC1022JaguarJaguar Car Red98289.00
GC1040MercedesMercedes Car Blue99990.00
GC1060BMWBMW White75000.00
GC3020IBM Think PadIBM V120010200.00
GC3040IPAD AIRIPAD AIR V3.038000.00
GC3060SOFTWAREWINDOWS 1095000.00
GC5020IPHONEIPHONE V1128000.00
GC5040IWATCHIWATCH V1259900.00
GC5060IBOOKIBOOK V15110000.00
IN7020JaguarJaguar Car Blue4000.00
IN7040MercedesMercedes Car White16000.00
IN7060BMWBMW Red42000.00
IN7080SOFTWAREWINDOWS x69000.00
SL9020IPAD AIRIPAD AIR V2.04999.00
SL9040BMWBMW Black9999.00
SL9060IPHONEIPHONE Golden V2.014999.00
SL9080IPHONEIPHONE Golden V2.219999.00
Note
If you require help, please email to: Jason.Jiang.ca@gmail.com
Source code
<p>Set attribute readOnly="true".</p>
<h:form id="form1">
    <p>Excel Template.</p>

    <tie:websheet id="sheet1" webSheetBean="#{webSheetReports_Config}"
        maxRowsPerPage="30" readOnly="true">
    </tie:websheet>
    <p>Data</p>


    <p:dataTable var="item" value="#{webSheetReports.itemList}"
        rows="5" paginator="true" paginatorPosition="bottom" style="width:800px;">
        <p:column headerText="Code">
            <h:outputText value="#{item.code}" />
        </p:column>

        <p:column headerText="Name">
            <h:outputText value="#{item.name}" />
        </p:column>

        <p:column headerText="Description">
            <h:outputText value="#{item.description}" />
        </p:column>

        <p:column headerText="Price">
            <h:outputText value="#{item.price}" />
        </p:column>
    </p:dataTable>

    <p>Results
    <p:commandButton id="cmdExportResult" value="Export the result to Excel"
        ajax="false" actionListener="#{webSheetReports.doExport()}">
        <p:fileDownload value="#{webSheetReports.exportFile}" />
    </p:commandButton>
    </p>
    <tie:websheet id="sheet2" webSheetBean="#{webSheetReports}"
        maxRowsPerPage="30" readOnly="true" showLineNumber="false">
    </tie:websheet>


</h:form>