首页 > 代码库 > WDA基础九:BusinessGraphics

WDA基础九:BusinessGraphics

好像很少有人用这玩意。。。好难玩,好废。。。和ABAP的那个图一样废。。。。

 

很多报表都是用BO,BI什么做的,不仅废,而且很多BO顾问不懂代码,写出来的报表挫的要死。。。。

WDA的网页图形报表分析,将就着玩玩吧。

新建程序:ZWD_GRAPH  对应视图VIEW,窗口ZWD_GRAPH

一、节点和属性设置

context页签,新增节点:GRAPH

技术分享

 

增加属性:DESCRIPTION         STRING

                  WERKS1                  I

                  WERKS2                  I

                  WERKS3                  I

 二、页面布局

根节点ROOTUIELEMENTCONTAINER下加入ELEMENT :BusinessGraphics

右键BusinessGraphics对象,加入CATEGORY-描述字段-对应上面的DESCRIPTION属性

加入上面的三个数值,SERIES

分别将BusinessGraphics绑到GRAPH

CATEGORY绑到DESCRIPTION

WERKS1   ->WERKS1

WERKS2   ->WERKS2

WERKS3   ->WERKS3

初始化复制,或者动作更新值就OK了

METHOD WDDOINIT .
  DATA LO_ND_GRAPH TYPE REF TO IF_WD_CONTEXT_NODE.
  DATA LT_GRAPH TYPE WD_THIS->ELEMENTS_GRAPH.
  DATA:LS_GRAPH TYPE WD_THIS->ELEMENT_GRAPH.
  DATA:V_RAND TYPE I.

  LO_ND_GRAPH = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_GRAPH ).

  DEFINE RANDOM.
    CALL FUNCTION GENERAL_GET_RANDOM_INT
    EXPORTING
      RANGE  = 90
    IMPORTING
      RANDOM = V_RAND.
  END-OF-DEFINITION.


  LS_GRAPH-DESCRIPTION = Q1.
  RANDOM.
  LS_GRAPH-WERKS1 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS2 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS3 = V_RAND.
  APPEND LS_GRAPH TO LT_GRAPH.

  LS_GRAPH-DESCRIPTION = Q2.
  RANDOM.
  LS_GRAPH-WERKS1 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS2 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS3 = V_RAND.
  APPEND LS_GRAPH TO LT_GRAPH.


  LS_GRAPH-DESCRIPTION = Q3.
  RANDOM.
  LS_GRAPH-WERKS1 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS2 = V_RAND.
  RANDOM.
  LS_GRAPH-WERKS3 = V_RAND.
  APPEND LS_GRAPH TO LT_GRAPH.





  LO_ND_GRAPH->BIND_TABLE( NEW_ITEMS = LT_GRAPH SET_INITIAL_ELEMENTS = ABAP_TRUE ).

ENDMETHOD.

技术分享

 

WDA基础九:BusinessGraphics