Dear All,
We are using scheduler.toPDF('http://dhtmlxscheduler.appspot.com/export/pdf') to print the schedule. The sample code given in the documentation is working. If I integrate with our demo version of our webpage, it is not working. On click of the print icon opens the blank page.
The below is the html file and "scheduler.parse([…], “json”); " is dynamically generated on the page load and added to a function which is called at the appropriate place in the init function.
Pl. help
With regards
GK
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_cal_today_button"></div>
<div class="dhx_cal_date"></div>
<div class="dhx_cal_tab" name="print" style='right:300px; top:0px;'>
<a href="" onclick="scheduler.toPDF('http://dhtmlxscheduler.appspot.com/export/pdf');return false;" > Print </a>
</div>
<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>
<%--</form>
–%>
function dateFormat(input){ //var correctTime=(input.getHours()< P_StartTime)? P_StartTime+ ':0' : input.getHours()+ ':'+input.getMinutes(); //correctTime=(input.getHours()> P_EndTime)? P_StartTime+ ':0' : input.getHours()+ ':'+input.getMinutes(); return input.getFullYear() +'-'+ (input.getMonth()+1)+'-'+input.getDate() + ' '+ input.getHours()+ ':'+input.getMinutes(); } function AddShareEvent(SDate,EDate,EName,eventID){ PageMethods.CreateCalendarShareEvent(customer,cid,dateFormat(SDate),dateFormat(EDate),EName,1,0,P_Slot,OnAddShareSuccess,OnAddShareError); }function OnAddShareSuccess(result,methodName){
isAddEvent=true;
if (result=="0")
onAddShareEventFailed();
else
window.location.href=location.href;
isAddEvent=false;
}
function OnAddShareError(error,userContext,methodName){
alert(error);
if(error!=null) {
onAddShareEventFailed();
}
}
function AddUserEvent(SDate,EDate,EName,eventID){
PageMethods.CreateCalendarEvent(customer,cid,dateFormat(SDate),dateFormat(EDate),EName,1,0,OnAddSuccess,OnAddError);
}
function ModifyShareEvent(SDate,EDate,EName,eventID){
PageMethods.CreateCalendarShareEvent(customer,cid,dateFormat(SDate),dateFormat(EDate),EName,2,eventID,P_Slot,OnModifySuccess,OnModifyError);
}
function ModifyUserEvent(SDate,EDate,EName,eventID){
PageMethods.CreateCalendarEvent(customer,cid,dateFormat(SDate),dateFormat(EDate),EName,2,eventID,OnModifySuccess,OnModifyError);
}
function DeleteUserEvent(eventID){
//alert(eventID);
PageMethods.DeleteCalendarEvent(customer,cid,eventID,OnDeleteSuccess,OnDeleteError);
}
function DeleteShareEvent(eventID){
//alert(eventID);
PageMethods.DeleteSharedCalendarEvent(customer,cid,eventID,OnDeleteShareSuccess,OnDeleteShareError);
}
function OnDeleteShareSuccess(result,methodName){
//alert('delete failed ’ + lastEvent.id);
if (result==“0”)
onDeleteEventFailed();
}
function OnDeleteShareError(error,userContext,methodName){
if(error!=null)
onDeleteEventFailed();
}
function OnDeleteSuccess(result,methodName){
//alert('delete failed ’ + lastEvent.id);
if (result==“0”)
onDeleteEventFailed();
}
function OnDeleteError(error,userContext,methodName){
if(error!=null)
onDeleteEventFailed();
}
function OnModifySuccess(result,methodName){
if (result=="0")
onModifyEventFailed();
}
function OnModifyError(error,userContext,methodName){
if(error!=null)
onModifyEventFailed();
}
function OnAddSuccess(result,methodName){
isAddEvent=true;
if (result=="0")
onAddEventFailed();
else
onAddEventSucceed(result);
isAddEvent=false;
}
function OnAddError(error,userContext,methodName){
alert(error);
if(error!=null) {
onAddEventFailed();
}
}
var customer= '1234';
var cid= '12';
var lastEvent;
var isAddEvent,isLightBoxShown;
var P_StartDate=new Date(2011,8,7);
var P_EndDate=new Date(2011,8,13);
var P_StartTime=“9”;
var P_EndTime=“19”;
var P_Slot=“30”
var P_Event=“PPS Week 2011”;
</script>