Announcement

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

    Calendar to PDF: Events in wrong rows

    When a calendar is exported (in week view) the events are not being rendered in the right row, and the event background are not being rendered.

    Using: SmartClient Version: v9.1p_2014-04-10/PowerEdition Deployment (built 2014-04-10)

    Sample code:
    Code:
        public void onModuleLoad() {
    
            final VLayout vLayout = new VLayout(5);
            vLayout.setWidth100();
            vLayout.setHeight100();
    
            final Calendar calendar = new Calendar();
            calendar.setData(new CalendarEvent[]{
                new CalendarEvent(1, "Meeting", "Shareholders meeting: monthly forecast report", new Date(year, month, start + 2, 9, 0, 0), new Date(year, month, start + 2, 14, 0, 0)),
                new CalendarEvent(2, "Realtor", "Breakfast with realtor to discuss moving plans", new Date(year, month, start + 3, 8, 0, 0), new Date(year, month, start + 3, 10, 0, 0)),
                new CalendarEvent(3, "Soccer", "Little league soccer finals", new Date(year, month, start + 4, 13, 0, 0), new Date(year, month, start + 4, 16, 0, 0)),
                new CalendarEvent(4, "Sleep", "Catch up on sleep", new Date(year, month, start + 4, 5, 0, 0), new Date(year, month, start + 4, 9, 0, 0)),
                new CalendarEvent(5, "Inspection", "Home inspector coming", new Date(year, month, start + 4, 10, 0, 0), new Date(year, month, start + 4, 12, 0, 0), false, "testStyle"), //This record use a css style that is not in the main .css file, we don't expect it to be rendered on the PDF
                new CalendarEvent(6, "Airport run", "Pick James up from the airport", new Date(year, month, start + 4, 1, 0, 0), new Date(year, month, start + 4, 3, 0, 0)),
                new CalendarEvent(7, "Dinner Party", "Prepare elaborate meal for friends", new Date(year, month, start + 4, 17, 0, 0), new Date(year, month, start + 4, 20, 0, 0)),
                new CalendarEvent(8, "Poker", "Poker at Steve's house", new Date(year, month, start + 4, 21, 0, 0), new Date(year, month, start + 4, 23, 0, 0)),
                new CalendarEvent(9, "Meeting", "Board of directors meeting: discussion of next months strategy", new Date(year, month, start + 5, 11, 0, 0), new Date(year, month, start + 5, 15, 0, 0))
            });
    
            Button exportButton = new Button("Export");
            exportButton.addClickHandler(new ClickHandler() {
    
                @Override
                public void onClick(ClickEvent event) {
                    final DSRequest requestProperties = new DSRequest();
                    requestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
                    RPCManager.exportContent(vLayout);
                }
            });
    
            vLayout.setMembers(calendar, exportButton);
            vLayout.draw();
        }
    I understand it's used the Flying Saucer and iText libs to create the PDF file, so it might not be a SmartGWT bug.
    Anyway, it would be very helpful if anybody have some hint or workaround to make those Events be rendered in the right place.

    NOTE1: I uploaded a image of the pdf since the forum does not allow .pdf extensions.
    NOTE2: The javadoc for PDFExport (https://www.smartclient.com/smartgwtee/server/javadoc/com/isomorphic/contentexport/PdfExport.html) have a really good example of server side PDF creation. But something is missing at the end of the page, in the "Internationalization and Fonts with PDFs and iText" topic, after the line: "To use this file, you would provide an extraStyleSheet with a declaration like this:"
    Attached Files

    #2
    Is this addressed in the last patch?

    Does it (http://forums.smartclient.com/showthread.php?t=30034) means that the rows position is fixed?

    Comment


      #3
      No - that post relates to printing, not exporting to PDF - the PDF export issue is queued to be looked at.

      Comment


        #4
        Solved

        The calendar still is not well rendered in with Flying Saucer and iText.
        So, we did the rendering ourselves, using a custom html.

        Comment

        Working...
        X