In this section table reports will be described for Foodmart on its wic wic_sample_foodmart. For more information on how to create this forms you can visit Chinook Basic table objects for a more detailed explanation.

1 Introduction

In here you will find a list and a brief explanation on what each of the table reports do and to what tables they are related to.

Object Tag Title Render Type Type of object Ordered by Tables related Description
store_analytics_list Sales Report SALES REPORT Report READ ONLY time_by_day.the_date, store.store_name, store.store_type, product_class.product_subcategory sales_fact, store, time_by_day, product, product_class Report of sales, costs, unit sales and profits by store and product subcategory.
annual_report_print Annual Report ANNUAL REPORT Form singlerow READ ONLY annual_report_data_lbl Printable report of annual sales, costs and profits.

All this atributes are modified in the Objects wic. To learn more about Object definitions check Developement Guide > Views > Objects.

2 Sales Report

Foodmart only has one table report which classifies by store and product subcategory the units sold, sales, cost and profit by asking from what range of dates at the start. See more about reports in Business Reports in Developement Guide > Objects.

XML

<exception title='Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_sample_foodmart]) for table &#039wic_database_object&#039 in database &#039wic_conf&#039'><STACKTRACE>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_sample_foodmart]) for table 'wic_database_object' in database 'wic_conf']
	at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:107)
	at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:202)
	at jdk.internal.reflect.GeneratedMethodAccessor331.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:343)
	at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440)
	at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222)
	at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475)
	at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
	at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69)
	at org.apache.xpath.XPath.execute(XPath.java:337)
	at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280)
	at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394)
	at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemElement.constructNode(ElemElement.java:341)
	at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:290)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
	at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253)
	at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:861)
	at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:698)
	at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:690)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
<Root-cause class='class org.apache.soap.SOAPException'>
</Root-cause>
</STACKTRACE></exception>

3 Annual Report print

This printable report includes graphs and modifiable lables in order to make it more personalized to the client. It uses the table annual_report_data_lbl to store headers, labels and texts. See more about report prints in the section Print in Developement Guide > Views > Objects.

3.1 Object

XML

<exception title='Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_sample_foodmart]) for table &#039wic_database_object&#039 in database &#039wic_conf&#039'><STACKTRACE>
[SOAPException: faultCode=SOAP-ENV:Server; msg=Exception from service object: java.sql.SQLException: No row bean PK([database_code])([wic_sample_foodmart]) for table 'wic_database_object' in database 'wic_conf']
	at deister.axional.docs.xsl.CMSSOAPClient.__doSOAPCall(CMSSOAPClient.java:107)
	at deister.axional.docs.xsl.CMSSOAPClient.getDictionaryObjectData(CMSSOAPClient.java:202)
	at jdk.internal.reflect.GeneratedMethodAccessor331.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:300)
	at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440)
	at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222)
	at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475)
	at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
	at org.apache.xpath.objects.XRTreeFragSelectWrapper.execute(XRTreeFragSelectWrapper.java:69)
	at org.apache.xpath.XPath.execute(XPath.java:337)
	at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280)
	at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:248)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:394)
	at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:248)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemElement.constructNode(ElemElement.java:341)
	at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:290)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
	at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
	at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253)
	at deister.axional.server.lang.xsl.XSLProcessor.__execute(XSLProcessor.java:861)
	at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:698)
	at deister.axional.server.lang.xsl.XSLProcessor$4.call(XSLProcessor.java:690)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
<Root-cause class='class org.apache.soap.SOAPException'>
</Root-cause>
</STACKTRACE></exception>

3.2 Graphs

3.2.1 SQL Table

Type: Supertable

XML

