Quantcast
Channel: SCN : Popular Discussions - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 1411

Extracting Dimension Values from a Data Source

$
0
0

I wanted to create a control that would extract all of the dimensions from a data source, and then create a single string with comma separated values.

 

I started with the simple table sample and kept the following component:

<property
id="column1"
title="Column X"
type="ResultCellList"
group="DataBinding">
<option name="includeFormattedData" value="true"/>
<option name="includeMetadata" value="true"/>
</property>

 

I then modified the afterUpdate function to:

this.afterUpdate = function() {

   if(JSON.stringify(this.metadata()).length){

      try{

         for(i=1; i < this.metadata().dimensions[1].members.length-1; i++){

            if(i==1){

               commaStr = this.metadata().dimensions[1].members[i].text;

            }

            else{

               tempStr=commaStr;              

               commaStr = tempStr + ', ' + this.metadata().dimensions[1].members[i].text;

            }

         }

      alert(commaStr);

      }catch(e)

         {

      }

   }

};

 

This does give me the output that I want:

string_1, string_2, string_3, string_4, ...

 

My questions are:

  • Currently, I have to assign a data source through Data Binding: Data Source and Column 1, in the Design Studio interface.
    • I want to only assign the data source, since I am not showing the data selected in Column 1.
  • I am using ResultCellList, should I be using ResultSet? If so, then how would my code change?
  • Are there definitions somewhere that explains exactly how to use the ResultSet, ResultCellList, and others?
  • After assigning the Data Source, the AfterUpdate function gets called. What is passed to the AfterUpdate function? Is there a way to access the data source and its contents in this AfterUpdate call?

 

Thanks,

Robert


Viewing all articles
Browse latest Browse all 1411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>