How to use TreeViewSpreadExport

6 posts, 0 answers
  1. Trey
    Trey avatar
    35 posts
    Member since:
    Dec 2006

    Posted 16 Dec 2015 Link to this post

    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) ?

  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 17 Dec 2015 Link to this post

    Hello Trey,

    Thank you for contacting us. 

    RadTreeView can be exported to xlsx, csv, 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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Trey
    Trey avatar
    35 posts
    Member since:
    Dec 2006

    Posted 17 Dec 2015 in reply to Ralitsa Link to this post

    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.

  5. Trey
    Trey avatar
    35 posts
    Member since:
    Dec 2006

    Posted 17 Dec 2015 Link to this post

    And by the way, the example solution you referred to does not have the SpreadExportRenderer anywhere in the entire solution.
  6. Trey
    Trey avatar
    35 posts
    Member since:
    Dec 2006

    Posted 17 Dec 2015 Link to this post

    I figured out why it isn't working.

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

  7. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 21 Dec 2015 Link to this post

    Hi Trey,

    Thank you for writing back. 

    In our article 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
Back to Top
UI for WinForms is Visual Studio 2017 Ready