Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3510

Re: Set Filter + isResultSetEmpty On Startup?

$
0
0

Well, it's been a few months, but if I recall correctly the issue that I was having seemed related to this, but in fact was not and this may be the case for you as well Shaunakh.

 

The issue that I had was that the DS_1.isResultSetEmpty() was always false, however after looking at all of the members in DS_1 I realized that I was wrong.  Here is an example:

 

-----------------------

DS_1 has the following fields:

  • first name
  • last name
  • street
  • month
  • total income (measure)

 

I wanted to verify that the datasource (DS_1) had values using DS_1.isResultSetEmpty(). If it had values then I wanted to do some calculation on total income. The issue for me was that while DS_1 had values for one or more if it's fields it did not always have values for total income. As a result the isResultSetEmpty() would always return false, however when I checked on the value of total income I did not get what I expected to get.

-----------------------


Here is one way to see if you are experiencing the same problem that I was experiencing. In your code where you expect the result to be empty and it's not the "if (DS_1.isResultSetEmpty())" do something like this (my syntax may not be 100% correct for this code)


===================

if (!DS_1.isResultSetEmpty())      // note the ! in the if, this means NOT

{

     var mDimensions = DS_1.getDimensions();     // get all of the dimensions in the result set

     for (i = 0; i < mDimensions.length; i++)     // loop though the result set

     {

          textBox1.setText(textBox1.getText() + " \n DS_1[" + mDimensions + "]  = " + DS_1[mDimensions]);     //output the result from the loop

     }

}

===================


Essentially you are looping through all of the dimensions in the data source and displaying the value for each one. I haven't use Design Studio for more then a month, so my syntax may not be 100% correct.


Pete


Viewing all articles
Browse latest Browse all 3510

Latest Images

Trending Articles



Latest Images

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