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

HTML Handling in PDF

39 Answers 1176 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bruce Parr
Top achievements
Rank 1
Bruce Parr asked on 06 Oct 2006, 09:37 PM
All,

I am just slightly confused about the PDF output described in the information available so far.

We are using ActiveReports 2.0 for .NET to report data that has been entered using RAD Editor and are having fits because of the insane limitations of their HTML rendering in PDF documents. What has happened is their engine will encounter HTML tags it can't understand so it just quits rendering.

1) How will PDFs be handled? As an export from the visible report? As a native viewer with the document directly rendered to PDF (like ActiveReports)?
2) Currently HTML code is very limited in ActiveReports. Will Telerik Reporting handle all the tags the RAD Editor supports? This is KILLER important. We have users importing into RAD Editor from MS Word and half the time AR just chokes and dies. To top it off, we are left to guess as to where the error occured in the report since their stack trace is totally encrypted.

Suffice it to say after absolutely pulling our hair out with ActiveReports, we would love something that works as advertised. If you hit a homer as you have with RAD Editor and RAD Combo, which we also use, we are in...

Thanks,
B

39 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 09 Oct 2006, 12:25 PM
Hello Bruce,

Support of HTML (and RTL) is quite important and we will provide it for sure. The first version probably won't be able to render HTML and RTF text in the WinForms viewer and PDF as the both HTML and RTF require extra efforts for processing and rendering than plain text with the built-in styles. Nevertheless, we will provide HTML and RTL support in the versions following the first one.


Best wishes,
Svetoslav
the telerik team
0
Rob
Top achievements
Rank 1
answered on 11 Oct 2006, 07:37 PM
I'm very glad to hear Telerik will support HTML rendering in PDF reports.  I agree that ActiveReports does a terrible job with this and Telerik could easily capitalize on that.
0
christopher willis
Top achievements
Rank 1
answered on 13 Oct 2006, 11:20 PM
I also have a need to render HTML from the rad editor into reports (pdf export especially), so I'm glad to hear this also. 
It's not an easy feat from what I understand.  I'm looking forward to it.
0
mano
Top achievements
Rank 1
answered on 02 Nov 2006, 09:02 PM
I'm really looking forward to this feature. This is a simple feature but its not possible to do in MS Reporting Services at all. Telerik, you guys rock!!!
0
Paul O'Brien
Top achievements
Rank 1
answered on 08 Nov 2006, 03:30 PM
I too, would like to stress the importance of the HTML to PDF functionality.  Consider an asp.net web application using the telerik RADEditor to take input from the user, store it in a SQL server database and render it using the telerik reporting component while providing the ability to export to PDF the exact HTML from the RADEditor.  Seems like this is a requirement that no-one is doing very well out there in the market place.  Crystal seems to be the closest with their 'html text interpretation' but support for HTML is limited.  How will telerik meet this challenge!?!
0
Vassil Petev
Telerik team
answered on 08 Nov 2006, 04:17 PM
Hi guys,

Handling HTML in PDF is far from simple, and this is why all companies offering this feature have so much problems. This is an enormous engine, probably comparable to a browser's HTML engine, so the task is not trivial at all.

It is still very early to talk about a HTML to PDF converter in our tool as we have several essential features to add to the telerik Reporting. The suggestion is logged and we will have your feedback in mind. At this time we cannot commit with any deadlines.

BTW, what do you think of the first CTP version? Do you find it stable, promising, lacking? Please, share your feedback as we are eager to hear your experiences.

 
All the best,
Rob
the telerik team
0
William Finnegan
Top achievements
Rank 1
answered on 15 Mar 2007, 04:38 PM
i want to add my 2 cents to this thread to ensure Telerik realizes many developers are currently using ActiveReports but are  trying to find something more user friendly. We also let our users enter case into our site using your html editor. Now we'd like to generate a report combined all the case notes collected.  HTML support in reports is mega important for us and would make us drop ActiveReports asap if telerik supported it.

