<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Read DOC file Using Java and Apache POI</title>
	<atom:link href="http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/feed/" rel="self" type="application/rss+xml" />
	<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/</link>
	<description>www.sanjaal.com/java</description>
	<lastBuildDate>Sun, 20 Jun 2010 18:02:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: gionny</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-3230</link>
		<dc:creator>gionny</dc:creator>
		<pubDate>Wed, 27 Jan 2010 14:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-3230</guid>
		<description><![CDATA[Hi, your code is very useful!!! 
The question is: once to get header and footer , how i replace text into?
Please if you have a solution for this, any type of solution, please tell me, i&#039;m very desperate!!! (2 mounth on this problem)
thanx
Gionny]]></description>
		<content:encoded><![CDATA[<p>Hi, your code is very useful!!!<br />
The question is: once to get header and footer , how i replace text into?<br />
Please if you have a solution for this, any type of solution, please tell me, i&#8217;m very desperate!!! (2 mounth on this problem)<br />
thanx<br />
Gionny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anita</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-2950</link>
		<dc:creator>Anita</dc:creator>
		<pubDate>Tue, 08 Dec 2009 12:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-2950</guid>
		<description><![CDATA[Hi

I need to copy a XSSFSheet from one XSSFWorkbook to an other XSSFWorkbook. How can I do that? Can anyone help me please?

Thanks in advance]]></description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I need to copy a XSSFSheet from one XSSFWorkbook to an other XSSFWorkbook. How can I do that? Can anyone help me please?</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kushalzone</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-824</link>
		<dc:creator>kushalzone</dc:creator>
		<pubDate>Thu, 23 Jul 2009 15:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-824</guid>
		<description><![CDATA[You can use a vector say vectOne where you can store another vector say vectTwo. vectTwo will contain your data (individual row). vectOne will contain collections of vectTwo.

It&#039;s a simple manipulation. You can do the vector to array and array to vector conversions easily, if required at any portion of the program.]]></description>
		<content:encoded><![CDATA[<p>You can use a vector say vectOne where you can store another vector say vectTwo. vectTwo will contain your data (individual row). vectOne will contain collections of vectTwo.</p>
<p>It&#8217;s a simple manipulation. You can do the vector to array and array to vector conversions easily, if required at any portion of the program.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-822</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Thu, 23 Jul 2009 04:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-822</guid>
		<description><![CDATA[Hi kushal i did follow your documents and everything is working fine.Thanks for that.
But i had one small doubt, in the method:
public static String [][] preapreDataToWriteToExcel(){
		 String [][] excelData = new String [4][4];
		 excelData[0][0]=&quot;First Name&quot;;
		 excelData [0][1]=&quot;Last Name&quot;;
		 excelData[0][2]=&quot;Telephone&quot;;
		 excelData[0][3]=&quot;Address&quot;;

		 excelData[1][0]=&quot;Kushal&quot;;
		 excelData[1][1]=&quot;Paudyal&quot;;
		 excelData[1][2]=&quot;000-000-0000&quot;;
		 excelData[1][3]=&quot;IL,USA&quot;;

		 excelData[2][0]=&quot;Randy&quot;;
		 excelData[2][1]=&quot;Ram Robinson&quot;;
		 excelData[2][2]=&quot;111-111-1111&quot;;
		 excelData[2][3]=&quot;TX, USA&quot;;

		 excelData[3][0]=&quot;Phil&quot;;
		 excelData[3][1]=&quot;Collins&quot;;
		 excelData[3][2]=&quot;222-222-2222&quot;;
		 excelData[3][3]=&quot;NY, USA&quot;;

		 return excelData;
}
how to make it more generic.I mean for an instance i have some 1000 records in my list after parsing ,so i cannot enter manually those 1000 records,how to make the cell grow dynamically???

public static String[][] preapreDataToWriteToExcel() {
		try {
			Parser ps = new Parser();
			XMLReader xmlReader = null;
			SAXParserFactory spfactory = SAXParserFactory.newInstance();
			spfactory.setValidating(false);
			SAXParser saxParser = spfactory.newSAXParser();
			xmlReader = saxParser.getXMLReader();
			xmlReader.setContentHandler(ps);
			xmlReader.setErrorHandler(ps);
			InputSource source = new InputSource(&quot;C:/RunningShoes.xml&quot;);

			xmlReader.parse(source);
			List sellersList = ps.getDetails();
			for (ShoeCatalogBean seller : sellersList) {
				System.out.println(sellersList.size());
				String[][] excelData = new String[12][12];
				excelData[0][0] = &quot;CategoryGroup&quot;;
				excelData[0][1] = &quot;Category&quot;;
				excelData[0][2] = &quot;SubCategory&quot;;
				excelData[0][3] = &quot;Gender&quot;;
				excelData[0][4] = &quot;Brands&quot;;
				excelData[0][5] = &quot;ProductName&quot;;
				excelData[0][6] = &quot;StyleNumber&quot;;
				excelData[0][7] = &quot;SelectedColor&quot;;
				excelData[0][8] = &quot;Size&quot;;
				excelData[0][9] = &quot;Width&quot;;
				excelData[0][10] = &quot;Price&quot;;
				excelData[0][11] = &quot;ProductDescription&quot;;

				excelData[1][0] = seller.getCategoryGroup();
				excelData[1][1] = seller.getCategory();
				excelData[1][2] = seller.getSubCategory();
				excelData[1][3] = seller.getGender();
				excelData[1][4] = seller.getBrands();
				excelData[1][5] = seller.getProductName();
				excelData[1][6] = seller.getStyleNumber();
				excelData[1][7] = seller.getSelectedColor();
				excelData[1][8] = seller.getSize();
				excelData[1][9] = seller.getWidth();
				excelData[1][10] = seller.getPrice();
				excelData[1][11] = seller.getProductDescription();
                                ..........
this is my piece of code.

Pls can you help me through this.

Regards,
Darshan]]></description>
		<content:encoded><![CDATA[<p>Hi kushal i did follow your documents and everything is working fine.Thanks for that.<br />
But i had one small doubt, in the method:<br />
public static String [][] preapreDataToWriteToExcel(){<br />
		 String [][] excelData = new String [4][4];<br />
		 excelData[0][0]=&#8221;First Name&#8221;;<br />
		 excelData [0][1]=&#8221;Last Name&#8221;;<br />
		 excelData[0][2]=&#8221;Telephone&#8221;;<br />
		 excelData[0][3]=&#8221;Address&#8221;;</p>
<p>		 excelData[1][0]=&#8221;Kushal&#8221;;<br />
		 excelData[1][1]=&#8221;Paudyal&#8221;;<br />
		 excelData[1][2]=&#8221;000-000-0000&#8243;;<br />
		 excelData[1][3]=&#8221;IL,USA&#8221;;</p>
<p>		 excelData[2][0]=&#8221;Randy&#8221;;<br />
		 excelData[2][1]=&#8221;Ram Robinson&#8221;;<br />
		 excelData[2][2]=&#8221;111-111-1111&#8243;;<br />
		 excelData[2][3]=&#8221;TX, USA&#8221;;</p>
<p>		 excelData[3][0]=&#8221;Phil&#8221;;<br />
		 excelData[3][1]=&#8221;Collins&#8221;;<br />
		 excelData[3][2]=&#8221;222-222-2222&#8243;;<br />
		 excelData[3][3]=&#8221;NY, USA&#8221;;</p>
<p>		 return excelData;<br />
}<br />
how to make it more generic.I mean for an instance i have some 1000 records in my list after parsing ,so i cannot enter manually those 1000 records,how to make the cell grow dynamically???</p>
<p>public static String[][] preapreDataToWriteToExcel() {<br />
		try {<br />
			Parser ps = new Parser();<br />
			XMLReader xmlReader = null;<br />
			SAXParserFactory spfactory = SAXParserFactory.newInstance();<br />
			spfactory.setValidating(false);<br />
			SAXParser saxParser = spfactory.newSAXParser();<br />
			xmlReader = saxParser.getXMLReader();<br />
			xmlReader.setContentHandler(ps);<br />
			xmlReader.setErrorHandler(ps);<br />
			InputSource source = new InputSource(&#8220;C:/RunningShoes.xml&#8221;);</p>
<p>			xmlReader.parse(source);<br />
			List sellersList = ps.getDetails();<br />
			for (ShoeCatalogBean seller : sellersList) {<br />
				System.out.println(sellersList.size());<br />
				String[][] excelData = new String[12][12];<br />
				excelData[0][0] = &#8220;CategoryGroup&#8221;;<br />
				excelData[0][1] = &#8220;Category&#8221;;<br />
				excelData[0][2] = &#8220;SubCategory&#8221;;<br />
				excelData[0][3] = &#8220;Gender&#8221;;<br />
				excelData[0][4] = &#8220;Brands&#8221;;<br />
				excelData[0][5] = &#8220;ProductName&#8221;;<br />
				excelData[0][6] = &#8220;StyleNumber&#8221;;<br />
				excelData[0][7] = &#8220;SelectedColor&#8221;;<br />
				excelData[0][8] = &#8220;Size&#8221;;<br />
				excelData[0][9] = &#8220;Width&#8221;;<br />
				excelData[0][10] = &#8220;Price&#8221;;<br />
				excelData[0][11] = &#8220;ProductDescription&#8221;;</p>
<p>				excelData[1][0] = seller.getCategoryGroup();<br />
				excelData[1][1] = seller.getCategory();<br />
				excelData[1][2] = seller.getSubCategory();<br />
				excelData[1][3] = seller.getGender();<br />
				excelData[1][4] = seller.getBrands();<br />
				excelData[1][5] = seller.getProductName();<br />
				excelData[1][6] = seller.getStyleNumber();<br />
				excelData[1][7] = seller.getSelectedColor();<br />
				excelData[1][8] = seller.getSize();<br />
				excelData[1][9] = seller.getWidth();<br />
				excelData[1][10] = seller.getPrice();<br />
				excelData[1][11] = seller.getProductDescription();<br />
                                &#8230;&#8230;&#8230;.<br />
this is my piece of code.</p>
<p>Pls can you help me through this.</p>
<p>Regards,<br />
Darshan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-818</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Wed, 22 Jul 2009 11:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-818</guid>
		<description><![CDATA[Hi Kunal,
Thanks for the help.
I had one small doubt , i could create a excel sheet using the code which you had suggested and we are using Sax parser instead of Dom.As mentioned in your post 

The method:
public static String [][] preapreDataToWriteToExcel(){
		 String [][] excelData = new String [4][4];
		 excelData[0][0]=&quot;First Name&quot;;
		 excelData [0][1]=&quot;Last Name&quot;;
		 excelData[0][2]=&quot;Telephone&quot;;
		 excelData[0][3]=&quot;Address&quot;;

		 excelData[1][0]=&quot;Kushal&quot;;
		 excelData[1][1]=&quot;Paudyal&quot;;
		 excelData[1][2]=&quot;000-000-0000&quot;;
		 excelData[1][3]=&quot;IL,USA&quot;;

		 excelData[2][0]=&quot;Randy&quot;;
		 excelData[2][1]=&quot;Ram Robinson&quot;;
		 excelData[2][2]=&quot;111-111-1111&quot;;
		 excelData[2][3]=&quot;TX, USA&quot;;

		 excelData[3][0]=&quot;Phil&quot;;
		 excelData[3][1]=&quot;Collins&quot;;
		 excelData[3][2]=&quot;222-222-2222&quot;;
		 excelData[3][3]=&quot;NY, USA&quot;;

		 return excelData;

	 }	
Can we make  String [][] excelData = new String [4][4]; more generic ,i mean to grow based on the length of the data present in the list. Because we are parsing a xml of some 3000 data and we cannot manually create the cell rows and columns.

For an instance in our apllication we are having something like this:
public class XmlToExcel {
	public static void main(String[] args) {
		String fileName = &quot;C:\\temp\\testPOIWrite.xls&quot;;
		writeDataToExcelFile(fileName);
	}

	private static void writeDataToExcelFile(String fileName) {

		String[][] excelData = preapreDataToWriteToExcel();

		HSSFWorkbook myWorkBook = new HSSFWorkbook();
		HSSFSheet mySheet = myWorkBook.createSheet();
		HSSFRow myRow = null;
		HSSFCell myCell = null;

		for (int rowNum = 0; rowNum &lt; 12; rowNum++) {
			myRow = mySheet.createRow(rowNum);

			for (int cellNum = 0; cellNum &lt; 12; cellNum++) {
				myCell = myRow.createCell(cellNum);
				myCell.setCellValue(excelData[rowNum][cellNum]);

			}
		}

		try {
			FileOutputStream out = new FileOutputStream(fileName);
			myWorkBook.write(out);
			out.close();
		} catch (Exception e) {
			System.err.print(&quot;In &quot; + e.getMessage());
		}

	}

	/** Prepare some demo data as excel file content* */
	public static String[][] preapreDataToWriteToExcel() {
		try {
			Parser ps = new Parser();
			XMLReader xmlReader = null;
			SAXParserFactory spfactory = SAXParserFactory.newInstance();
			spfactory.setValidating(false);
			SAXParser saxParser = spfactory.newSAXParser();
			xmlReader = saxParser.getXMLReader();
			xmlReader.setContentHandler(ps);
			xmlReader.setErrorHandler(ps);
			InputSource source = new InputSource(&quot;C:/Women_RunningShoes.xml&quot;);

			xmlReader.parse(source);
			List sellersList = ps.getDetails();
			for (ShoeCatalogBean seller : sellersList) {
				System.out.println(sellersList.size());
				String[][] excelData = new String[12][12];
				excelData[0][0] = &quot;CategoryGroup&quot;;
				excelData[0][1] = &quot;Category&quot;;
				excelData[0][2] = &quot;SubCategory&quot;;
				excelData[0][3] = &quot;Gender&quot;;
				excelData[0][4] = &quot;Brands&quot;;
				excelData[0][5] = &quot;ProductName&quot;;
				excelData[0][6] = &quot;StyleNumber&quot;;
				excelData[0][7] = &quot;SelectedColor&quot;;
				excelData[0][8] = &quot;Size&quot;;
				excelData[0][9] = &quot;Width&quot;;
				excelData[0][10] = &quot;Price&quot;;
				excelData[0][11] = &quot;ProductDescription&quot;;

				excelData[1][0] = seller.getCategoryGroup();
				excelData[1][1] = seller.getCategory();
				excelData[1][2] = seller.getSubCategory();
				excelData[1][3] = seller.getGender();
				excelData[1][4] = seller.getBrands();
				excelData[1][5] = seller.getProductName();
				excelData[1][6] = seller.getStyleNumber();
				excelData[1][7] = seller.getSelectedColor();
				excelData[1][8] = seller.getSize();
				excelData[1][9] = seller.getWidth();
				excelData[1][10] = seller.getPrice();
				excelData[1][11] = seller.getProductDescription();

				excelData[2][0] = seller.getCategoryGroup();
				excelData[2][1] = seller.getCategory();
				excelData[2][2] = seller.getSubCategory();
				excelData[2][3] = seller.getGender();
				excelData[2][4] = seller.getBrands();
				excelData[2][5] = seller.getProductName();
				excelData[2][6] = seller.getStyleNumber();
				excelData[2][7] = seller.getSelectedColor();
				excelData[2][8] = seller.getSize();
				excelData[2][9] = seller.getWidth();
				excelData[2][10] = seller.getPrice();
				excelData[2][11] = seller.getProductDescription();
                                .........
                                return excelData;
}

		} catch (Exception e) {
			System.err.println(e);
			System.exit(1);
		}
		return null;
	}

}

Any help would be appreciated.
I feel i posted a too big comment:-)

Regards,
Darshan]]></description>
		<content:encoded><![CDATA[<p>Hi Kunal,<br />
Thanks for the help.<br />
I had one small doubt , i could create a excel sheet using the code which you had suggested and we are using Sax parser instead of Dom.As mentioned in your post </p>
<p>The method:<br />
public static String [][] preapreDataToWriteToExcel(){<br />
		 String [][] excelData = new String [4][4];<br />
		 excelData[0][0]=&#8221;First Name&#8221;;<br />
		 excelData [0][1]=&#8221;Last Name&#8221;;<br />
		 excelData[0][2]=&#8221;Telephone&#8221;;<br />
		 excelData[0][3]=&#8221;Address&#8221;;</p>
<p>		 excelData[1][0]=&#8221;Kushal&#8221;;<br />
		 excelData[1][1]=&#8221;Paudyal&#8221;;<br />
		 excelData[1][2]=&#8221;000-000-0000&#8243;;<br />
		 excelData[1][3]=&#8221;IL,USA&#8221;;</p>
<p>		 excelData[2][0]=&#8221;Randy&#8221;;<br />
		 excelData[2][1]=&#8221;Ram Robinson&#8221;;<br />
		 excelData[2][2]=&#8221;111-111-1111&#8243;;<br />
		 excelData[2][3]=&#8221;TX, USA&#8221;;</p>
<p>		 excelData[3][0]=&#8221;Phil&#8221;;<br />
		 excelData[3][1]=&#8221;Collins&#8221;;<br />
		 excelData[3][2]=&#8221;222-222-2222&#8243;;<br />
		 excelData[3][3]=&#8221;NY, USA&#8221;;</p>
<p>		 return excelData;</p>
<p>	 }<br />
Can we make  String [][] excelData = new String [4][4]; more generic ,i mean to grow based on the length of the data present in the list. Because we are parsing a xml of some 3000 data and we cannot manually create the cell rows and columns.</p>
<p>For an instance in our apllication we are having something like this:<br />
public class XmlToExcel {<br />
	public static void main(String[] args) {<br />
		String fileName = &#8220;C:\\temp\\testPOIWrite.xls&#8221;;<br />
		writeDataToExcelFile(fileName);<br />
	}</p>
<p>	private static void writeDataToExcelFile(String fileName) {</p>
<p>		String[][] excelData = preapreDataToWriteToExcel();</p>
<p>		HSSFWorkbook myWorkBook = new HSSFWorkbook();<br />
		HSSFSheet mySheet = myWorkBook.createSheet();<br />
		HSSFRow myRow = null;<br />
		HSSFCell myCell = null;</p>
<p>		for (int rowNum = 0; rowNum &lt; 12; rowNum++) {<br />
			myRow = mySheet.createRow(rowNum);</p>
<p>			for (int cellNum = 0; cellNum &lt; 12; cellNum++) {<br />
				myCell = myRow.createCell(cellNum);<br />
				myCell.setCellValue(excelData[rowNum][cellNum]);</p>
<p>			}<br />
		}</p>
<p>		try {<br />
			FileOutputStream out = new FileOutputStream(fileName);<br />
			myWorkBook.write(out);<br />
			out.close();<br />
		} catch (Exception e) {<br />
			System.err.print(&#8220;In &#8221; + e.getMessage());<br />
		}</p>
<p>	}</p>
<p>	/** Prepare some demo data as excel file content* */<br />
	public static String[][] preapreDataToWriteToExcel() {<br />
		try {<br />
			Parser ps = new Parser();<br />
			XMLReader xmlReader = null;<br />
			SAXParserFactory spfactory = SAXParserFactory.newInstance();<br />
			spfactory.setValidating(false);<br />
			SAXParser saxParser = spfactory.newSAXParser();<br />
			xmlReader = saxParser.getXMLReader();<br />
			xmlReader.setContentHandler(ps);<br />
			xmlReader.setErrorHandler(ps);<br />
			InputSource source = new InputSource(&#8220;C:/Women_RunningShoes.xml&#8221;);</p>
<p>			xmlReader.parse(source);<br />
			List sellersList = ps.getDetails();<br />
			for (ShoeCatalogBean seller : sellersList) {<br />
				System.out.println(sellersList.size());<br />
				String[][] excelData = new String[12][12];<br />
				excelData[0][0] = &#8220;CategoryGroup&#8221;;<br />
				excelData[0][1] = &#8220;Category&#8221;;<br />
				excelData[0][2] = &#8220;SubCategory&#8221;;<br />
				excelData[0][3] = &#8220;Gender&#8221;;<br />
				excelData[0][4] = &#8220;Brands&#8221;;<br />
				excelData[0][5] = &#8220;ProductName&#8221;;<br />
				excelData[0][6] = &#8220;StyleNumber&#8221;;<br />
				excelData[0][7] = &#8220;SelectedColor&#8221;;<br />
				excelData[0][8] = &#8220;Size&#8221;;<br />
				excelData[0][9] = &#8220;Width&#8221;;<br />
				excelData[0][10] = &#8220;Price&#8221;;<br />
				excelData[0][11] = &#8220;ProductDescription&#8221;;</p>
<p>				excelData[1][0] = seller.getCategoryGroup();<br />
				excelData[1][1] = seller.getCategory();<br />
				excelData[1][2] = seller.getSubCategory();<br />
				excelData[1][3] = seller.getGender();<br />
				excelData[1][4] = seller.getBrands();<br />
				excelData[1][5] = seller.getProductName();<br />
				excelData[1][6] = seller.getStyleNumber();<br />
				excelData[1][7] = seller.getSelectedColor();<br />
				excelData[1][8] = seller.getSize();<br />
				excelData[1][9] = seller.getWidth();<br />
				excelData[1][10] = seller.getPrice();<br />
				excelData[1][11] = seller.getProductDescription();</p>
<p>				excelData[2][0] = seller.getCategoryGroup();<br />
				excelData[2][1] = seller.getCategory();<br />
				excelData[2][2] = seller.getSubCategory();<br />
				excelData[2][3] = seller.getGender();<br />
				excelData[2][4] = seller.getBrands();<br />
				excelData[2][5] = seller.getProductName();<br />
				excelData[2][6] = seller.getStyleNumber();<br />
				excelData[2][7] = seller.getSelectedColor();<br />
				excelData[2][8] = seller.getSize();<br />
				excelData[2][9] = seller.getWidth();<br />
				excelData[2][10] = seller.getPrice();<br />
				excelData[2][11] = seller.getProductDescription();<br />
                                &#8230;&#8230;&#8230;<br />
                                return excelData;<br />
}</p>
<p>		} catch (Exception e) {<br />
			System.err.println(e);<br />
			System.exit(1);<br />
		}<br />
		return null;<br />
	}</p>
<p>}</p>
<p>Any help would be appreciated.<br />
I feel i posted a too big comment:-)</p>
<p>Regards,<br />
Darshan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kushalzone</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-809</link>
		<dc:creator>kushalzone</dc:creator>
		<pubDate>Tue, 21 Jul 2009 20:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-809</guid>
		<description><![CDATA[Darshan, 

Use the following tutorial to learn how to read XML Files in Java which I wrote Just today. 

http://sanjaal.com/java/2009/07/21/read-xml-file-in-java-using-dom-a-simple-tutorial/

See the notes at the end of the above tutorial on how you can writes contents thus read from XML to the excel files. Hope my suggestions will guide you to write directions.

Since both are working codes, you should have no problems modifying them to suit your needs.]]></description>
		<content:encoded><![CDATA[<p>Darshan, </p>
<p>Use the following tutorial to learn how to read XML Files in Java which I wrote Just today. </p>
<p><a href="http://sanjaal.com/java/2009/07/21/read-xml-file-in-java-using-dom-a-simple-tutorial/" rel="nofollow">http://sanjaal.com/java/2009/07/21/read-xml-file-in-java-using-dom-a-simple-tutorial/</a></p>
<p>See the notes at the end of the above tutorial on how you can writes contents thus read from XML to the excel files. Hope my suggestions will guide you to write directions.</p>
<p>Since both are working codes, you should have no problems modifying them to suit your needs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-806</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Tue, 21 Jul 2009 09:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-806</guid>
		<description><![CDATA[Hi Kushal,
Is there a way that i can read an xml document and using these contents of the xml ,can i create a excel sheet using POI .
Any help would be appreciated.

Regards,
Darshan]]></description>
		<content:encoded><![CDATA[<p>Hi Kushal,<br />
Is there a way that i can read an xml document and using these contents of the xml ,can i create a excel sheet using POI .<br />
Any help would be appreciated.</p>
<p>Regards,<br />
Darshan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-804</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Tue, 21 Jul 2009 05:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-804</guid>
		<description><![CDATA[Hi Kushal,
Is there a way that i can read the xml contents and create an excel using these contents.Does POI supports this?? I tried something like this but not much of help.

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.poi.hslf.model.Sheet;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.sun.rowset.internal.Row;

public class Workbook1 {
	public static void main(String[] args) throws IOException {
		XSSFWorkbook wb = new XSSFWorkbook();
		XSSFSheet invoice = wb.createSheet(&quot;Invoice&quot;);
		int rowNumber = 2;
		XSSFRow row = invoice.createRow(rowNumber);
		row.createCell(0).setCellValue(&quot;Product ID&quot;);
		row.createCell(0).setCellValue(&quot;Description&quot;);
		row.createCell(0).setCellValue(&quot;Price&quot;);
		row.createCell(0).setCellValue(&quot;Quantity&quot;);
		row.createCell(0).setCellValue(&quot;Size&quot;);
		row.createCell(0).setCellValue(&quot;Total&quot;);

		rowNumber = rowNumber + 1;
		XSSFRow dataRow = invoice.createRow(rowNumber);
		Object fstNode = null;
		Element fstElmnt = (Element) fstNode;
		NodeList pdIdElmntLst = fstElmnt.getElementsByTagName(&quot;Product ID&quot;);
		Element pdIdElmnt = (Element) pdIdElmntLst.item(0);
		NodeList pdId = pdIdElmnt.getChildNodes();
		String productId = ((Node) pdId.item(0)).getNodeValue();
		dataRow.createCell(0).setCellValue(Integer.parseInt(productId));
		FileOutputStream fileOut;
		try {
			fileOut = new FileOutputStream(&quot;C:/Test.xls&quot;);
			wb.write(fileOut);
			fileOut.close();
		} catch (FileNotFoundException e) {

			e.printStackTrace();
		}

	}

	
}
It will be of great help if you can guide me through this.]]></description>
		<content:encoded><![CDATA[<p>Hi Kushal,<br />
Is there a way that i can read the xml contents and create an excel using these contents.Does POI supports this?? I tried something like this but not much of help.</p>
<p>import java.io.FileNotFoundException;<br />
import java.io.FileOutputStream;<br />
import java.io.IOException;</p>
<p>import org.apache.poi.hslf.model.Sheet;<br />
import org.apache.poi.xssf.usermodel.XSSFRow;<br />
import org.apache.poi.xssf.usermodel.XSSFSheet;<br />
import org.apache.poi.xssf.usermodel.XSSFWorkbook;<br />
import org.w3c.dom.Element;<br />
import org.w3c.dom.Node;<br />
import org.w3c.dom.NodeList;</p>
<p>import com.sun.rowset.internal.Row;</p>
<p>public class Workbook1 {<br />
	public static void main(String[] args) throws IOException {<br />
		XSSFWorkbook wb = new XSSFWorkbook();<br />
		XSSFSheet invoice = wb.createSheet(&#8220;Invoice&#8221;);<br />
		int rowNumber = 2;<br />
		XSSFRow row = invoice.createRow(rowNumber);<br />
		row.createCell(0).setCellValue(&#8220;Product ID&#8221;);<br />
		row.createCell(0).setCellValue(&#8220;Description&#8221;);<br />
		row.createCell(0).setCellValue(&#8220;Price&#8221;);<br />
		row.createCell(0).setCellValue(&#8220;Quantity&#8221;);<br />
		row.createCell(0).setCellValue(&#8220;Size&#8221;);<br />
		row.createCell(0).setCellValue(&#8220;Total&#8221;);</p>
<p>		rowNumber = rowNumber + 1;<br />
		XSSFRow dataRow = invoice.createRow(rowNumber);<br />
		Object fstNode = null;<br />
		Element fstElmnt = (Element) fstNode;<br />
		NodeList pdIdElmntLst = fstElmnt.getElementsByTagName(&#8220;Product ID&#8221;);<br />
		Element pdIdElmnt = (Element) pdIdElmntLst.item(0);<br />
		NodeList pdId = pdIdElmnt.getChildNodes();<br />
		String productId = ((Node) pdId.item(0)).getNodeValue();<br />
		dataRow.createCell(0).setCellValue(Integer.parseInt(productId));<br />
		FileOutputStream fileOut;<br />
		try {<br />
			fileOut = new FileOutputStream(&#8220;C:/Test.xls&#8221;);<br />
			wb.write(fileOut);<br />
			fileOut.close();<br />
		} catch (FileNotFoundException e) {</p>
<p>			e.printStackTrace();<br />
		}</p>
<p>	}</p>
<p>}<br />
It will be of great help if you can guide me through this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bihag</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-794</link>
		<dc:creator>Bihag</dc:creator>
		<pubDate>Fri, 17 Jul 2009 04:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-794</guid>
		<description><![CDATA[Nice Tutorial ...

But is there any way to read word comments and bookmarks using Java? Do u have a sample code? Any help would be appreciated.

Thanking you,
Bihag Raval]]></description>
		<content:encoded><![CDATA[<p>Nice Tutorial &#8230;</p>
<p>But is there any way to read word comments and bookmarks using Java? Do u have a sample code? Any help would be appreciated.</p>
<p>Thanking you,<br />
Bihag Raval</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saranya</title>
		<link>http://sanjaal.com/java/120/java-file/how-to-read-doc-file-using-java-and-apache-poi/comment-page-1/#comment-745</link>
		<dc:creator>Saranya</dc:creator>
		<pubDate>Fri, 03 Jul 2009 10:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://sanjaal.com/java/?p=120#comment-745</guid>
		<description><![CDATA[Too Good

the coding works perfectly

i was searching POI Coding for past 2 days but atlast i got ur site and worked fine
Thanks]]></description>
		<content:encoded><![CDATA[<p>Too Good</p>
<p>the coding works perfectly</p>
<p>i was searching POI Coding for past 2 days but atlast i got ur site and worked fine<br />
Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
