spagobi移动端报表的制作

spagobi移动端报表的制作
spagobi移动端报表的制作

第一种形式的表格制作:使用的是移动报表引擎

数据集列表:

SELECT

the_month,

month_of_year

,(SUM( case when p.product_family='Food' then store_sales else 0 end)) as Food

,(SUM( case when p.product_family='Drink' then store_sales else 0 end)) as Drink

,(SUM( case when p.product_family='Non-Consumable' then store_sales else 0 end)) as Nonconsum

FROM

time_by_day t, sales_fact f, product p

where

t.time_id=f.time_id and

p.product_id=f.product_id

GROUP BY

the_month, month_of_year

ORDER BY

month_of_year

查询出来的数据源显示方式为:

则写出来的xml文件是这样的:(文件名称为:PRV_T004D_REV_dt.xml)

width="100%"height="100%"

documentstyle="background-color:white; margin:25px 3px 3px;

padding-top:1px; padding-left:1px; padding-right:1px; padding-bottom:31px; border:solid 1px lightgrey; border-top-left-radius:2px; border-top-right-radius:2px; border-bottom-left-radius:10px; border-bottom-right-radius:10px"

>

Sales and costs for product family

]]>

所做出来的效果图如下所示:名称为:

TAB1 sales and cost detail

第二种制作表格的方式:

数据库和上面的是一样的:

Xml文件名称是:PRV_T004D_REV_dt1.xml

width="100%"height="100%"

documentstyle="background-color:white; margin:25px 3px 3px; padding-top:1px; padding-left:1px; padding-right:1px; padding-bottom:31px; border:solid 1px lightgrey; border-top-left-radius:2px; border-top-right-radius:2px; border-bottom-left-radius:10px; border-bottom-right-radius:10px"

>

Sales and costs for product family

]]>

多加了这一个标签,钻取可以按月份向下钻取,但是没什么太大的意义。

图名称为:tab2 montly sales

第三种制作表格的方式:

数据集为:

SELECT

s.store_city city

,sum(case when t.month_of_year=1 then store_sales else 0 end) as Jan

,sum(case when t.month_of_year=2 then store_sales else 0 end) as Feb

,sum(case when t.month_of_year=3 then store_sales else 0 end) as Mar

,sum(case when t.month_of_year=4 then store_sales else 0 end) as Apr

,sum(case when t.month_of_year=5 then store_sales else 0 end) as May

,sum(case when t.month_of_year=6 then store_sales else 0 end) as Jun

,sum(case when t.month_of_year=7 then store_sales else 0 end) as Jul

,sum(case when t.month_of_year=8 then store_sales else 0 end) as Ago

,sum(case when t.month_of_year=9 then store_sales else 0 end) as Sep

,sum(case when t.month_of_year=10 then store_sales else 0 end) as Oct

,sum(case when t.month_of_year=11 then store_sales else 0 end) as Nov

,sum(case when t.month_of_year=12 then store_sales else 0 end) as Dece

FROM

time_by_day t, sales_fact f, product p, store s

where

t.time_id=f.time_id and

p.product_id=f.product_id and

s.store_id=f.store_id and

p.product_family='Drink'

GROUP BY

store_city

ORDER BY

store_city

展示结果为:

所作出来的xml文件为:

PRV_T004D_REV_dt2.xml

其中的内容是:

width="100%"height="100%"

documentstyle="background-color:white; margin:10px 3px 3px; padding-top:1px; padding-left:1px; padding-right:1px; padding-bottom:31px; border:solid 1px lightgrey; border-top-left-radius:2px; border-top-right-radius:2px; border-bottom-left-radius:10px; border-bottom-right-radius:10px"

>

Sales by city for product family: DRINK

]]>

以上均是设计页面用的。Width设计每一列的宽度,header设计的是每一列头标题,value设计的是数据集展示中的名称。后面的就是设计的样式。

style="font-family:Verdana; font-size:10px; background-color:#000045; color:white; text-align:right"/>

设计的效果如:

Tab3 drinks sales for city

以下将介绍以下spagobi中自带的移动图表引擎制作的相关。

第一种形式bar:如图所示:

数据集如下:

SELECT

month_of_year,

substring(the_month, 1,3) as month

,sum(case when s.store_type='Supermarket' then store_sales else 0 end) as Supermarket ,sum(case when s.store_type like '%Grocery%' then store_sales else 0 end) as Grocery

,sum(case when s.store_type like '%Gourmet%' then store_sales else 0 end) as Gourmet

,sum(case when s.store_type = 'Deluxe Supermarket' then store_sales else 0 end) as Boutiques

FROM

time_by_day t, sales_fact f, store s

where

t.time_id=f.time_id and

s.store_id=f.store_id

group by the_month,month_of_year

ORDER BY

month_of_year

展示的效果如下:

所作出来的效果图如下:

Bar1 sales and cost summary

第一个为标题

上面有四个可以选择的项目,分别是supermarket,grocery,gourmet,boutiques,展示的这几项当你选择点击那一项,将会在下面的表中显示,当那些表示颜色的原点点击后消失,将不显示其展示的数据,只显示没有消失的原点下的数据。

其XML文件名称是:

PRV_T004D_REV_ch.xml

内容:

style="background-color:white; top:10px; border-bottom-left-radius:10px; border-bottom-right-radius:10px"

documentstyle="background-color:white; margin:25px 3px 3px; padding-top:1px; padding-left:1px; padding-right:1px; padding-bottom:91px; border:solid 1px lightgrey; border-top-left-radius:2px; border-top-right-radius:2px; border-bottom-left-radius:10px; border-bottom-right-radius:10px" enableuserfunction="true">

Sales for store type

]]>

设计标题和标题格式的。

#000066

#003399

#0066FF

#3333FF

设计四列supermarket,grocery,gourmet,boutiques不同种类的四种颜色

固定格式,一种设计。

在该标签中的设计,全是种类之类的。

SUPERMARKET

GROCERY

GOURMET

BOUTIQUES

以上的这种属于不同种类的选择。supermarket,grocery,gourmet,boutiques

MONTH

以上这种是设计图标显示的目录列表的。是以月份来进行列表的。

该标签则是设计显示表的。

stacked="true">