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

Export to PDF Bug - Calendar

$
0
0
Hi guys,
I think i've found a bug.
Can't export calendar to PDF. I get (TypeError: Object week has no method 'isDayView')

Version: SmartClient Version: v9.1p_2014-03-23/PowerEdition Deployment (built 2014-03-23)
Browser: Chrome 33.0.1750.154

JavaScript error (superdev mode):
Code:

com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError)
 stack: TypeError: Object week has no method 'isDayView'
    at Object.isc.A.gridProps.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Calendar.js:35:5718)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
 __gwt$exception: <skipped>: Object week has no method 'isDayView'
  at createStackTrace
  at fillInStackTrace_1
  at fillInStackTrace
  at $fillInStackTrace
  at Throwable_2
  at Exception_2
  at RuntimeException_2
  at UmbrellaException_1
  at UmbrellaException_2
  at $fireEvent
  at $fireEvent_1
  at fireEvent_0
  at anonymous
  at apply_0
  at entry0
  at anonymous
  at $setupClickEvent.obj.click
  at isc_StatefulCanvas_handleActivate
  at isc_StatefulCanvas_handleClick
  at isc_c_EventHandler_bubbleEvent
  at isc_c_EventHandler_handleClick
  at isc_c_EventHandler__handleMouseUp
  at isc_c_EventHandler_handleMouseUp
  at isc_c_EventHandler_dispatch
  at eval
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError)
 stack: TypeError: Object week has no method 'isDayView'
    at Object.isc.A.gridProps.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Calendar.js:35:5718)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
    at Object.isc_Canvas_getChildPrintHTML [as getChildPrintHTML] (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:458)
    at continuePrintHTMLFun (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1758:637)
    at Object.isc.B.push.isc.A.getPrintHTML (http://localhost:8080/SmartGWTSample/org.microcodigo.Main/sc/modules/ISC_Core.js:1759:301)
 __gwt$exception: <skipped>: Object week has no method 'isDayView'
  at isc.A.gridProps.getPrintHTML
  at isc_Canvas_getChildPrintHTML
  at continuePrintHTMLFun
  at isc.B.push.isc.A.getPrintHTML
  at isc_Canvas_getChildPrintHTML
  at continuePrintHTMLFun
  at isc.B.push.isc.A.getPrintHTML
  at isc_Canvas_getChildPrintHTML
  at continuePrintHTMLFun
  at isc.B.push.isc.A.getPrintHTML

Sample code (almost all copied from showcase):
Code:

    private static final Date today = new Date();
    private static final int year = today.getYear();
    private static final int month = today.getMonth();
    private static final int start = today.getDate() - today.getDay();

    /**
    * The entry point method, called automatically by loading a module that
    * declares an implementing class as an entry-point
    */
    @Override
    public void onModuleLoad() {

        Label versionLabel = new Label(Version.getVersion());
        versionLabel.setHeight(20);

        Calendar calendar = new Calendar();
        calendar.setCurrentViewName(ViewName.WEEK);
        calendar.setData(getNewRecords());
        calendar.setWidth100();
        calendar.setHeight100();

        final VLayout layout = new VLayout();

        final IButton downloadAsPDFButton = new IButton("Download as PDF");
        downloadAsPDFButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {

                final DSRequest requestProperties = new DSRequest();
                requestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
                RPCManager.exportContent(layout);
            }
        });

        layout.setWidth100();
        layout.setHeight100();
        layout.setMembers(versionLabel, calendar, downloadAsPDFButton);
        layout.draw();
    }

    public static CalendarEvent[] getNewRecords() {
        return 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"),
            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))
        };
    }


Viewing all articles
Browse latest Browse all 4756

Trending Articles