Copy
<select first='15'>
    <columns>
        store.store_id,
        store.store_name || ' (' || store.store_city || ')' store_name, 
        
        <!--g.unit_sales,-->
       row('ball', 'Units', sfms.unit_sales, (select Min(abs(a.unit_sales)) from sales_fact_month_store a),(select Max(abs(a.unit_sales)) from sales_fact_month_store a)) Bunit_sales,
       
       sfms.sales,
       row('vbar colored', 'Jan', sales_jan, 'Feb', sales_feb, 'Mar', sales_mar, 'Apr', sales_apr, 'May', sales_may, 'Jun', sales_jun, 'Jul', sales_jul , 'Aug', sales_ago, 'Sep', sales_sep, 'Oct', sales_oct, 'Nov', sales_nov, 'Dec', sales_dec) sales_m,
       row('percent', '%', sfms.sales_pct, 0,(select Max(abs(a.sales_pct)) from sales_fact_month_store a)) sales_perc,
       
       row('line', 'Jan', cost_jan, 'Feb', cost_feb, 'Mar', cost_mar, 'Apr', cost_apr, 'May', cost_may, 'Jun', cost_jun, 'Jul', cost_jul , 'Aug', cost_ago, 'Sep', cost_sep, 'Oct', cost_oct, 'Nov', cost_nov, 'Dec', cost_dec) cost_m,
       
       row('mm', 'cost', (sfms.cost_prev - sfms.cost), (select Min(a.cost_prev - a.cost) from sales_fact_month_store a),(select Max(a.cost_prev - a.cost) from sales_fact_month_store a)) cost_dif
       
    </columns>
    <from table='sales_fact_month_store' alias='sfms'>
        <join table='store'>
            <on>sfms.store_id = store.store_id</on>
        </join>
    </from>
    <where>
        the_year = ${the_year}
    </where>
    <order>1</order>
</select>

Type: Supertable

XML

Copy
<select first='10'>
    <columns>
        product_total_sales.product_id, 
        product.product_name, 
        product_class.product_subcategory, 
        product_class.product_family,
        product_total_sales.product_profit product_profit,
        product_total_sales.product_unit_sales unit_sales,
        row('percent', 'Total', product_total_sales.product_unit_sales, 0, (SELECT MAX(product_unit_sales) FROM product_total_sales)) unit_sales_perc,
        row('mm', 'dif', (product_total_sales.product_unit_sales - product_total_sales.product_unit_sales_prev), 0, 400) unit_sales_prv
    </columns>
    <from table='product_total_sales'>
        <join table='product'>
            <on>product_total_sales.product_id = product.product_id</on>
            <join table='product_class'>
                <on>product.product_class_id = product_class.product_class_id</on>
            </join>
        </join>
    </from>
    <order>5 DESC</order>
</select>

Type: Supertable

XML

Copy
<select first='10'>
    <columns>
        product_total_sales.product_id, 
        product.product_name, 
        product_class.product_subcategory, 
        product_class.product_family,
        product_total_sales.product_profit,
        product_total_sales.product_unit_sales unit_sales,
        row('percent', 'Total', product_total_sales.product_unit_sales, 0, (SELECT MAX(product_unit_sales) FROM product_total_sales)) unit_sales_perc,
        row('mm', 'dif', (product_total_sales.product_unit_sales - product_total_sales.product_unit_sales_prev), 0, 400) unit_sales_prv
    </columns>
    <from table='product_total_sales'>
        <join table='product'>
            <on>product_total_sales.product_id = product.product_id</on>
            <join table='product_class'>
                <on>product.product_class_id = product_class.product_class_id</on>
            </join>
        </join>
    </from>
    <where>
       product_total_sales.product_unit_sales IS NOT NULL 
    </where>
    <order>5</order>
</select>

Type: Supertable

XML

Copy
<select first='10'>
    <columns>
        customer.customer_id,
        customer.fullname,
        customer.city,
        customer.member_card,
        row('percent', 'Years', (time_by_day.the_year-YEAR(customer.date_accnt_opened)), 0, 10) years,
        (SUM(sales_fact.store_sales)-SUM(sales_fact.store_cost)) customer_profit,
        SUM(sales_fact.store_sales) sales,
        SUM(sales_fact.unit_sales) unit_sales
    </columns>
    <from table='customer'>
        <join table='sales_fact'>
            <on>customer.customer_id = sales_fact.customer_id</on>
            <join table='time_by_day'>
                <on>sales_fact.time_id = time_by_day.time_id</on>
            </join>
        </join>
    </from>
    <where>
        time_by_day.the_year = ${the_year}
    </where>
    <group>1,2,3,4,5</group>
    <order>6 desc</order>
