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

Exporting Gantt

3 Answers 46 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Daniel Grünberger
Top achievements
Rank 1
Daniel Grünberger asked on 14 Nov 2013, 07:49 AM
Hi, I've used your sample from 
http://www.telerik.com/help/silverlight/radganttview-exportingsupport.html
to export my RadGanttView, but printing does not work properly.

The conversion between BitmapSource and Image does not seem to work, because all properties of the image are set to 0.0 (eg. ActualWidth, Width=NaN,...). The bitmap seems to be ok!

private static UIElement PrintPage(BitmapSource bitmap)
{
    var bitmapSize = new System.Windows.Size(bitmap.PixelWidth, bitmap.PixelHeight);
    var image = new System.Windows.Controls.Image { Source = bitmap };
    image.Measure(bitmapSize);
    image.Arrange(new System.Windows.Rect(new System.Windows.Point(0, 0), bitmapSize));
    return image;
}


When I print to XPS, the filesize of the produced .oxps file is 0 bytes.


3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 18 Nov 2013, 12:05 PM
Hi,

We are not aware of such issues with the built-in exporting feature of the current version of RadGanttView control.

You could find a runnable project of the described approach from the help article in our GitHub repository here. You can download the entire repository as a zip file via this link. Could you download that example and see if runs as expected on your side. If you continue to experience issues could you open a new support thread and send us the sample project which fails to run on your side in it.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Daniel Grünberger
Top achievements
Rank 1
answered on 28 Nov 2013, 02:08 PM
Hi, thanks for your reply!

I'm was able to get the example code working. One reason was that .oxps files always have 0 bytes after exporting via your library. When I print to PDF the file contains data!

What I also want to mention is that your newest release of SL controls (RadControls.for.Silverlight.2013.3.1016) seems to have a bug in the GanttView control. I was not able to make any of the ganttview examples working with the newest release -> The gantts did not show up in the UI! 
Version RadControls.for.Silverlight.2013.2.0724 works!


Anyway, now I have another problem with the ganttview-export:
The styles will be ignored in the print result and the text within the eventcontainers do not appear (look at PRINT.png)

The attachment BROWSER.png shows how the control gets rendered in Silverlight, PRINT.png shows how the print result looks like. How can I print with the styles I have applied? My Tasks (Custom Task class) have a Status property, which affects the background color of the container. The print result must contain this colors...

PS: I have applied the EventContainerTemplate as you have suggested in this post: http://www.telerik.com/community/forums/silverlight/ganttview/height-of-summarycontainer.aspx





0
Vladi
Telerik team
answered on 28 Nov 2013, 02:27 PM
Hi,

It looks like the custom Styles that you have added are placed inside the Resources of the UserControl in which the RadGanttView is placed which is causing the issues. The correct way of adding customizations to the control is to:
  • Either added the custom Styles in the App.xaml after the merged ResourceDictionary of the RadGanttView control
or
  • Add the custom Styles to a custom ResourceDictionary, in which merge the necessary ResourceDictionary for the RadGanttView control. After that merge the custom ResourceDictionary in the App.xaml
Hope this is helpful.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GanttView
Asked by
Daniel Grünberger
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Daniel Grünberger
Top achievements
Rank 1
Share this question
or