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 approachWhen you click to download a report, open the flash charts on a new page, 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.
This curve saves the nation with very low performance ,.
Second ideaIs to insert flash directly into the word, as the form of ole to the word, and mixed 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 ..
Third ideaIt 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.