Thanks
0
Rossen Hristov
Telerik team
answered on 20 Mar 2007, 08:37 AM
Hi William,

Thank you for the feedback.

We are planning for this feature in version 2 of telerik Reporting.

Regards,
Rossen
the telerik team
0
joeolsen
Top achievements
Rank 1
answered on 04 Jun 2007, 04:01 AM
When are you expecting version 2.  This is a primary need of ours.  I am guessing it's also a primary need of many of the Telerik reporting community.

Is there anything we can do to expedite this?

Thanks.

JJO
0
Svetoslav
Telerik team
answered on 04 Jun 2007, 01:12 PM
Hi joeolsen,

Thank you for your willingness to help us and create a better and more powerful product.

Last week we released Telerik Reporting 1.0 SP1 and we're currently discussing the plans for the next versions. When ready we'll publish the Roadmap for the next version(s). This year will see one more service pack for the reporting, but we are still unsure when exactly v2 will appear.
 
As we've already received a lot of requests for this feature we'll do our best to implement the HTML rendering in the upcoming service packs, but with limited functionality - you know the HTML and CSS are very extensive and complicated standards.

The only thing that can speed up the process is to send us any ready-to-use solution that we can embed in our application (there are number of 3rd party products available on the market but we need to integrate the HTML rendering in our PDF rendering engine). You can send it in a new support ticket.
 

Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joeolsen
Top achievements
Rank 1
answered on 04 Jun 2007, 03:25 PM

