Announcement

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

    Alignment in showPrintpreview() dialog

    Hi,

    We are using SmartGWT Pro 3.0 version.

    While using Canvas.showPrintPreview(layout), the contents or objects in the window gets aligned automatically, how can i manage alignment for a particular object manually in the print window.

    Thanks in advance.

    #2
    The default behavior in the print view is to rely on HTML layout type behavior in order to flow content in a way that will actually work on a printed page. If we apply absolute positioning and explicit sizing to match components' specified position and dimensions within an app it is very common to end up with a view that will not print correctly.

    We have as part of the 3.1 release introduced a "printChildrenAbsolutelyPositioned" attribute which allows a developer to override this for cases where explicitly specified size and position is required for a component to render in a meaningful manner. This may be what you need.

    If this doesn't meet your needs, please show us a little runnable example showing some components you want printed (and a way to show a print preview in the code like a print button), along with a description of how what you get differs from what you are hoping for

    Thanks
    Isomorphic Software

    Comment


      #3
      we have to place layout, chart and listgrid. we have placed the grid to a fixed size not concerning about the listgrid header.
      but while placing them in printpreview the listgrid is adjusted to its length of its header and gets rightly aligned. which looks some degrades the look. expectation is to aligned them in left.
      Attached Files
      Last edited by fairoz172; 26 Nov 2012, 23:40.

      Comment


        #4
        From the screenshot it appears that the field has a left aligned title in the application, but that the field is just the right size to fit the text.
        You should be able to get the same appearance in your print view by specifying an explicit width on the list grid field. This will stop the field expanding to fill the available space on the page.
        Alternatively you could specify an explicit alignment via listGridField.setAlign(..), and optionally listGridField.setCellAlign(...), and this should be respected in the print view.

        Comment


          #5
          Hi,

          Is there any way to get the same widths of the components in layout to be in printpreview.

          and how can i open this preview canvas in the new window of the browser.

          please give me a sample code or showcase.

          Comment


            #6
            No, this is not possible or considered desirable, since the printed page has no direct relationship to pixels in the browser.

            The only way to have more control is to generate your own HTML for printing, but we wouldn't recommend starting down this path, as you're just going to re-discover all the reasons we went with non-fixed widths.

            You previously asked about showing print previews in a separate window - we explained how.

            Comment

            Working...
            X