Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Configure print preview in ListGrid

$
0
0
Hello,

I have extended a ListGrid and I have added a ToolStript at the end of the table:

Code:

public class AppGrid extends ListGrid{

// Constructor
public AppGrid(){
        // Creating toolstrip
        ToolStrip tool = new ToolStrip ();
        // Adding some buttons in toolstrip: print preview, export, etc..
        [...]
        //Adding toolstrip in ListGrid
        setGridComponents(new Object[] {ListGridComponent.HEADER, ListGridComponent.FILTER_EDITOR, ListGridComponent.BODY,tool });
}

Now, I want a print preview for this table without the ToolStrip. I have read the documentation and I am trying to omit ToolStrip from print preview but it is ignored:

Code:

public void onClick(ClickEvent event) {
        if (grid != null) {
                PrintProperties printProp = new PrintProperties();
                String[] myommited = new String[1];
                myommited[0] = "ToolStrip";
                printProp.setOmitControls(myommited);
                Canvas.showPrintPreview(new Object[] { grid },printProp,"Print preview", null);
        }
}

Any idea?

Thank you in advance!

Viewing all articles
Browse latest Browse all 4756