Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Read line after
mikaru
<p>Hello, I want know <span><span>how to</span> <span>read the value of</span> <span>the</span> <span>line</span> <span>after</span> <span>the results of</span> <span>a dataset</span></span>.</p><p>Example:</p><p> </p><p>I read row and i can test with a line after.</p><p> </p><p>If(row==row+1)</p><p> </p><p>I want know if this syntax operate in BIRT ??</p><p> </p>
Find more posts tagged with
Comments
GLO_FR
<p>Hi,</p><p> </p><p>you can't do it this way.</p><p>You have to place the value of <strong>row n</strong> in a variable (=in memory) and compare it with the value of <strong>row n+1</strong> on the next fetch.</p>
mikaru
<p>I can't in my case
that is why i need value row n+1 for know if in row n the value of row (n+1)== (row n) +1</p><p> </p><p>example : row n =2</p><p>row n+1=4</p><p> </p><p>in row n : i need test if (2 +1 != 4 {</p><p>Jour 2 Ã 2+1 else Jour 2 .</p><p> </p><p><span class='bbc_underline'><span style="font-size:14px;"><strong>This my code :</strong></span></span></p><p>valeur=reportContext.getPersistentGlobalVariable("valeurJourActuel");<br />
valeur++;<br />
if(BirtStr.indexOf("JOUR", row["CODE_CHAMP"])!=-1)<br />
{<br />
<br />
r=row.split(':');<br />
r=r[0].split('J');<br />
<br />
if(row=='FINSEJOUR')<br />
{<br />
<br />
titre=row.toUpperCase();<br />
}<br />
else if(valeur!=r[1])<br />
{<br />
titre='JOUR '+valeur+' Ã '+r[1];<br />
}<br />
else<br />
{<br />
titre='JOUR'+' '+r[1]+ valeur;<br />
}<br />
<br />
<br />
this.text=titre;<br />
this.text='<span style="font-size:17px;font-family:Myriad Pro Bold Condensed;">'+titre+'</span><br/><span style="font-size:16px;font-family:Myriad Pro Condensed">'+row+'</span><br/><br/>';<br />
reportContext.setPersistentGlobalVariable("valeurJourActuel", r[1]);</p><p> </p><p><span class='bbc_underline'><em>My result is </em>:</span></p><p> </p><p>Jour 01 :</p><p> Contenu 01</p><p>Jour 02:</p><p> contenu 02</p><p>Jour 3 Ã 4 :</p><p> Contenu 04</p><p> </p><p>But i need</p><p> </p><p>Jour 01 :</p><p> Contenu 01</p><p>Jour 02 Ã 3:</p><p> contenu 02</p><p>Jour 4 :</p><p> Contenu 04</p><p> </p><p>Jour 2 Ã 3 because there isn't content number 3</p>
micajblock
<p>The only way I can think of is to do 2 passes on the data. One populates an array (or hash map) of the values. Then the second pass does condition. With one pass the current row will never know what the next row is.</p>
GLO_FR
<p>Hi Mikaru,</p><p> </p><p>so to be clear, <span style="font-size:14px;">you've this in input</span></p><pre class="_prettyXprint _lang-">LIBELLE | VALEUR
+
Jour 1 | AJour 2 | BJour 4 | CJour 5 | DJour 8 | E</pre><p>and you want that in output</p><pre class="_prettyXprint _lang-">LIBELLE 2 | VALEUR
+
Jour 1 | AJour 2 Ã 3 | BJour 4 | CJour 5 Ã 7 | DJour 8 | E</pre>
mikaru
<p>Yes it's clear .</p>
GLO_FR
<p>Et voilà .</p><p> </p><p> </p><p> </p><p> </p>
mikaru
<p>Merci beaucoup
</p>
GLO_FR
<blockquote class="ipsBlockquote" data-author="mikaru" data-cid="127434" data-time="1397639092"><div><p>[color=rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;font-size:12px;]Comment je fais il dise que 3.2.23 n'est pas supporté avec mon eclipse 3.7.1.[/color]</p><p>Merci beaucoup
</p><p> </p><p><em>> What should I do, 3.2.23 is not supported by Eclipse 3.7.1</em></p><p><em>> Thanks</em></p></div></blockquote><p> </p><p> </p><p>Open the design in a notedpad and change the header</p><div><pre class="_prettyXprint"><report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1"></pre><p>I think you can delete this line (if not, change it with your version)</p><pre class="_prettyXprint _lang-"><property name="createdBy">Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035></property></pre><p>Open the design, say yes to the warning message.</p><p><span style="font-size:14px;">I've used standard BIRT function so it should works with your version</span></p></div><p> </p><p>(je vous réponds en anglais afin que d'autres personnes puissent profiter de ce thread
)</p>
mikaru
<p>Thank you, i have a question for the dataset DataSource out and datasetOut , how have you create, because when i click 0 indow oepn for datasource and a other which no ressemble window data set usual ?</p>
GLO_FR
<p>The output (source and dataset) is a scripted dataset. This kind of datasource allows you to use javascript to create a dataset.</p><p>What I'm doing :</p><p> </p><p>1)-I've a sample data set (Data In), coming from a database</p><p>2)-I put the content of my dataset in a memory array (onFetch Event of the DataSet "Data In")</p><p>3)-I read this array, make some tranformation and put my result in a Scripted DataSet (Fetch Event of the DataSet "Data Out"). </p><p>4)- After that, you can use the dataSet "Data Out" the way you want : in a chart, a table, a text field....</p><p> </p><p> </p><p>You've got some video tutorials here <a data-ipb='nomediaparse' href='
http://www.youtube.com/user/BIRTdeveloper'>http://www.youtube.com/user/BIRTdeveloper</a>.</p><p>One
about the scripted dataset will be uploaded soon.</p>
mikaru
<p>Thank you i understand ^^ but not a DataSource output.</p><p>I undestand that event OnFetch create a dataset output ?</p>
GLO_FR
<blockquote class="ipsBlockquote" data-author="mikaru" data-cid="127441" data-time="1397642147"><div><p>Thank you i understand ^^ but not a DataSource output.</p><p>I undestand that event OnFetch create a dataset output ?</p></div></blockquote><p>Check your private message in your account.</p>