Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    #1 Understood. This is how you want to keep it by design. But what can I do if I want to display the columns with certain given widths? And the same question for the grid header height...

    #2 The problem happens all the time and it seems that it doesn't come from the size of the icon. By inspecting the code for the component and the HTML that you generate for printing for a cell within a treeGrid an extra 2px/2px top/bottom padding is the cause.
    Component:
    Code:
    <td height="21" align="left" style="WIDTH:200px;OVERFLOW:hidden;padding-top: 0px;padding-bottom: 0px;white-space:nowrap;" class="treeCell">...</td>
    Print:
    Code:
    <td align="left" style="OVERFLOW:hidden;HEIGHT:17px;" class="treeTallCell">...</td>
    Hence if you also add the "padding-top: 0px;padding-bottom: 0px;" to the printing code the problem gets solved.

    Comment


      #17
      #1 this is getting silly, but for the 4th time we need to bring up clipping. For absolute clarity, here we are talking about clipping of column values, that is, say a column value is "Fred" and you make the column width very small, so only "Fr" is actually shown - that's clipping.

      Clipping is the only way you can control column widths in the presence of values of unknown size. Clipping is basically never desired in a printout, for the obvious reason that once you are holding a sheet of paper, you can no longer resize the column to see the rest of the value. So one of the primary points of our printed HTML is to remove clipping.

      If your use case is weird enough that you actually want clipping, then you probably want to print the grid's normal HTML, not its print HTML. You can combine the normal HTML for components with the printed HTML for other components by just calling getPrintHTML() on some and getInnerHTML() on others.

      If you don't want clipping, then there is no clear definition of "keeping the column widths" because you can set whatever widths you want for an HTML table, and in the absence of clipping, the browser is just going to do whatever it wants when values are too big for your specified sizes. The heuristics differ by browser, by platform, by font and other factors and you will not get any kind of consistent output.

      If what you really want is something like auto-sizing, then you can accomplish that by setting a small overall table width and telling all columns to not wrap. That's an easy enough modification of our printed HTML, or you could use the normal HTML after telling all columns to autosize.

      #2 so again we'd recommend just making sure the title column is included if you want the larger height, which you probably want anyway.

      As far as what's going on, while that extra padding isn't intended, it doesn't rise to the standard of something that can be called "a bug": we don't aim for any particular size for printed output, and nothing is misaligned, unreadable or anything like that. So in terms of trying to file a bug, there's no feature we can point to and say: "this doesn't work as documented".

      To get a change here, you'd need a Feature Sponsorship to add new framework properties that attempt to control sizing (in a limited way and with caveats) for the printed output. But based on the discussion above, you probably neither need nor want that.


      Comment


        #18
        I do not exclude the idea of a Feature Sponsorship. How do I get a price quote?

        Comment


          #19
          Start [URL=https://www.smartclient.com/services/#features] - there's a link to send an email. Go ahead and refer to this thread for background, but try to capture the precise feature you want as well.

          Comment


            #20
            It may be a dummy question but should getInnerHTML() method for a TreeGrid return just "&nbsp;" ?

            Comment


              #21
              Yes, because the TreeGrid per se is just a container for the header, body and other elements.

              Also, it sounds like you plan to use the normal (non-print) rendering of the TreeGrid, and if so, you may be headed down the wrong path. If you want to print the TreeGrid as it is, just put it on the screen and trigger the browser’s print function.

              You don’t need to grab pieces of HTML from it and put them somewhere else - you can just print the TreeGrid as such. If there are other components where you want their printed version instead, call getPrintHTML() on those, and then combine that (inside a Canvas) into a VLayout with the TreeGrid.
              Last edited by Isomorphic; 16 Oct 2020, 09:32.

              Comment


                #22
                I do not even know what path I am taking... All I know is that following your Feature Sponsorship suggestion I received from Isomorphic support the indication: "you probably just wanted the non-print HTML". Hence I am trying to see if I can use that solution. And I thought that I should try to use getInnerHTML() but bumped into a "&nbsp;"...

                Printing as such with the browser print function does not work because the browser prints just what it is on the screen and not the entire content of the TreeGrid (maybe hundreds of rows). You say "you probably want to print the grid's normal HTML, not its print HTML". How can I get that normal HTML to see if it satisfies my needs?

                I shall explain again what I need: the entire content of a TreeGrid - all the rows with a constant height, the column header with a given height and all visible columns in the same order and with the same widths as they appear. Even if the cell content gets clipped this is not a problem. We are using this printing solution for several years within our desktop client and all the customers are ok with that. We are trying to get the same behaviour over the web interface... I understand that SmartGWT will NOT do clipping but I need that...

                Comment


                  #23
                  As we said:

                  ... the TreeGrid per se is just a container for the header, body and other elements.
                  If you wanted the HTML, it's there - it's still getInnerHTML(), just on the body. But that gets you just the body piece, then you need the header, which has more subelements (each individual header is a button).

                  But we've already explained that this isn't necessary.. perhaps you haven't realized.. if you want to show more rows, you can just make the TreeGrid taller :)

                  Comment


                    #24
                    What do you mean taller? The screen is limited and there might be several hundreds or rows... Printing with the browser is a no go! I need to have access to all the rows of the table even to those beyond the visible area.

                    Going through the subelements and using getInnerHTML() for each one seems complicated and not a good idea...

                    Hence the only viable solutions are: 1) either using getPrintHTML() if we manage to overcome the existing issues or 2) generate a html similar with the one provided by getPrintHTML(). For case 2) can I find anywhere how are you generating that html code so I do not have to reinvent the wheel?

                    Comment


                      #25
                      Taller as in setHeight(bigger). Tall enough so that all rows can be seen without scrolling, if that's what you want.

                      And if that doesn't work, we have already provided multiple other solution above already, and they are not what you listed as "viable solutions" - those are wrong - so re-read.

                      Overall, we've given you several ways to solve this, but it's just taking too many repetitions, this is not the first thread we've had with you where we've spent a lot of time reiterating the correct solution, and as far as we can tell, you've never bought a license and don't have support. So, sorry, we have to cut this off - please buy support if you need help like this.

                      Comment


                        #26
                        Originally posted by Isomorphic View Post
                        #1 again, we keep saying this: we're not going to clip the printed output
                        OK... but the content for the hierarchical column of TreeGrids gets clipped... Is this an exception or a bug? If this is an exception is there a solution to make it have a reasonable size?

                        Comment

                        Working...
                        X