</select>

3.2.2 SQL JChart

Type: Cartesian

XML

Copy
<select>
            <columns>
                time_by_day.month_of_year,
                time_by_day.the_month,
                SUM(sales_fact.store_cost) store_cost, 
                SUM(sales_fact.store_sales) store_sales,
                (SUM(sales_fact.store_sales) - SUM(sales_fact.store_cost)) profit
            </columns>
            <from table='sales_fact'>
                <join  table='time_by_day' >
                    <on>sales_fact.time_id = time_by_day.time_id</on>
                </join>
            </from>
            <where>
                time_by_day.the_year = ${the_year}
            </where>
            <group>1,2</group>
            <order>1</order>
        </select>

Type: Pie

XML

Copy
<select>
            <columns>          
                store.store_type,         
                (SUM(sales_fact.store_sales) - SUM(sales_fact.store_cost)) profit
            </columns>
            <from table='sales_fact'>
                <join table='time_by_day'>
                    <on>sales_fact.time_id = time_by_day.time_id</on>
                </join>
                <join table='store'>
                    <on>sales_fact.store_id = store.store_id</on>
                </join>
            </from>
            <where>
                time_by_day.the_year = ${the_year}
            </where>
            <group>1</group>
            <order>1</order>
        </select>

Type: Cartesian

XML

Copy
<call>
            <args>
                <arg>${the_year}</arg>
            </args>
            <![CDATA[
                <xsql-script name='xsql_pivot'>
                    <args>
                        <arg name='p_the_year' type='integer' />
                    </args>
                    <body>
                       
                       <vtable name='v_out'>
                           <select>
                                <columns>
                                    store.store_type, 
                                    time_by_day.quarter, 
                                    SUM(sales_fact.store_sales) sales
                                </columns>
                                <from table='sales_fact'>
                                    <join table='store'>
                                        <on>sales_fact.store_id = store.store_id</on>
                                    </join>
                                    <join table='time_by_day'>
                                        <on>sales_fact.time_id = time_by_day.time_id</on>    
                                    </join>
                                </from>
                                <where>
                                    time_by_day.the_year = <p_the_year/>
                                </where>
                                <group>1,2</group>
                                <order>2</order>
                            </select>
                        </vtable>
                        <return><vtable.pivot name='v_out' pivotcolumns='store_type' pivotsort='quarter' datacolumns='sales' /></return>
                   </body>
                </xsql-script>
            ]] >
        </call>

Type: Cartesian

XML

Copy
<union type='all' intotemp='@tmp1'>
        	<select>
        		<columns>
        			customer.yearly_income,
        			NVL((SUM(sales_fact.store_sales))-(SUM(sales_fact.store_cost)),0) store_profit_m,
        			0 store_profit_f
        		</columns>
        		<from table='sales_fact'>
        			<join table='customer'>
        				<on>sales_fact.customer_id = customer.customer_id</on>
        			</join>
        			<join table='time_by_day' >
        	            <on>sales_fact.time_id = time_by_day.time_id</on>
        	        </join>
        		</from>
        		<where>
        			customer.gender = 'M' AND time_by_day.the_year = ${the_year}
        		</where>
        		<group>1</group>
        	</select>
        	<select>
        		<columns>
        			customer.yearly_income,
        			0 store_profit_m,
        			NVL((SUM(sales_fact.store_sales))-(SUM(sales_fact.store_cost)),0) store_profit_f
        		</columns>
        		<from table='sales_fact'>
        			<join table='customer'>
        				<on>sales_fact.customer_id = customer.customer_id</on>
        			</join>
        			<join table='time_by_day' >
        	            <on>sales_fact.time_id = time_by_day.time_id</on>
        	        </join>
        		</from>
        		<where> 
        			customer.gender = 'F' AND time_by_day.the_year = ${the_year}
        		</where>
        		<group>1</group>
        	</select>
        </union>
        
        <select>
            <columns>
                yearly_income,       	
        		SUM(store_profit_m) store_profit_m,
        	    (SUM(store_profit_f) * -1) store_profit_f
            </columns>
            <from table='@tmp1'/>
            <group>1</group>
            <order>2 desc</order>
        </select>