1. Kevin Ridley
  2. PowerBuilder
  3. Wednesday, 5 May 2021 19:19 PM UTC

I've created a treeview datawindow with 3 levels.  The original highest level that gets set in the initial painter is fine, but when I create the second level, those values end up repeating.  I've tried Rows/Suppress repeating values and selected the second level column, and the values still repeat.  As an example, let's use individual columns for YEAR, MONTH, and DAY.  Year would be level one, Month level two.  My treeview will show 2021 at the highest level, then will have 31 rows of "01" for January and 28 for February, etc.  There's got to be something I'm missing.  I want it to show 2021 and then the next level should only have 12 items (Jan - Dec).  My data isn't this exactly, just using this as an example that's easy to follow.

 

Kevin

Accepted Answer
Kevin Ridley Accepted Answer Pending Moderation
  1. Thursday, 6 May 2021 21:18 PM UTC
  2. PowerBuilder
  3. # Permalink

UPDATE: looks like it was an issue with the dw painter in graphics mode.  I had setup the join and sort in graphics mode.  When I retrieved, it had a duplicate level 2 row for every level 3 row.  Using the same dw when I went back and converted to syntax and replaced with updated SQL (join in the FROM clause), the same dw retrieved properly with no duplicates.  I suppose it could be a driver issue.  We are using SQL Server and the SQL Native Client (they have not been willing to switch).

Comment
  1. Miguel Leeuwe
  2. Thursday, 6 May 2021 22:00 PM UTC
The only thing I use the graphic mode for is this:

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

1. In text mode: I write SELECT * FROM whateverTable

2. Then I convert to graphic mode

3. Then I convert back to text mode:

Result: the "Select * " has been replaced by SELECT with all the column names, which is how it should be.

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 6 May 2021 22:02 PM UTC
You could of course also skip 1. and start in graph mode and mark all the columns before doing 3.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 7 May 2021 13:51 PM UTC
Hi Guys;

Just remember that if you develop your SQL in "Syntax" mode - your "locked in" to that DBMS. If you develop your SQL in "Graphics" mode, the PB runtime will adjust the SQL at run time to support your app running dynamically across various DBMS vendors at execution time. One of the "Power's" of PowerBuilder. FWIW: I only use Graphics mode wherever possible. ;-)

Food for thought. Just my $0.02

Regards ... Chris
  1. Helpful
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 6 May 2021 13:29 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kevin,

I was not able to reproduce the problem.

See attached my example dw.

Regards,

René

Attachments (1)
Comment
  1. Kevin Ridley
  2. Thursday, 6 May 2021 20:11 PM UTC
Just tried this with an external dw like you did and it worked for me too. Just a theory, but I'm guessing it has something to do with retrieving to the treeview. I have 3 tables in my SQL. I'm going to play around with it and save the same sql data to a file and import it. Will update.
  1. Helpful
  1. Kevin Ridley
  2. Thursday, 6 May 2021 21:19 PM UTC
Update in a reply tagged as the solution. Thank you for helping.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 5 May 2021 20:00 PM UTC
  2. PowerBuilder
  3. # 2

Hi Kevin;

  I wonder if a TreeView Control might be a better choice here as

  1. You can control when each branch data is retrieved (better performance) and
  2. You can use a 2nd DWO in the month branch to control the month data roll-up by day.

Food for thought.

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Wednesday, 5 May 2021 23:48 PM UTC
Can you post a sample?
  1. Helpful
  1. Kevin Ridley
  2. Thursday, 6 May 2021 13:02 PM UTC
Yes I am sorting by the level 1 column, then level 2, then level 3. Only sorting on columns, no expression. I will try to find some time this afternoon to provide an example, but the scenario I mentioned above should work. If you create a result set with YYYY, Month, Day as your columns and use those as level 1, 2, 3, that should give the same results I'm describing.
  1. Helpful
  1. Kevin Ridley
  2. Thursday, 6 May 2021 21:20 PM UTC
Crazy, it turned out to be because the dw was created in graphics mode, probably a driver issue. Thanks for the help.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.