Hello,
Recently it seems the RadScheduler ExportToPDF() function stopped working for us. Now when it runs it exports a PDF that contains a black image. Attached is an example. I generated the example by setting up Teleriks "Live Demos" sample application on the server, going to the scheduler, functionality and then exporting a PDF. This behavior has been noticed on two web servers so far (2012 and 2008R2). The export runs fine when the applications are run in Visual Studio 2013, and so far I have not noticed any other issues with Telerik Live Demos or controls. We are using Q1 2015 SP1
Thank You
PS: I tried to attach the file but it was blocked with "The selected file(s) cannot be attached because it may exceed the maximum attachment size (2 MB) or is from not allowed type (allowed: .gif, .jpg, .jpeg, .png).". The file is a 9 KB PDF, I can e-mail it if needed
13 Answers, 1 is accepted
I'm getting a black image on PDF export too. It was happening when I was using the Glow theme on the page. Switching to a different skin with a white background fixed it on my dev machine, so I've been forcing the export to use
RadScheduler1.Skin = "Web20"
But, when I uploaded the site to IIS I got the black image export again. I'm using IIS Express on my dev machine where it works. I'm going to check to see if something wasn't uploaded during the publish. Hopefully someone has a solution for this.
By "recently" do you mean after an upgrade to a newer version of the RadControls. Could you specify the last version of the controls where this worked, and the version where it breaks, so that we can narrow down the reasons behind the issue, since we cannot reproduce it in our test cases?
Regards,
Bozhidar
Telerik
It seems to have started within last 2 weeks according to first end user who reported it. We only changed to Q1 2015 SP1 in hope the new version would resolve the issue, it did not. Originally we were using 2014 Q3. We did recently apply a backlog of Windows Updates to the servers, the were a few months behind.
I've also done some more testing. The "Live Demos" sample that works fine for on my workstation in VS 2013 using IIS Express, does not work under IIS on my workstation. I am running Windows 8.1, fully updated with Windows Update.
I did some more testing. I can see the RadScheduler in the PDF using the Glow theme, it's just a little difficult to read due to the very dark colors.
Exporting RadScheduler using IIS 8.5 on Win 8.1 or 2012R2 creates a PDF like the attached screen shot (can't upload a PDF in the forums).
RadScheduler1.ExportSettings.Pdf.PageTitle = "My PDF Title" - This always displays in the PDF.
I'm using 2015.1.401. Problem happens when using Chrome or IE.
Exporting using VS 2013 and IIS Express is the only combination that exports correctly.
Thank you for the provided information. I confirm that the bug has been traced back to this Windows update. We installed in on our testing machines and we were finally able to reproduce it.
Here's the Microsoft discussion on the exact issue, that is affecting the Scheduler implementation (since it uses the DrawToBitmap method internally):
https://social.msdn.microsoft.com/Forums/en-US/9d690398-1f91-4fbd-82fa-4b663c3b558f/kb3057839-has-broken-windows-forms-controldrawtobitmap-when-called-from-application-launched-from?forum=windowsgeneraldevelopmentissues
Unfortunately at the moment we can't provide any workaround aside from reverting the update, since this is an issue we don't have any control over. We will actively follow the status of this issue, and will update you if a fix or a workaround is provided.
Regards,
Bozhidar
Telerik
It is important to share with you that we also requested a solution/workaround from Microsoft in their bug tracking system:
Bug: Telerik RadScheduler ExportToPdf method produces black rectangle where the scheduler should be
In order to increase its priority and importance, my suggestion is that everyone sign in and vote for it.
In the meantime, I would like to propose an alternative that you might find helpful and it is to use the Client Export Manager that will allow you to easily export RadScheduler to PDF on the client.
Best regards,
Rumen
Product Manager, Telerik
You can expand the Scheduler right before calling the client export function, and then restoring its height when it's finished. Here's how you can implement this:
<
telerik:RadClientExportManager
ID
=
"RadClientExportManager1"
runat
=
"server"
OnClientPdfExported
=
"onClientPdfExported"
>
</
telerik:RadClientExportManager
>
<
script
type
=
"text/javascript"
>
var scheduler;
var height;
function exportScheduler(sender, args) {
scheduler = $find("RadScheduler1");
height = scheduler.get_height();
scheduler.set_height("");
$find('<%=RadClientExportManager1.ClientID%>').exportPDF($telerik.$(".RadScheduler"));
}
function onClientPdfExported() {
scheduler.set_height(height);
}
</
script
>
Regards,
Bozhidar
Telerik
I'm happy to inform you all that Microsoft has fixed the issue with the following update - KB3070102. We've tested the fix in our test servers and the Export functionality is once again working properly.
More details can be found on the public issue that we've opened:
https://connect.microsoft.com/VisualStudio/feedback/details/1475291
Thanks to all of you who voted and helped increase the priority of the problem.
Regards,
Bozhidar
Telerik