search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Cannot export or print schedule [AngularJS]

Asked by Pierre Veber
6 years ago.

From my controller I'm trying to call exportAs().print() but I get an exception:
String expected
print @ schedule.controller.js?0afb:116
fn @ VM14359:4
callback @ angular.js?10a4:27341
$eval @ angular.js?10a4:18423
$apply @ angular.js?10a4:18523
(anonymous) @ angular.js?10a4:27346
dispatch @ jquery.js?eedf:5226
elemData.handle @ jquery.js?eedf:4878

The code is really simple:
print($event) {
$event.preventDefault()
let options = {
area: 'viewport'
}
try {
this.scheduler.exportAs('svg', options).download()
}
catch (e) {
console.error(e)
}
}

There is a similar issue reported one month ago in the forum but without response.
https://forums.daypilot.org/Topic.aspx/4064/uncaught-string-expected-error-when-export-shceduler-to-jpeg

Please advice for hints and workarounds. Printing/exporting is a critical feature in my application.
Could it be an issue with jquery / AngularJS?

Comment posted by Dan Letecky [DayPilot]
6 years ago.

It looks like one of the values in the exported Scheduler is a number instead of a text. This is a bug - it should accept other reasonable values as well (including numbers).

It might be an event text (events[x].text) or a custom html value assigned in one of the rendering event handlers (e.g. onBeforeEventRender).

Could you please give it a try and let me know if this is the case?

Answer posted by Dan Letecky [DayPilot]
6 years ago.

Update: The latest sandbox build (8.4.3098) accepts string, number and null (null was added in this build). The exception text now includes the value type.

https://javascript.daypilot.org/sandbox/

Please let me know if the problem persists.

Comment posted by Pierre Veber
6 years ago.

Thank you, I will try.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.