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

How to use TreeViewSpreadExport

5 Answers 223 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Trey
Top achievements
Rank 2
Trey asked on 16 Dec 2015, 06:42 PM

I am attempting to export a radTreeView to a PDF using TreeViewSpreadExport

Telerik.WinControls.Export.TreeViewSpreadExport tvse = new Telerik.WinControls.Export.TreeViewSpreadExport(radTV,Telerik.WinControls.Export.SpreadExportFormat.Pdf);
 
{Code that goes here that I can't seem to figure out and is documented very poorly)
 
tvse.RunExport(MyExportDirectory + "\\export.pdf", _____ );

 The documentation mentions an iSpreadExportRenderer interface, but doesn't give any information how to use it.

 Could you provide an example of how to use TreeViewSpreadExport for a PDF (and perhaps an XLS also) ?

5 Answers, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 17 Dec 2015, 07:12 AM
Hello Trey,

Thank you for contacting us. 

RadTreeView can be exported to , , pdf and txt formats using TreeViewSpreadExport. You can refer to the code snippet below how to export it: 
SpreadExportRenderer render = new SpreadExportRenderer();
TreeViewSpreadExport exporter = new TreeViewSpreadExport(this.radTreeView1);
exporter.ExportFormat = SpreadExportFormat.Pdf;
exporter.RunExport(@"..\..\file.pdf", render);

The same code snippet is added in our documentation for TreeViewSpreadExport (please see attached screenshot). The article is divided into several sections demonstrating how to use the export provider and how to customize the exported data using properties and events.  

We have added an example in our Demo Application demonstrating exporting this feature too. The location where you can find it is: START >> All Programs >> Telerik >> Telerik UI for WinForms [version] >> Examples >> C# for Visual Studio 2010 >> Open C# Demo Application in Visual Studio - RadControls for WinForms.The example is under TreeView >> Exporting with Document Processing Libraries. 

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Ralitsa
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

Can you explain in detail what you find is not well described in the article
Can you explain in detail what you find is not well described in the article
0
Trey
Top achievements
Rank 2
answered on 17 Dec 2015, 01:53 PM

I am using Telerik.WinControls version 2015.3.1104.40.

 When I use your code snippet, I get "The type or namespace name 'SpreadExportRenderer' could not be found (are you missing a using directive or an assembly reference?)".

Since I am successfully using the TreeViewSpreadExport object, I am definitely not missing anything.

0
Trey
Top achievements
Rank 2
answered on 17 Dec 2015, 02:15 PM
And by the way, the example solution you referred to does not have the SpreadExportRenderer anywhere in the entire solution.
0
Trey
Top achievements
Rank 2
answered on 17 Dec 2015, 02:26 PM

I figured out why it isn't working.

Nowhere in the documentation does it mention that a reference to "TelerikExport" needs to be added.

0
Ralitsa
Telerik team
answered on 21 Dec 2015, 09:53 AM
Hi Trey,

Thank you for writing back. 

In our there is information which assemblies you need to include in the application so you can export RadTreeView. You can refer to our latest documentation here: TreeView >> Export to Data >> SpreadExport

In the attachments, you can find a short video demonstrating how to see the code snippets which are used in the examples in the Demo Application. 

If you are not using the online documentation, could you make sure that you download the latest version of the offline files you use. You can refer to the following article how to Download Product Files

Let me know if I can assist you further. 

Regards,
Ralitsa
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
Treeview
Asked by
Trey
Top achievements
Rank 2
Answers by
Ralitsa
Telerik team
Trey
Top achievements
Rank 2
Share this question
or