Bug 61972 - Adding chart in Document of MS-Word File without reading Temp MS-Word File
Summary: Adding chart in Document of MS-Word File without reading Temp MS-Word File
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 4.0.x-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-06 17:40 UTC by SANDEEP TIWARI
Modified: 2018-01-20 23:05 UTC (History)
1 user (show)



Attachments
patch file which contains modified java file which used to create XWPFChart object in XWPFDocument without reading temp MS-WORD file (4.86 KB, patch)
2018-01-06 17:52 UTC, SANDEEP TIWARI
Details | Diff
Test Java File Which Explain how to create chart in XWPFDocument (24.06 KB, text/plain)
2018-01-06 17:58 UTC, SANDEEP TIWARI
Details
OutPut of TestChart class (11.88 KB, application/octet-stream)
2018-01-06 18:00 UTC, SANDEEP TIWARI
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SANDEEP TIWARI 2018-01-06 17:40:13 UTC
This patch contains 1 new java file and 5 modified filed including test file.
This patch can use for create chart in XWPFDocument without reading any temp MS-Word file{Extension of bug id 61745}.
Comment 1 SANDEEP TIWARI 2018-01-06 17:52:44 UTC
Created attachment 35656 [details]
patch file which contains modified java file which used to create XWPFChart object in XWPFDocument without reading temp MS-WORD file

this patch contains changes for creating XWPFChart object in XWPFDocument object without reading Temp ms-Word File which contains chart and then modifying them.
Comment 2 SANDEEP TIWARI 2018-01-06 17:58:53 UTC
Created attachment 35657 [details]
Test Java File Which Explain how to create chart in XWPFDocument

this test file have a example for creating chart in document.
Comment 3 SANDEEP TIWARI 2018-01-06 18:00:09 UTC
Created attachment 35658 [details]
OutPut of TestChart class

Created ms-Word File using TestChart class
Comment 4 SANDEEP TIWARI 2018-01-06 18:06:57 UTC
Hi sir,

Along with all changes,i tried to use existing Data file class i.e. XDDFChartData class object,but due to some difference between excel and ms-word chart creating i ma not able to use that class so for now i created XWPFChartData class. As we need to embedded excel file in MS-Word and MS-PPT file for chart data.
please give me suggestion on this so that i can update Document code along with power point chart creation code.

i also used some setter in XWPFChart object itself because i not got any other class where its already implemented and i thought it is right place from where a user can expect getters and setters.
Comment 5 PJ Fanning 2018-01-06 19:59:26 UTC
Thanks Sandeep for the patch. Would it be possible to make a Pull Request to https://github.com/apache/poi/ instead? I find it easier to review Pull Requests than svn diffs.
I had a quick look at TestChart.java and it uses a lot of the OOXML XMLBeans-generated CT classes directly and we are trying to abstract POI so that it does not require the direct use of these generated classes. The hope is to eventually replace the use of XMLBeans.
Comment 6 SANDEEP TIWARI 2018-01-07 05:44:34 UTC
Hi P J Fanning sir,
Should i used XDDFChart class method to create charts,
when i wrote that test class at that time there are no XDDFChart class so that's why i need to used ct class object.
i am updating test class with XDDFchart class method.
Comment 7 SANDEEP TIWARI 2018-01-08 19:45:08 UTC
hi sir,
please review code from Git Commit 
Adding chart in Document of MS-Word File without reading Temp MS-Word File #89
https://github.com/apache/poi/pull/89