This is a migrated thread and some comments may be shown as answers.

Export To PDF

13 Answers 222 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
JohnA
Top achievements
Rank 1
JohnA asked on 22 Jun 2015, 08:00 PM

 

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

Sort by
0
Tom
Top achievements
Rank 1
answered on 23 Jun 2015, 05:58 AM

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.

0
Bozhidar
Telerik team
answered on 23 Jun 2015, 11:53 AM
Hi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
JohnA
Top achievements
Rank 1
answered on 23 Jun 2015, 03:15 PM

 

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.

 

 

0
Tom
Top achievements
Rank 1
answered on 23 Jun 2015, 07:05 PM

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.

0
JohnA
Top achievements
Rank 1
answered on 23 Jun 2015, 09:08 PM
I had forgotten, but we had one more server running this and the PDF export was still working on it.  I checked and it had Windows Updates from 2 weeks ago pending.  I rebooted and now it doesn't work either.  Attached is an image of windows updates pending prior to the reboot.
0
JohnA
Top achievements
Rank 1
answered on 23 Jun 2015, 10:47 PM
Did more tests. Rolled back all Windows Updates on my Windows 8.1 workstation that were recently applied before June 10th.  Rebooted, PDF Export started working under IIS. Added the updates back one by one, export failed after I added this update back.  https://support.microsoft.com/en-us/kb/3057839.  I went to one of the web servers and rolled KB3057839 back, rebooted and the PDF export works now as well.
0
Tom
Top achievements
Rank 1
answered on 24 Jun 2015, 02:31 AM
I removed KB3057839 from my Win 8.1 dev pc and it fixed the PDF export on IIS 8.5.  
0
Bozhidar
Telerik team
answered on 24 Jun 2015, 12:51 PM
Hello,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brian
Top achievements
Rank 1
answered on 24 Jun 2015, 11:20 PM
FYI, I am the author of the thread on the MSDN forum referenced here.  Microsoft has officially refused to offer a fix or a workaround for this issue and closed my case.  They state that they do not and have never support using DrawToBitmap() from a windows service.  I hope somebody has more luck with Microsoft than I did.
0
Rumen
Telerik team
answered on 26 Jun 2015, 01:01 PM
Hi guys,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
JohnA
Top achievements
Rank 1
answered on 14 Jul 2015, 02:20 PM
This does work for the scheduler, but it does not work as well as the server side export.  The server side export will show the entire scheduler time range, the client side print only shows what is visible on the clients browser at that moment, the rest being scrolled out of view.  The smaller the client screen/browser window, the smaller the section of the scheduler that is printed.
0
Bozhidar
Telerik team
answered on 15 Jul 2015, 07:04 AM
Hi,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bozhidar
Telerik team
answered on 22 Jul 2015, 08:13 AM
Hello,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
JohnA
Top achievements
Rank 1
Answers by
Tom
Top achievements
Rank 1
Bozhidar
Telerik team
JohnA
Top achievements
Rank 1
Brian
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or