Exporting primefaces:Tree to pdf - jsf-2

I have a tree structure displayed on my webpage. The nodes are dynamically created from the data retrieved from the database. I want the entire tree(exlpoded view) to be exported to a pdf file. How can I achieve this using a java library? I am using JSF2.1 with primefaces 3.5. Any help would be appreciated.

I had similar problem and I found this "plug-in", check it out: https://github.com/rdicroce/jsfexporter

Related

Grails Export Plugin - Embed Image

I've got the grails export plugin working nicely but is there any way of embedding an image in the produced pdf report? I cant find an obvious way of doing it :(
many thanks
Tom
Why would you require to put an image when export plugin only talks about domain object. If you are looking for generating report which has images and other html stuff, I think itext library is the way forward.
Thanks, KJ

read html file table in ios

I am creating an application for reading html file .I have searched and found that we can easily convert a html to PDF format ,which is non-editable. And if we are using coretext ,then we can edit the fonts.In the server we are keeping one html file, which includes texts and tables.
My problems are
How we can I convert the data inside the table?
How can I change the fontsize of the text while reading?(same time table should not be broken)
If anybody has idea then please help me.Thanks in advance

XML SDK 2.0 - Images - Excel file

With the use of the Open XML SDK 2.0, I did preformed the Reflected Code of an Excel file.
Along with other things, the Excel file has some images in some of the cells. When I run the code that was generated, the file show the images just fine.
What I need to do is to programatically inject images in place of the
images that are there now. The thing is, I cannot find where the images are at in the code that was generated. How can I figure this out? Also what is the easiest way to replace those images with new ones programmatically?
You may want to take a look at a similar question about inserting images into Excel files with OpenXML SDK: C# & OpenXML: Insert an image into an excel document.
Basically, those files are created as separate document parts. The answer I linked to should show You how to insert a new image into a document, however, in order to substitute existing images with your custom ones, you could probably just modify the binary data of appropriate ImagePart (and some other associated properties).
If You need some help with the code performing this task, let me know.

Incorporating an image in the rich-ui treeview

I am using the Rich-UI plugin treeview feature in a Grails application. I have it working but was trying to see how to incorporate a pdf icon/image in the treeview to identify to the user they can launch a pdf from the link. Can someone explain to me how to place an image in the treeview? Any help with file names, etc would be greatly appreciated.

Strategy in exporting to Excel with formatting from ASP.NET?

So this is another exporting to Excel question.
I have a page that has a table with formatting by stylesheet.
When I export the page by setting the ContentType to application/excel and Content-Disposition to attachment, I can export the table to Excel (not CSV). However, it loses all formatting. I think it's because Excel does not load CSS and I guess that's reasonable.
So, in a scenario where I have to show the table on the web and also export to Excel, both with similar (even if not exact) formatting, what would be the best approach without using something like NPOI?
I am trying to minimize the work and keep the single template if possible. Is it necessary for me to create two separate templates: one with stylesheet, the other with embedded style in the table itself for Excel?
Having a single template with conditional formatting inside would be very messy.
Any ideas?
If you not yet solve the problem I'll recommend you to use Open XML SDK 2.0 for Microsoft Office (see http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&displaylang=en). With this way you will be able create an XLSX file without installing Excel on the server. XLSX file is compressed (like ZIP file) collection of xml files. Open XML SDK 2.0 helps you create and change XLSX file as pure xml files. At the first time if you look at Open XML SDK a lot of things look like strange, but it's only at the beginning. There are so named "Open XML SDK 2.0 Productivity Tool" (a part of Open XML SDK 2.0) which can generate a lot of useful code for you. Moreover you can create a nice Excel document which you can use as a prototype (template) of the document which you will create. So you can solve the problem of complex formating without writing of a lot of code.
Look at http://msdn.microsoft.com/en-us/library/cc850837(v=office.14).aspx for some examples and on http://openxmldeveloper.org/default.aspx. See also Creating Excel document with OpenXml sdk 2.0 as a start example. You can find also a lot of good stuffs on http://www.codeplex.com about Open XML SDK
there are several aproach
you could instantiate a excel object on your server using VSTO, and then write the document on memory and write to response the native file, but this aproach could be a litle expensive if you create a excel object per request, so you could try to do a singleton object that wraps the excel object instance
You can create a report (rdlc file) with a similar look to the grid. Then, you can have an action where you instantiate a LocalReport, pass the data you want to it and call its Render method. You then return the byte array returned by the Render method.

Resources