Thanks guys for the update.  We are using a control called WnvWebConverter (http://www.winnovative-software.com/) right now to convert html to PDF.  It also converts html to an image file (jpg, gif, png, etc..).  It's a .NET component and it's really easy to implement (8-10 lines of code).

 

You may be able to take a look at that as an example.  May also be something you can license.  I am sure there are other libraries available on the market, but that one is cheap and it works fantastic.  I have not found a piece of HTML that does not render correctly.

What we are doing is creating a "report" in an aspx page and then using another caller page using:

WebRequest request = WebRequest.Create("http://localhost/pbcs/casestudytemplate.aspx?ID=" + Request.QueryString["ID"].ToString());

WebResponse response = request.GetResponse();

Stream s = response.GetResponseStream();

downloadBytes = wnv.RenderPDFReportBytesFromHtmlStream(s,System.Text.Encoding.Default);

s.Close();

0
Vassil Petev
Telerik team
answered on 05 Jun 2007, 12:43 PM
Thank you very much for sharing, joe, we will surely review the WnvWebConverter. Your points have been updated for the feedback.

Guys, if you are using other tools, please share them here so that we can review them, and get a hold of what is of most interest for you.


Greetings,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jeremy Wadsworth
Top achievements
Rank 1
answered on 01 Oct 2007, 10:18 PM
I would like to add my vote for this feature. We currenlty use Active Reports as well and are looking for a solution that would allow us to print website content to pdf. Here is a control we've used that is pretty slick.

http://www.websupergoo.com/abcpdf-1.htm

Thanks,
Jeremy
0
Svetoslav
Telerik team
answered on 02 Oct 2007, 09:52 AM
Hi Jeremy,

Thank you for your feedback. We're currently researching several possible solutions of the problem and we'll choose the best that suits us all best.
 

Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daniel
Top achievements
Rank 1
answered on 27 Feb 2008, 05:49 PM
Did this ever get added?  I looked through the release notes and didn't see anything about it.

0
Svetoslav
Telerik team
answered on 28 Feb 2008, 07:56 AM
Hello Jeremy Wadsworth,

To my greatest regret, we still lack this functionality. As we have already explained in the previous posts in this and other similar threads this is quite complicated task. Adding more and more export formats makes it even harder. With the Excel in the list of the supported formats and RTF/Word on the way, you see that we should support HTML in all format - not only in PDF.

I hope you understand how different are the various formats and how complex is the "HTML Handling in PDF". Nevertheless, I am confident that we have the strength and the motivation to work on this functionality soon.

Kind regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bruce Hochstetler
Top achievements
Rank 2
answered on 15 Oct 2008, 06:52 PM
Hi Guys,

Another product that does HTML to PDF conversion that's free is iTextSharp...

I haven't used it, but may be useful.

Oh, and I'm still waiting on the rich textbox!!!

Thanks,
Bruce
0
Gaurish
Top achievements
Rank 1
answered on 18 Oct 2008, 01:07 PM
Hi 
    I have used Telerik Reporting Q2 2008 , I also want  HTML Handling in PDF. Because I have created report depend upon E-mail from the user some times it will be in HTML formate, so any solution for this proble in Telerik Reporting Q2 2008 .


Thanks
0
Steve
Telerik team
answered on 20 Oct 2008, 07:47 AM
Hello rohan,

We have a rich textbox item in the works and it would be available for one of the subsequent versions of Telerik Reporting. Initially it would handle only a limited number of html tags - thus the name rich textbox and not html. For the time being please use the approach from this KB article to avoid html markup in other formats.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Gaurish
Top achievements
Rank 1
answered on 20 Oct 2008, 10:07 AM
Thanx a lot for help. I am able to generte the reprot with html content. But when I try to export it to PDF then it cannot render the HTML. Am I missing something ?

0
Steve
Telerik team
answered on 20 Oct 2008, 11:40 AM
Hi Rohan,

I am afraid you have missed the point of the article - please review its description once again:

"Currently Telerik Reporting does not operate with HTML content. Exception is when the report is rendered in HTML because the browser that usually displays the report, handles the HTML itself. Unfortunately the rest of the supported formats - Image (GDI), PDF, XLS, RTF do not support HTML out of the box and we're still looking for possible ways to implement our own HTML rendering in most of the supported export formats."

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JustinWong
Top achievements
Rank 1
answered on 10 Jan 2009, 07:54 AM

Hi:

"Currently Telerik Reporting does not operate with HTML content. Exception is when the report is rendered in HTML because the browser that usually displays the report, handles the HTML itself."

Technically, this is not even true.  I have a Telerik report (with lots of complext html content) displayed on a web page, but when I print the report directly using the web browser's 'print' button, all the html codes are printed 'as is' and the format of the report is all ruined. We can print all kinds of web pages with all kinds of html codes directly from the IE and have the format of the webpage preserved nicely, I don't understand why the whole thing breaks when it comes to a Telerik report. 

 

Again, I emphasize that I'm not exporting the report anywhere, I'm just trying to print it directly from the browser, like I do with other web pages. So I guess I'm hoping for a clearer explanation than what was stated in the last thread.

Thanks

Justin

0
Steve
Telerik team
answered on 12 Jan 2009, 11:22 AM
Hello Justin,

The statement you have quoted in the beginning is correct and your explanations further down confirm it. Printing through the browser would mean that the html page is printed and it is basically WYSIWYG kind of thing. During this process, any html markup represented in the browser with some kind of visual representation would be printed exactly as shown - this goes out for html markup in the ReportViewer as well. I've attached ready for print page from One Note for your convenience.
Exporting the report to a different format is a completely different thing and support for html for the item responsible for handling it is required.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JustinWong
Top achievements
Rank 1
answered on 12 Jan 2009, 03:02 PM
Hi Steve:

Let's pretend that I will NEVER export the content of the ReportViewer (just to make things easier, because the problem I experience has NOTHING to do with exporting).

I generated a page and view it in report viewer: The page contains all kinds of html codes I placed in there programmatically and it is showing up fine.  I then hit the 'Print' button that is BUILT IN THE REPORT VIEWER.  The page gets send to the printer - and it's complete garbage:   All the html elements are printed as text, and the format of the page - which I can see from the Report Viewer - is all gone. 

As far as I am concern, NO exporting has been done - just strict printing, and yet still the html codes are NOT handled properly through the Viewer.

Thanks.

Justin
0
Steve
Telerik team
answered on 12 Jan 2009, 03:43 PM
Hello Justin,

Ahaaa! Using the ReportViewer's print button and not the browser's button was the missing key of information for your scenario. We use the Adobe Plugin (if available) when printing and the user has the option to select the printer he would like to use. So when printing through the ReportViewer you are doing export to pdf internally and then show the exported file in the acrobat print preview. In order to change that behavior you can replace the default action by overriding the PrintReport function of the ReportViewer and use the PrintAs() client-side method with Default passed as argument so that it would always use the browser printing capabilities.:

 <telerik:ReportViewer ID="ReportViewer1" runat="server" >
        </telerik:ReportViewer>
    <script type="text/javascript">
        ReportViewer.prototype.PrintReport = function()
        {
          this.PrintAs("Default");
        }
    </script>  

Hope this helps.

Regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paulo
Top achievements
Rank 2
answered on 12 Jan 2009, 05:19 PM
Hello.

I just faced the same problem.

Is there a way I can read a text or varchar, containning html code, from the database and then, inside the report, remove all html code? You have any function that does this?

Otherwise I'll have to save 2 text fields in the database, the Content and the Text properties from RadEditor so I can use one at a time. In normal situations thats not a problem, but right now I have a project in production where I'm adding reports. If I go for this sollution now it will be a massive amount of coding since the project is quit big now and uses RadEditor extensivly.

EDIT:
As an alternative, is there anyway I can have different styles applied to text in the same textBox?

If so, can you provide me a reference for the style configurations? I'm willing to take the time to make a parser to translate HTML formating to any kind of formating that may solve this problem, even if it takes me a couple of days it will surely be faster then adding an extra text field to every RadEditor, and it will provide a better final product to the client.
0
JustinWong
Top achievements
Rank 1
answered on 13 Jan 2009, 03:28 AM
Hi Steve:

Thanks for the clarification.  This is unfortunate, though.  Most of the reports I generate are complex in format/structure and requires the extensive use of html elements.  So, I was hoping to rely on Telerik's Report mostly because I like the print features that come with the Report Viewer's 'Print' button. 

But if using Telerik's Print button means lossing all the html format I have in the report, then it is not worth it for me.  I look forward to the day when there is a 'true' html-capable reporting product. Hopefully, that'll come before I retire!

Justin
0
Steve
Telerik team
answered on 13 Jan 2009, 01:41 PM
Hi guys,

@Paulo: you can use the built-in StripHTMLTags function if needed. If you want more power at your hands you can even write your own user function to handle this for you. If urgent, you can also use a workaround as suggested in this KB article. However our devs are already working on a richtextbox item for the Q1 2009 release expected at the end of February, so if you can wait until then, you will have basic html support provided out of the box, including different styles applied to text in the same textBox.
@Justin: as stated above, we are working on richtextbox for the Q1 release and would provide basic html handling. "True" HTML capability basically means that we would have to make our own little browser item for the reporting product :)

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JustinWong
Top achievements
Rank 1
answered on 13 Jan 2009, 01:44 PM
That sounds great, Steve.  Could there by support for the table, div, and/or span tags?
0
Steve
Telerik team
answered on 13 Jan 2009, 02:11 PM
Hello Justin,

