In the WebChart features overview page, I show you seven demo, the first three are telling you how to display data in table format pages, then next four pages are telling you how to display data in different types of charts. You can create the demo pages after you install it.
Suppose that we have a summary table of the trade, it contains the monthly summarized trade count of latest two years.
CREATE TABLE TRADE_SUMMARY_MONTHLY
(
TRADE_MONTH DATE,
TRADE_COUNT NUMBER(12)
);
You need to create some text file suffix with WCML, and put them into following directory.
c:\TomcatWebChart\webapps\webchart
/TomcatWebChart/webapps/webchart
Let's create first demo (demo1.wcml) with the following lines.
WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
to_char(trade_month,'yyyy/mm') month , \
trade_count count \
from trade_monthly_summary \
where to_char(trade_month,'yyyy')='2008'
Let's create second demo (demo2.wcml) with the following lines.
WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
to_char(trade_month,'"Q"q') quater , \
to_char(trade_month,'mm') month , \
trade_count count \
from trade_monthly_summary \
where to_char(trade_month,'yyyy')='2008' \
ORDER BY 1,2
WEBCHART.GROUP_1=1
Let's create third demo (demo3.wcml) with the following lines.
WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select to_char(trade_month,'mm') month , \
to_char(trade_month,'yyyy') year , \
trade_count count \
from trade_monthly_summary \
order by 1,2
WEBCHART.CROSSTAB_1=on
In the third demo, the SQL look much more complexed, you can split it into multiple lines, and concat them with reverse slah char. The access the demo pages with the following URLs.
http://localhost:8080/webchart/demo1.wcml
http://localhost:8080/webchart/demo2.wcml
http://localhost:8080/webchart/demo3.wcml
Display single SQL query's data is very easy, but export them to Excel is a little complex.
