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

Export chart inside a collapsed panel fails

1 Answer 87 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ahmed Moussa
Top achievements
Rank 1
Ahmed Moussa asked on 18 Jul 2011, 05:44 AM
Hi,
We have a dashboard with multiple RadPanelTab controls.
When trying to export all the charts to a PDF file using RadDocument, I've found that only the charts that have been previousliy "viewed" (that is, it's panel expanded) export correctly.
If I expand the panels programatically, then I get the "Dialogs must be user initiated" error, because of the time it takes to expand / collapse all the panels.
And if I try to do that after the ShowDialog() method of the SaveFileDialog control is called, then the images are corrupted or incomplete.

Is there any way to workaround these limitations?

Cheers,

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 20 Jul 2011, 12:08 PM
Hello Simon Kendall,

RadPanelbar loads only items that are currently expanded. After you expand them they exist in the visual tree and can be printed without problem. You can expand all items initially using ExpandAll() method and all of your charts will be ready for printing. If you wish to have all your charts collapsed initially you can collapse them on the ItemPrepared event like this:

void panelBar_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
{
    RadPanelBarItem item = e.PreparedItem as RadPanelBarItem;
    Dispatcher.BeginInvoke(() => { item.IsExpanded = false; });
}

I have attached a sample application that demonstrates this approach.
Hope this helps! All the best,
Yavor Ivanov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Chart
Asked by
Ahmed Moussa
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or