Hello
I have my Gantt Chart Loaded from my DataBase and everything works fine without any error. But when I click on button to export to PDF, I get this:
Hello
I have my Gantt Chart Loaded from my DataBase and everything works fine without any error. But when I click on button to export to PDF, I get this:
Please, I really need help. Its urgent :X
I figured out where the problem came from, was because this configuration:
var weekScaleTemplate = function(date){
var dateToStr = gantt.date.date_to_str("%d");
var endDate = gantt.date.add(gantt.date.add(date, 1, “week”), -1, “day”);
return dateToStr(date) + " - " + dateToStr(endDate);
};
gantt.config.subscales = [
{unit:“week”, step:1, template:weekScaleTemplate},
{unit:“day”, step:1, date:"%D" }
];
And i really need this congifuration, but with them, the gantt comes in blank ://
I’m really desperate, please some help
And one more thing, why does the PDF came with the default colours when my Gantt has my own CSS’s?
Export logic updated, the above code must be processed correctly now ( you need not update anything )
The custom template for subscales still ignored though. We will try to provide better solution with next update.
Why does the PDF came with the default colours when my Gantt has my own CSS’s?
You need to embed the css styles of link to css files with definitions of custom css classes in header section of export.
gantt.exportToPDF({
name:"mygantt.pdf",
header:'<link rel="stylesheet" href="http://mysite.com/mystyles.css" type="text/css">'
});
Thanks a lot again
f I copy that code, the export function doesnt work at all. I think there is a problem with the ’ ’ or " ".
This is my Code:
<input value=“Export to PDF” type=“button” onclick=“gantt.exportToPDF({
name:“mygantt.pdf”,
header:’’
});”>
Thanks
Solved it.
header:""
Without any ‘’ or “” inside.
Fixed as well, sorry for inconvenience, now it will work with or without quotes.