Generate charts using Java/word + fusionchart

Source: Internet
Author: User
Tags ole

A friend uses fusionchart in his project and needs to provide the word download function for multiple reports.

There is no doubt that it is only a very difficult problem.

Fusionchart provides the function of generating images on the server and the client, which is based on the flash display on the client.

My friend's project is based on Linux, and the com mechanism of the Office itself cannot be called through Jacob.

Java-only word, poi, and docx4j operations can generate WORD Documents, tables, and insert images.

A feasible idea is to open the flash charts on a new page when you click to download a report, and then call the fusoinchart function to generate images on the server,

Finally, JS calls servlet to generate the doc, and inserts each image generated in the previous step into the document.

The performance of this curve saving the nation is very low.

The second idea is to insert Flash directly into the word as the form of OLE to the word, and mix it with other content. The performance of this method should be OK, and the flash will be rendered in real time after the word is opened.

However, if you find that word uses Ole Doc, you cannot use hwpf. You can only spell Biff files a little bit by yourself. This is really hard to do, and you still don't know if Ole can be displayed.

Give up. PS: It is found that the simple support for ActiveX is provided in the wfe-processing PPT function... I will go ..

The third idea is to get the data of the generated chart and directly use the office chart function. Unfortunately, it is found that this function is not available in hwpf, which is available in hssf's Excel processing function.

The last method is relatively simple and feasible, and the performance is acceptable. The background uses jfreechart to generate images and then generates Word documents.

The downside is that the chart style is different from that of fusion. Jfree is too ugly. However, this method is the most suitable method currently.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.