Need help in rotating the text

viky4frnds
edited February 11, 2022 in Analytics #1
<p>Hi,</p>
<p> </p>
<p>I need to generate the report in  xlsx format. Headers need to display in vertical order.</p>
<p><strong>1   | 2</strong></p>
<p><strong>E   | E </strong></p>
<p><strong>M  | M</strong></p>
<p><strong>A   | A</strong></p>
<p><strong>N   | N</strong></p>
<p>
</p>
<p>A1 | A2</p>
<p> </p>
<p>On the above sample NAME1 and NAME2 are headers. if I use label that is not displayed in expecting format.</p>
<p> </p>
<p>I am using API to generate the report. I have tried with below code.</p>
<p> </p>
<p>ExtendedItemHandle <span>rotatedText</span>=elementFactory.newExtendedItem("ex1", "RotatedText");<br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"rotationAngle"</span><span>,</span><span> </span><span>"90"</span><span>);</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"text"</span><span>,</span><span> </span><span>"\"Test\""</span><span>);</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"wrapPoint"</span><span>,</span><span> </span><span>"0in"</span><span>);</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"linkURL"</span><span>,</span><span> </span><span>"\"<a data-ipb='nomediaparse' href=''>http://www.Actuate.com\""</a></span><span>);</span><span&gt; </span><span>//You can also use a relative path</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"fontFamily"</span><span>,</span><span> </span><span>"sans-serif"</span><span>);</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"fontSize"</span><span>,</span><span> </span><span>"30pt"</span><span>);</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"fontStyle"</span><span>,</span><span> </span><span>"italic"</span><span>);</span><span> </span><span>//Options: "normal" or "italic"</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"fontWeight"</span><span>,</span><span> </span><span>"bold"</span><span>);</span><span> </span><span>//Options: "normal" or "bold"</span><br><span>rotatedText</span><span>.</span><span>setProperty</span><span>(</span><span>"color"</span><span>,</span><span> </span><span>"#FF0000"</span><span>);</span><br><br>
cell.getContent().add(<span>rotatedText</span>);<span> </span></p>
<p> </p>
<p>I am getting null in <span>rotatedText. can any one tell me how to achieve this? Any JAR files required this??</span></p>
<p> </p>
<p><span>Is there any alternative way to achieve this?</span></p>
<p> </p>
<p> </p>
<p><span>Thanks in advance</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>

Comments

  • <p>Hi,</p>
    <p> </p>
    <p>please refer this link</p>
    <p><a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/topic/39246-rotate-text-90-degrees/'>http://developer.actuate.com/community/forum/index.php?/topic/39246-rotate-text-90-degrees/</a></p&gt;
    <p> </p>
    <p> </p>
    <p>Regards</p>
    <p>Shasha</p>
  • <p>Thanks for the reply. I have referred the same link you preferred. but i got null when create new extenditem for rotate text</p>
    <p><span>rotatedText</span><span>=</span><span>elementFactory</span><span>.</span><span>newExtendedItem</span><span>(</span><span>"ex1"</span><span>,</span><span> </span><span>"RotatedText"</span><span>);</span></p>
    <p> </p>
    <p><span>I am using maven project. </span></p>
    <p> </p>
    <p> </p>
    <p><span>Thanks</span></p>
  • <p>viky4frnds,</p>
    <p> </p>
    <p>From your initial description, it seems that you want a Cross Tab rather than to rotate the text.</p>
    <p>Cross Tab:  <a data-ipb='nomediaparse' href='http://help.eclipse.org/kepler/topic/org.eclipse.birt.doc/birt/ct-PresentingDataInACrossTabIntro.html?cp=8_0_15'>http://help.eclipse.org/kepler/topic/org.eclipse.birt.doc/birt/ct-PresentingDataInACrossTabIntro.html?cp=8_0_15</a></p&gt;
    <p>Rotated Text (barcode example):  <a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/uploads/monthly_05_2015/post-49613-0-26413500-1432831071.png'>http://developer.actuate.com/community/forum/uploads/monthly_05_2015/post-49613-0-26413500-1432831071.png</a></p&gt;
    <p> </p>
    <p>Also I believe you could be receiving the error for the rotated text api due to a few possible things.</p>
    <p>Please make sure you have downloaded the .JAR files from the following location and place them in your "eclipse/plugins" folder, then restart your BIRT designer:  <a data-ipb='nomediaparse' href='https://github.com/innoventsolutions/innoventsolutions.github.io/tree/master/2.5.2/plugins'>https://github.com/innoventsolutions/innoventsolutions.github.io/tree/master/2.5.2/plugins</a></p&gt;
    <p> </p>
    <p>You also do not need to use the API calls to rotate the labels (they were mentioned in that post as reference), if the plugins are loaded properly you should see new rotated elements in your BIRT Palette which you can drag and drop using the GUI builder.</p>
    <p> </p>
    <p> </p>
    <p>Rotated barcode reference from:  <a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/topic/36636-properly-displaying-a-barcode-when-rotated-90-degrees/?p=136535'>http://developer.actuate.com/community/forum/index.php?/topic/36636-properly-displaying-a-barcode-when-rotated-90-degrees/?p=136535</a></p&gt;
    Warning No formatter is installed for the format ipb
  • <p>you can also refer the following link to create the rotated text by yourself with some custom modifications.</p>
    <p> </p>
    <p><a data-ipb='nomediaparse' href='https://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial1/index.html'>https://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial1/index.html</a></p&gt;
    <p> </p>
    <p>Regards</p>
    <p>Shashank</p>
  • <p>Hi,</p>
    <p> </p>
    <p>I am not using eclipse to design the rptdesign file. I have used BIRT api to create the rptdesign file.</p>
    <p>So only i have written the below code for rotate text</p>
    <p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">ExtendedItemHandle </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">=elementFactory.newExtendedItem("ex1", "RotatedText");</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"rotationAngle"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"90"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"text"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"\"Test\""</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"wrapPoint"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"0in"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"linkURL"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"\"<a class="bbc_url" href="http://developer.actuate.com/community/forum/index.php?/topic/40439-need-help-in-rotating-the-text/&quot; title="External link">http://www.Actuate.com\""</a></span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">//You can also use a relative path</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"fontFamily"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"sans-serif"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"fontSize"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"30pt"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"fontStyle"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"italic"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">//Options: "normal" or "italic"</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"fontWeight"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"bold"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">//Options: "normal" or "bold"</span><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">.</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">setProperty</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"color"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">,</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">"#FF0000"</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span><br><br><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">cell.getContent().add(</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">rotatedText</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">);</span></p>
    <p> </p>
    <p> </p>
    <p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I am using </span>birt.runtime.3_7_1 to create the rptdesign using api's</p>
    <p> </p>
    <p>did this version allows rotatetext api?</p>
    <p> </p>
    <p>If i used the below code for chart, it is working fine</p>
    <p>ExtendedItemHandle extendedItemHandle = elementFactory.newExtendedItem("Simple Chart", "Chart");</p>
    <p> </p>
    <p>But problem only in rotate text.</p>
    <p> </p>
    <p> </p>
    <p>Thanks</p>
  • <p>Hi,</p>
    <p> </p>
    <p>I can create it using 3.7.1 also using DE API's.</p>
    <p>Did you placed the required jars in the run-time library you are using as mentioned by Matthew also above? Only then you can use the RotatedText element.</p>
    <p>Also, you can test this by first adding jar to eclipse IDE and check if you can see a custom visualization named Rotated Text. </p>
    <p> </p>
    <p>Regards</p>
    <p>Shasha</p>