Start of Content Area

This graphic is explained in the accompanying text Changing the Display: Table, Chart, Table and Chart  Locate the document in its SAP Library structure

In your Web application, you want to be able to display data in a table or graphic, similar to in the Web Analyzer.

You can do this by using the Dropdown Box Web item and linking the commands for showing and hiding Web items to it:

...

       1.      Insert the Analysis and Chart Web items into your Web template. Set the required parameters and link both Web items to the same data provider. For the initial display type, set the Visibility parameter of the Chart Web item to Hidden.

       2.      To allow users to toggle the display type, choose the Dropdown Box Web item and drag it to your Web template using drag and drop.

       3.      Choose the data binding type Fixed List of Options from the parameter list for the Web item. This allows you to define your own commands for each entry in the dropdown box.

       4.      In the fixed list of options, enter a text (such as "table") in the Description of Selection field. This text can be language-dependent.

       5.      For the corresponding command, call the command wizard by choosing the pushbutton (see Commands).

       6.      On the All Commands tab page, choose Commands for Web Items. Select the command Set Web Item Parameters (SET_ITEM_PARAMETERS) and double-click it to choose it.

       7.      Since the table must be switched to visible to select the table display type in the Web application, choose the Analysis Web item for Target Web Item. All parameters for the Analysis Web item are now displayed.

       8.      Set the Visibility parameter (VISIBILITY) to Visible (VISIBLE). Do not accept the default value.

       9.      Since the graphic display must be switched to hidden to select the table display type in the Web application, choose Next Command in the command wizard.

   10.      Insert the Set Web Item Parameters (SET_ITEM_PARAMETERS) command again.

   11.      This time, choose the Chart Web item as the target Web item and set the Visibility parameter (VISIBILITY) to Hidden (HIDDEN). Do not accept the default value.

   12.      Repeat steps four to eleven for the dropdown box entries Chart (switch Analysis Web item to hidden, Chart Web item to visible) and Table and Chart (switch Analysis Web item and Chart Web item to visible).

Sample Code

Below is the complete sample code from the XHTML view of the Web Application Designer:

<bi:bisp  xmlns="http://www.w3.org/TR/REC-html40" xmlns:bi="http://xml.sap.com/2005/01/bi/wad/bisp" xmlns:jsp="http://java.sun.com/JSP/Page" >

  <html >

    <head >

      <title >NetWeaver BI Web Application</title>

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    </head>

    <body >

      <bi:QUERY_VIEW_DATA_PROVIDER name="DP_1" >

        <bi:INITIAL_STATE type="CHOICE" value="QUERY" >

          <bi:QUERY value="YOURQUERY" text="Type" />

        </bi:INITIAL_STATE>

      </bi:QUERY_VIEW_DATA_PROVIDER>

      <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

      <p >

          <bi:DROPDOWN_ITEM name="DROPDOWN_ITEM_1" designheight="70" designwidth="200" >

                <bi:DATA_BINDING_TYPE type="CHOICE" value="STATIC_OPTION_LIST" >

                    <bi:STATIC_OPTION_LIST type="ORDEREDLIST" >

                        <bi:STATIC_OPTION type="COMPOSITE" index="1" >

                            <bi:SELECTION_TEXT value="Table" />

                            <bi:ACTION type="CHOICE" value="INSTRUCTION" >

                                <bi:INSTRUCTION >

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="ANALYSIS_ITEM" >

                                            <bi:VISIBILITY value="VISIBLE" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="ANALYSIS_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="CHART_ITEM" >

                                            <bi:VISIBILITY value="HIDDEN" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="CHART_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                </bi:INSTRUCTION>

                            </bi:ACTION>

                        </bi:STATIC_OPTION>

                        <bi:STATIC_OPTION type="COMPOSITE" index="2" >

                            <bi:SELECTION_TEXT value="Chart" />

                            <bi:ACTION type="CHOICE" value="INSTRUCTION" >

                                <bi:INSTRUCTION >

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="CHART_ITEM" >

                                            <bi:VISIBILITY value="VISIBLE" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="CHART_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="ANALYSIS_ITEM" >

                                            <bi:VISIBILITY value="HIDDEN" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="ANALYSIS_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                </bi:INSTRUCTION>

                            </bi:ACTION>

                        </bi:STATIC_OPTION>

                        <bi:STATIC_OPTION type="COMPOSITE" index="3" >

                            <bi:SELECTION_TEXT value="Table and Chart" />

                            <bi:ACTION type="CHOICE" value="INSTRUCTION" >

                                <bi:INSTRUCTION >

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="ANALYSIS_ITEM" >

                                            <bi:VISIBILITY value="VISIBLE" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="ANALYSIS_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                    <bi:SET_ITEM_PARAMETERS >

                                        <bi:cmd_item_parameters type="CHART_ITEM" >

                                            <bi:VISIBILITY value="VISIBLE" />

                                        </bi:cmd_item_parameters>

                                        <bi:TARGET_ITEM_REF value="CHART_ITEM_1" />

                                    </bi:SET_ITEM_PARAMETERS>

                                </bi:INSTRUCTION>

                            </bi:ACTION>

                        </bi:STATIC_OPTION>

                    </bi:STATIC_OPTION_LIST>

                </bi:DATA_BINDING_TYPE>

            </bi:DROPDOWN_ITEM>

        <br />

        <br />

      </p>

      <p >

        <bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" >

          <bi:DATA_PROVIDER_REF value="DP_1" />

        </bi:ANALYSIS_ITEM>

        <bi:CHART_ITEM name="CHART_ITEM_1" designheight="200" designwidth="400" >

          <bi:VISIBILITY value="HIDDEN" />

          <bi:DATA_PROVIDER_REF value="DP_1" />

        </bi:CHART_ITEM>

        <br />

        <br />

      </p>

    </body>

  </html>

</bi:bisp>

 

Tips

      If you want to make multiple Web items visible or invisible at the same time, use the Container Web item and arrange the required Web items in the Container Web item. Switch the Visibility parameter of the Container Web item to visible or hidden.

      The Set Parameters for Web Item (SET_ITEM_PARAMETERS) command is a command that is used often. We therefore recommend that you add this command to your favorite commands in the command wizard.

 

End of Content Area