Announcement

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

    Exporting grid as PDF

    I'm trying to export a grid to pdf, but the pdf it has generated puts all the data in one long line.
    I've tried the direct way, and a indirect way (first generating plain html) for debugging purpose to check if the HTML it tries to render is perhaps malformed.
    But the plain html renders just fine as a normal print preview/html table.
    Attached are the print preview HTML and a png with a screenshot of the PDF (the forum didn't allow me to upload a pdf)
    Code:
    Object[] components = new Object[]{ resultGrid};
    Canvas.getPrintHTML(components, null, new PrintHTMLCallback() {
    	
    	@Override
    	public void setHTML(String html) {
    		DSRequest requestProperties = new DSRequest();
    		requestProperties.setExportFilename("File");
    		requestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
    		requestProperties.setContentType("application/pdf");
    		//requestProperties.setDownloadResult(true);
    		GWT.log(html);
    		RPCManager.exportContent(new HTMLFlow(html), requestProperties);
    	}
    });
    Attached Files

    #2
    Sorry, this is useless in terms of trying to reproduce the problem. Try putting together a minimal test case that includes the grid that isn't printing/exporting properly.

    Comment

    Working...
    X