Skip to Content

In the first part of the blog i wrote about how i’ve built an annual statement in Design Studio 1.0.

If you haven’t read it yet here is the link :”

http://scn.sap.com/community/businessobjects-design-studio/blog/2013/03/22/building-an-annual-statement-in-design-studio-10

In this part I will describe the parts I have designed and how I think it would be easier to build them in the 1.1 version.

The navigation bar.

/wp-content/uploads/2013/03/picture_1_menubar_198556.jpg

The buttons on the left and right are designed for the user to be able to flip through the pages of the annual statement as if it’s an actual book. A small detail was that I wanted the left button to disappear when the user is on page one and the right button when the user is on the last page.

Currently the code is like this :

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 1) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(0);

       BUTTON_LEFT.setVisible(false);

}

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 2) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(1);

}

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 3) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(2);

}

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 4) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(3);

}

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 5) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(4);

}

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 6) {

       PAGEBOOK_MAINSTORY.setSelectedPageIndex(5);

}

As you see it has been worked out with a lot of if then statements. When calculation is possible in the 1.1 version as announced the code would look like this

EDIT *** As Vincent Low correctly states in the reply you can already do this like the code stated here below ***

PAGEBOOK_MAINSTORY.setSelectedPageIndex(PAGEBOOK_MAINSTORY.getSelectedPageIndex()-1);

if (PAGEBOOK_MAINSTORY.getSelectedPageIndex() == 1) {

       BUTTON_LEFT.setVisible(false);

}


For closing off all failing opportunities I should also put an IF THEN statement around the page change. If somewhere else in the app you can get to page one without hiding the left button you don’t want the statement goto page 0 to be executed.


The tables

I wanted a lot of tables with a particular layout and used a grid in combination with a lot of text objects.

/wp-content/uploads/2013/03/picture_2_tableitemnames_198587.jpg

  1. To fill all these I used coded names so I could keep track with all of them. I overdid it somewhat and the number of objects ran in the hundreds! That’s when I posted the idea to be able to find and object in the overview by searching for it based on name J

http://scn.sap.com/thread/3323475

In the application on startup event there are hundreds of lines like these :


OPERATINGINCOME_LY_TXT.setText(DS_2YEARESULTS.getDataAsString(“ZBB_AMNT”,{

       “0CALYEAR”: “2011”,

       “ZDS_THEME”: “0010002”

}));

NETINCOME_CY_TXT.setText(DS_2YEARESULTS.getDataAsString(“ZBB_AMNT”,{

       “0CALYEAR”: “2012”,

       “ZDS_THEME”: “0010003”

}));

NETINCOME_LY_TXT.setText(DS_2YEARESULTS.getDataAsString(“ZBB_AMNT”,{

       “0CALYEAR”: “2011”,

       “ZDS_THEME”: “0010003”

}));


As you see thanks to the name of the text object it is clear what it is. The descriptions I’ve put in manually. In 1.1 it will be possible to also get the dimension text with getdataasstring. Also the use of variables will make the code more readable. One thing you can shorten dramatically in code with variables is when you build a scorecard. Instead of the whole path of the image you can store it in a variable and your code would look like this :

IMG_SCORE.SETIMAGE(Greenscore) instead of
IMG_SCORE.SETIMAGE(“Root Folder/BI Demo/Design Studio/Probeersels/Business Balanced Scorecard (images)/ok-icon.png”)


Summary


In summary it’s a big task to build an annual statement in Design Studio at the moment. In the blogs about the announcements of the 1.1 version it’s foreseeable that things get easier to build.

It is great fun to think of scenario’s and putting design studio to the test. You are already able to build nice apps and at the same team learning a lot about the possibilities of the software.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Vin Cent Low

    Kudos, yet another great blog. While playing with the page mode and I came across a tip which might solve your long list of if statement.

    See code below;

    For next page button : PAGEBOOK_MAINSTORY.setSelectedPageIndex(PAGEBOOK_MAINSTORY.getSelectedPageIndex()+1)

    For previous page button :

    PAGEBOOK_MAINSTORY.setSelectedPageIndex(PAGEBOOK_MAINSTORY.getSelectedPageIndex()-1)

    I am interested if this can help you too.

    Cheers

    Vincent

    (0) 
    1. Jeroen van der A Post author

      Hi Vincent,

      thanks for the tip. I was so focused on the message that calculations would be in the next version i didn’t even try it. But i’ve tested it and it works fine. Thanks!

      Jeroen

      (0) 

Leave a Reply