Div and span tags would be supported, but table tag would require more effort and would not be included in the first draft, which would basically as the name suggests (rich textbox) support rich text formatting only.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sypher
Top achievements
Rank 1
answered on 16 Feb 2009, 09:20 PM
Still expecting this fix at the end of February?  Is it already in one of the Internal Builds maybe? :-)
0
Sypher
Top achievements
Rank 1
answered on 16 Feb 2009, 09:28 PM
Oh, nevermind about the Internal Build question.  I just noticed the Internal Builds are only available for the RadControls for ASP.NET AJAX product and not the Telerik Reporting product. :-)
0
Steve
Telerik team
answered on 17 Feb 2009, 08:44 AM
Hello sypher,

The whole Q1 2009 release (not only Reporting) has been shifted with two weeks and will be available in the beginning of March 2009. We would not be releasing internal builds until then, and we are still considering if we would offer internal builds for reporting at all. They are needed in the RadControls suite, when there is a major showstopper problem in any of the controls, while if there is a major showstopper for Reporting, we would more likely release it as a service pack, since it is a single product.

Thank you for the understanding.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mohammad
Top achievements
Rank 1
answered on 09 Mar 2009, 06:31 AM
hi all
please to tell me how to display data that inserted from radEditor in report viewer

i need compleate example if possible
0
Bruce Hochstetler
Top achievements
Rank 2
answered on 09 Mar 2009, 03:46 PM
Hi Mohammad,

