1. #1
    Sencha User
    Join Date
    Nov 2012
    Vote Rating
    giggle16 is on a distinguished road


    Default Unanswered: problem with printing widget

    Unanswered: problem with printing widget

    i have searched online for printing gxt widget like grid or window and work fine with eclipse debug moded. but when it run in tomcat ,i do not work and print nothing.this is my code;
    import com.google.gwt.user.client.Element;
    import com.google.gwt.user.client.Window;
    import com.google.gwt.user.client.ui.UIObject;
    public class Print {
        public static native void it() /*-{                                                                                                            
        public static native void doit(String html) /*-{                                                                                               
            var frame = $doc.getElementById('__printingFrame');                                                                                        
            if (!frame) {                                                                                                                              
                $wnd.alert("Error: Can't find printing frame.");                                                                                       
            frame = frame.contentWindow;                                                                                                               
            var doc = frame.document;                                                                                                                  
        public static void it(String html) {
            try { 
            } catch (Throwable exc) {
        public static void it(UIObject obj) {
            it("", obj.getElement().toString());
        public static void it(Element element) {
            it("", element.toString());
        public static void it(String style, String it) {
        public static void it(String style, UIObject obj) {
            it(style, obj.getElement().toString());
        public static void it(String style, Element element) {
            it(style, element.toString());
    then to use it
    Print.it("<link type='text/css' rel='stylesheet' href='WebCheckGXT.css'>", view);
    view is a gxt grid. thanks for your reply!

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Superior, CO
    Vote Rating
    icfantv will become famous soon enough icfantv will become famous soon enough



    We've run into this issue as well. I think the problem has to do with the brower's treatment of the way images are handled in GXT. IIRC, the images are rendered as background images and I think browsers don't print them. (Checkboxes in a selection grid also don't print).

    Our solution was to create our tabular data in a separate window not using GXT and then execute a print.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Vote Rating
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light



    This could also be related to the fact that you are picking up the html of the grid, but none of its styling, which is done via CSS on the html page.

    Please note that Element.toString() might not print anything useful:
       * Makes a best-effort attempt to get a useful debugging string describing the
       * given JavaScriptObject. In Production Mode with assertions disabled, this
       * will either call and return the JSO's toString() if one exists, or just
       * return "[JavaScriptObject]". In Development Mode, or with assertions
       * enabled, some stronger effort is made to represent other types of JSOs,
       * including inspecting for document nodes' outerHTML and innerHTML, etc.
      public final String toString() {
        return JavaScriptObject.class.desiredAssertionStatus() ?
            toStringVerbose(this) : toStringSimple(this);
    Instead, consider something like getOuterHTML(), or processing the data differently to make sure you get what you are after (like a template).

    Have you tried making that iframe visible and seeing what is displayed *without* printing? If that displays content, have you tried printing with the iframe visible instead of hidden?

    Printing a grid isn't always a great idea without some specific changes made, since the grid draws headers at the top and scrollbars - that doesn't look great on the printed page, which should probably get headers repeated each page and should flow instead of only printing what is visible on the user's screen. We usually suggest (like icfantv said) to render the content in a specific way that looks good on a printed page - black and white, or at least higher contrast than blue/black, and no scrollbars.

    Can you share a full example that doesn't work, including the Grid itself and the contents of the WebCheckGXT.css file? It is possible that there is something in your grid itself that is preventing this, but we'll never see it without being able to verify that code.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi