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

Convert to pdf without saving to database

3 Answers 107 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Zura Chikhladze
Top achievements
Rank 1
Zura Chikhladze asked on 08 Aug 2013, 01:34 PM
Hello Telerik,

I have a small issue and maybe you can help me. I have a form where user enters the info. What i want is to convert the html document into pdf on button click without saving the entered info by the user into the database. Can you tell which telerik tool should i use in this case? Thank you. 

here is a simplified version of the form:

<div>
        <asp:Label ID="Label1" runat="server" Text="Label">Please enter your name:</asp:Label><br />
        <br />
        <asp:Label ID="Label4" runat="server" Text="Label">name: </asp:Label>
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" Text="Label"> Please enter your last name:</asp:Label><br />
        <br />
        <asp:Label ID="Label3" runat="server" Text="Label">lastname:</asp:Label>
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </div>


3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 09 Aug 2013, 08:49 AM
Hi Zura,

The desired functionality is not supported out-of-the-box, but you can use the RadEditor's API in order to achieve a similar behavior:
  • traverse all html elements in your form on the page and get their content, concatenating it into one string. You can use either the RadEditor's get_text() or get_html() method
  • load the gathered content as a content of a hidden RadEditor
Once you do the steps above you can use the approach used here which demonstrates how to export silently the editor's content into a PDF file on the server using the OnExportContent event and without loading the PDF file in the browser. The demo is based on the following blog post: How To: Export grid to PDF file and show the result using the window.

I hope you will find this information helpful.

Regards,
Veselina Raykova
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Saktheeswaran
Top achievements
Rank 1
answered on 27 May 2014, 04:29 PM
Hi Telerik,

I have one issue in my aspx page. My requirement is very simple. I need to export my aspx page to PDF, Word, Excel and HTML format.

In this page have some radgrid and radhtmlchart.

Please find the attach.

Thanks.
0
Ianko
Telerik team
answered on 28 May 2014, 08:16 AM
Hello Saktheeswaran,

The required actions is more related to a how-to export rendered ASP.NET AJAX control to different document format.

Each of these controls can export the content separately, but exporting the rendered HTML content is not related to any of the Telerik controls.

Such functionality would be complex and time-consuming matter, which should be built entirely by the developer of the application. Due to the reason that this is not related to the Telerik UI for ASP.NET AJAX suite I am unable to provide a proper approach to achieve that.

I can only suggest you searching for proper information through ASP.NET forums and communities for approach to export the rendered data to a desired format. 

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
FileExplorer
Asked by
Zura Chikhladze
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Saktheeswaran
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or