{"id":3,"date":"2020-11-06T15:50:26","date_gmt":"2020-11-06T14:50:26","guid":{"rendered":"https:\/\/ad-astra.com.pl\/?p=1"},"modified":"2021-01-22T10:59:50","modified_gmt":"2021-01-22T09:59:50","slug":"responsywny_lumira_designer","status":"publish","type":"post","link":"https:\/\/ad-astra.com.pl\/en\/2020\/11\/06\/responsywny_lumira_designer\/","title":{"rendered":"Designing Responsive App Structure in Lumira Designer"},"content":{"rendered":"<p>As technology advances, mobile devices, tablets and smartphones are becoming an integral part of our lives. This dependence also extends to our professional lives and the way we conduct business. <\/p>\n\n\n\n<p>For this reason, every year customers increasingly prefer viewing data and reports on mobile devices. Truly, this shouldn\u2019t be a surprise to anybody - practically all of us do not part with our  phones. This trend results in reports being accessible from anywhere, at any time, supporting business decisions in a better and faster manner. <\/p>\n\n\n\n<p>However, the usage of mobile devices is associated with certain limitations, such as a much smaller screen and resolution compared to the ordinary PC. These factors may also differ significantly depending on the smartphone model. This could make preparing an application that would display all the necessary data in a legible and intuitive manner a challenge. Fortunately, modern BI software offer many ways of dealing with this problem. In this article we will explain one of them. <\/p>\n\n\n\n<p><br><strong>Our goal<\/strong> - creating a responsive structure for the application that changes depending on the orientation (vertical \/ horizontal) and resolution of the mobile device. To accomplish this, we will be using SAP Lumira Designer. As Lumira's built-in scripting language currently doesn\u2019t support detecting a change in screen resolution, we will also be using the built-in support for CSS scripts.<\/p>\n\n\n\n<p><br><strong>Step 1<\/strong> - Create a new application based on an empty template.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"605\" height=\"192\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_1.jpg\" alt=\"\" class=\"wp-image-205\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_1.jpg 605w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_1-300x95.jpg 300w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_1-535x170.jpg 535w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_1-16x5.jpg 16w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<p><strong>Step 2<\/strong> - Add two panels to the application and maximize them (Maximize Selected Component button). Panels are container-type objects into which we can place other elements. Place a chart in one of the panels, and a Crosstab in the other. Maximize them both so that they overlap each other (see \u2013 picture below).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"605\" height=\"298\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2.jpg\" alt=\"\" class=\"wp-image-207\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2.jpg 605w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2-300x148.jpg 300w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2-535x264.jpg 535w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2-16x8.jpg 16w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_2-406x200.jpg 406w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<p><strong>Step 3<\/strong> - Create a new new CSS file for the application<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"386\" height=\"136\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_3.jpg\" alt=\"\" class=\"wp-image-209\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_3.jpg 386w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_3-300x106.jpg 300w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_3-16x6.jpg 16w\" sizes=\"(max-width: 386px) 100vw, 386px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"430\" height=\"274\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_4.jpg\" alt=\"\" class=\"wp-image-210\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_4.jpg 430w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_4-300x191.jpg 300w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_4-16x10.jpg 16w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_4-314x200.jpg 314w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/figure>\n\n\n\n<p><strong>Step 4<\/strong> - Add the CSS rules <\/p>\n\n\n\n<p>Using the @media rule, we can define dynamic CSS properties that become active only when the given conditions are met.<\/p>\n\n\n\n<p><br>We will start with a simple rule that checks if the device screen orientation is set to \u201clandscape\u201d. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media screen and (orientation:landscape)\n\t{\t\n\t\t   \t\n\t}\n<\/code><\/pre>\n\n\n\n<p><br>Between the braces we enter CSS properties that become active when the condition is met. In this example, let's try hiding one of the objects (as a reminder, we hide the Panel type object). <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media screen and (orientation:landscape)\n\t{\t\n\t\t   \t#PANEL_1_panel1\t\t{ display: none;}\n\t}\n<\/code><\/pre>\n\n\n\n<p>Where: \n\"PANEL_1\" is the name of our panel in Lumira Designer. <\/p>\n\n\n\n<p>\"PANEL_1_panel1\" is the Panel\u2019s ID as read by CSS <\/p>\n\n\n\n<p>{ display: none; } - CSS rule that hides the specified element. <\/p>\n\n\n\n<p><br>We will now add a second @media rule which will hide the second panel, this time  in portrait orientation. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media screen and (orientation:landscape)\n\t{\t\n\t\t   \t#PANEL_1_panel1\t\t{ display: none;}\n\t}\n@media screen and (orientation:portrait)\n\t{\t\n\t\t   \t#PANEL_2_panel1\t\t{ display: none;}\n\t}\n<\/code><\/pre>\n\n\n\n<p><br><strong>Step 5<\/strong> - Save changes and run the application.\nIf we have performed all the steps correctly, only one panel should be visible on mobile devices or their simulation at a time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"605\" height=\"399\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5.jpg\" alt=\"\" class=\"wp-image-213\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5.jpg 605w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5-300x198.jpg 300w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5-535x353.jpg 535w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5-16x12.jpg 16w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_5-303x200.jpg 303w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"471\" height=\"715\" src=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_6.jpg\" alt=\"\" class=\"wp-image-212\" srcset=\"https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_6.jpg 471w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_6-198x300.jpg 198w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_6-8x12.jpg 8w, https:\/\/ad-astra.com.pl\/wp-content\/uploads\/2020\/11\/a1_6-132x200.jpg 132w\" sizes=\"(max-width: 471px) 100vw, 471px\" \/><\/figure>\n\n\n\n<p>- Save changes and run the application.\nIf we have performed all the steps correctly, only one panel should be visible on mobile devices or their simulation at a time. <\/p>\n\n\n\n<p>For example, if the properties are to be active when the a) screen height is in the range of 375-413 pixels, and b) the screen height is smaller than its width (as in \u201cLandscape\u201d orientation) , we can use the following rule: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media screen and (min-height: 375px) and (max-height: 413px) and (orientation:landscape)\n\t{  \t\n\t   \t#PANEL_1_panel1\t\t{ display: none;}\n   \t}\n<\/code><\/pre>\n\n\n\n<p>The internet is filled with templates for specific phone models. On this note, I hope you found the article useful. Thanks for reading!<\/p>","protected":false},"excerpt":{"rendered":"<p>As technology advances, mobile devices, tablets and smartphones are becoming an integral part of our lives. This dependence also extends to our professional lives and the way we conduct business.\nFor this reason, every year customers increasingly prefer viewing data and reports ...<\/p>","protected":false},"author":2,"featured_media":209,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[54,55,56,18,52,53,19],"_links":{"self":[{"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/posts\/3"}],"collection":[{"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/comments?post=3"}],"version-history":[{"count":11,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/posts\/3\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/posts\/3\/revisions\/287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/media\/209"}],"wp:attachment":[{"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/media?parent=3"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/categories?post=3"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ad-astra.com.pl\/en\/wp-json\/wp\/v2\/tags?post=3"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}