Printing Contents of Tree Widget

Author: kathy.seeman@noris.org (kathseem)

I have a form that displays notes in a tree format. Our users would like to be able to print the notes. If I use Ctrl+P, nothing prints out. Does anyone have the code to print out the contents of a tree widget?

5 Comments

  1. Hi Kathy, I think the "contents of a tree widget" you mean not the contents of the field, which is the selected node but the tree-graphic you see on your screen. So a screenshot is the way to get this image printed (expl. hit the button "print screen" to get the image of the screen to the clipboard). So you may have a look at: http://unifaceinfo.com/forum/unifacetipsandtricks/takingacurrentscreenprint/ for some more details.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Hi Ulrich, I'm not thinking the printscreen will do what my users want. I believe the printscreen function will only capture a screenshot. Therefore, if there were more notes than would show in the window, you'd have to move the scrollbar to see the other notes. On occasion, they want to be able to print out all the notes on a case, so they have a hard copy. For example, on another Uniface form without a tree widget, my search returns 17 rows from the database, but only 10 can fit on the screen. If I click CTRL+P, all of the data prints out--all 17 rows, even the 7 that don't show on the screen. Is there a way to get this functionality with the data in a tree widget? Thanks, Kathy


    Author: kathseem (kathy.seeman@noris.org)
  3. Hi Kathy, but the tree widget you see on the screen is AFAIK, not printable, because in this case uniface will print the CONTENT of the field. Same as a listfield: the printout will not show the complete alternatives, but the selected value. Start the debugger and have a look what is in the field: it is only the selected node of the tree, not the complete tree. What you want to see is the VALREP of the field, rendered as a tree (which can only be done via screenshot). For sure you can define your own component which, based on the valrep, constructs your own textual representation of the tree. Just a suite of dummy-occurences or a simgle (non-proportional) textfield can do this job.. If you have a straight hierarchy, it is not very hard to build such a text on the same time when you compose the list for your treewidget valrep. Expl: root +--- first level | +--- second level | | +---- etc.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Ulrich, Thanks for the information. I'm disappointed the tree is not printable, but am working on populating another field/entity that is hidden until they hit Ctrl+P. It's not working yet, but I think we'll get it to work. Kathy


    Author: kathseem (kathy.seeman@noris.org)
  5. Hi Kathy, perhaps you contact your local compuware representative (I'm not a CPWR employee) how they should implement the printing of the rendered valrep of a tree widget according to your vision.


    Author: ulrich-merkel (ulrichmerkel@web.de)