Place this javascript funciton in the page that has your telerik reportviewer...

<telerik:reportviewer id="ReportViewer1" runat="server"><telerik:reportviewer>
<script type="text/javascript" language="javascript">
   ReportViewer.prototype.PrintReport = function()
   {
        this.PrintAs("Default");
    }
</script>

this works for 2.9.8.1209 release.

Bruce
0
Mohammad
Top achievements
Rank 1
answered on 10 Mar 2009, 06:14 AM
i dont understand you

i need like this

radEditor1.Content=objDataReader["content"].ToString();

but in this case ,,, i need ReportViewer1.Report= ,,, etc

thanks in advanced
0
Bruce Hochstetler
Top achievements
Rank 2
answered on 10 Mar 2009, 03:49 PM
Hi Mohammad,

I assumed your issue was how to get rich content (html) data from a radeditor to display in a report. Without going into a tutorial on how to create a report I can give a short explanation.
  • Build a report using the telerik report interface - pick items from your studio toolbox. We'll call it 'MyReport'. In the report you need to assign the report's textbox to the name of the editor's dataset name, e.g. in report's property page 'value' =EditorData
  • In report code create a method that will build a dataset (sql or whatever your datasource is), the data will have a dataitem called 'EditorData' or whatever you want to call it as long as its the same as the reports textbox binding.
  • Build an aspx page that contains a reportviewer (ReportViewer1), its here that you want to add the javascript to the page code to view html data.
  • In the Page_load of the aspx page create your report;  Report _report = new MyReport()
  • Assign the report just created to the viewer; ReportViewer1.Report = _report

I hope that helps and is what you were asking for.

Bruce

0
Sypher
Top achievements
Rank 1
answered on 25 Mar 2009, 04:27 PM
The new HtmlTextBox in the Q1 2009 release seems to have fixed all of my problems with HTML on reports. Woo hoo! :-)
0
Diederik
Top achievements
Rank 1
answered on 03 Nov 2009, 03:21 PM
Hello,

We have some HTML content stored in the database, created with the Telerik ASP.NET Ajax htmleditor control.

We would like to export this HTML content - which can span several printed pages - to a pdf document with a header and footer section. The HTML content can contain table elements amongst others.

Is this something that could be done using the Telerik Reporting HtmlTextBox control? If not, is there a way to do this with the current release of Telerik products?

Best Regards.
Diederik.
Tags
General Discussions
Asked by
Bruce Parr
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Rob
Top achievements
Rank 1
christopher willis
Top achievements
Rank 1
mano
Top achievements
Rank 1
Paul O'Brien
Top achievements
Rank 1
Vassil Petev
Telerik team
William Finnegan
Top achievements
Rank 1
Rossen Hristov
Telerik team
joeolsen
Top achievements
Rank 1
Jeremy Wadsworth
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Bruce Hochstetler
Top achievements
Rank 2
Gaurish
Top achievements
Rank 1
Steve
Telerik team
JustinWong
Top achievements
Rank 1
Paulo
Top achievements
Rank 2
Sypher
Top achievements
Rank 1
Mohammad
Top achievements
Rank 1
Diederik
Top achievements
Rank 1
Share this question
or