<?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: Use NPOI to populate an Excel template</title>
	<atom:link href="http://www.zachhunter.com/2010/05/npoi-excel-template/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachhunter.com/2010/05/npoi-excel-template/</link>
	<description>Random Brain Drool</description>
	<lastBuildDate>Thu, 02 Feb 2012 20:52:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: sasi</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-803</link>
		<dc:creator>sasi</dc:creator>
		<pubDate>Wed, 30 Nov 2011 11:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-803</guid>
		<description>Hi Zach,

Can you advise me how to deal with an excel template which has images in it? I was able to open the teamplat and update it with data and save it with a different name. However when i open the new excel even though the content is all good HSSFWorkbook is corrupting the content and not letting me save it. Can you please suggest me the way forward? Thank you.</description>
		<content:encoded><![CDATA[<p>Hi Zach,</p>
<p>Can you advise me how to deal with an excel template which has images in it? I was able to open the teamplat and update it with data and save it with a different name. However when i open the new excel even though the content is all good HSSFWorkbook is corrupting the content and not letting me save it. Can you please suggest me the way forward? Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IG</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-671</link>
		<dc:creator>IG</dc:creator>
		<pubDate>Fri, 22 Jul 2011 16:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-671</guid>
		<description>Hi Zach

I created a new .xls file and it has simple macro that populates a cell with a value.  When I use my website to populate the .xls from another machine i get prompted to enable macros, which I do.  But then I get an error of &quot;An error occured while loading &#039;Module 1&#039;, do you want to continue loading project.

Do you I need to save the Excel file as another file type maybe?

Many thanks</description>
		<content:encoded><![CDATA[<p>Hi Zach</p>
<p>I created a new .xls file and it has simple macro that populates a cell with a value.  When I use my website to populate the .xls from another machine i get prompted to enable macros, which I do.  But then I get an error of &#8220;An error occured while loading &#8216;Module 1&#8242;, do you want to continue loading project.</p>
<p>Do you I need to save the Excel file as another file type maybe?</p>
<p>Many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-663</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 22 Jul 2011 14:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-663</guid>
		<description>IG, I&#039;ve put some basic Macro&#039;s in my templates before and they worked but I&#039;ve never tried adding a button.  Can you confirm the following.

1. Create a new EXCEL file with a w/macro (don&#039;t have to create button, just record something and save).
2. Add some data using NPOI.
3. Open the XLS document in EXCEL and manually run macro.

If this does not work, I suggest you post your XLS file to the NPOI forum / bug section to see if somebody will take some time debugging it.  The most important thing is being able to recreate the error, it&#039;s very common for XLS files to get corruption... so make sure you start your test by creating a new XLS file.</description>
		<content:encoded><![CDATA[<p>IG, I&#8217;ve put some basic Macro&#8217;s in my templates before and they worked but I&#8217;ve never tried adding a button.  Can you confirm the following.</p>
<p>1. Create a new EXCEL file with a w/macro (don&#8217;t have to create button, just record something and save).<br />
2. Add some data using NPOI.<br />
3. Open the XLS document in EXCEL and manually run macro.</p>
<p>If this does not work, I suggest you post your XLS file to the NPOI forum / bug section to see if somebody will take some time debugging it.  The most important thing is being able to recreate the error, it&#8217;s very common for XLS files to get corruption&#8230; so make sure you start your test by creating a new XLS file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IG</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-641</link>
		<dc:creator>IG</dc:creator>
		<pubDate>Fri, 22 Jul 2011 09:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-641</guid>
		<description>Hi Zach

I was wondering if I coudl ask a question about Macros and NPOI.  I have created a simple template as described in the above.  In the template I have added a Button, on click it calls a Sub Button1_Click which just outputs a msgbox saying hellow world.

The macro works fine when I am on my dev machine (machine that created spreadsheet) however when I try it from another machine  I get errors such as

&quot;An error while loading &#039;ThisWorkbook&#039;.  Do you want to continue loadiung this project&quot;

&quot;An error occured while loading &#039;Module1&#039; Do you still want to continue loading the project

Any ideas why this is happening?  Can I use Macros with NPOI

Many thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi Zach</p>
<p>I was wondering if I coudl ask a question about Macros and NPOI.  I have created a simple template as described in the above.  In the template I have added a Button, on click it calls a Sub Button1_Click which just outputs a msgbox saying hellow world.</p>
<p>The macro works fine when I am on my dev machine (machine that created spreadsheet) however when I try it from another machine  I get errors such as</p>
<p>&#8220;An error while loading &#8216;ThisWorkbook&#8217;.  Do you want to continue loadiung this project&#8221;</p>
<p>&#8220;An error occured while loading &#8216;Module1&#8242; Do you still want to continue loading the project</p>
<p>Any ideas why this is happening?  Can I use Macros with NPOI</p>
<p>Many thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-515</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 24 Jun 2011 18:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-515</guid>
		<description>There is no way to &quot;auto convert&quot; XLS to XLSX that will preserve all formatting.  You can easily convert the raw data, but that doesn&#039;t sound too helpful in your case. 

Here are some work around ideas:

1. Create a auto-run macro that formats the sheet when the user opens it?  
2. Format the values in SQL before inserting into Excel.
3. Fill a column with a formula/format that will compute the percent and display correct.
    Example: Cost = Export, Price = Export, Margin = Calculated / Formatted Field</description>
		<content:encoded><![CDATA[<p>There is no way to &#8220;auto convert&#8221; XLS to XLSX that will preserve all formatting.  You can easily convert the raw data, but that doesn&#8217;t sound too helpful in your case. </p>
<p>Here are some work around ideas:</p>
<p>1. Create a auto-run macro that formats the sheet when the user opens it?<br />
2. Format the values in SQL before inserting into Excel.<br />
3. Fill a column with a formula/format that will compute the percent and display correct.<br />
    Example: Cost = Export, Price = Export, Margin = Calculated / Formatted Field</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurie</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-514</link>
		<dc:creator>Laurie</dc:creator>
		<pubDate>Fri, 24 Jun 2011 18:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-514</guid>
		<description>Hello Zach,
Thank you so much for your reply. I think I used your DBA&#039;s approach to load data from SQL to Excel. There is only one  column having formacting issue. In my template, I set it as percentage, but my output column did not apply that at all. So that was the reason I searched ExcelPackage to accomplish this, but SSIS only can return xls file.  Is there a way to convert xls to xlsx programmatically without using Microsoft office on the server side?
Thank you!
Laurie</description>
		<content:encoded><![CDATA[<p>Hello Zach,<br />
Thank you so much for your reply. I think I used your DBA&#8217;s approach to load data from SQL to Excel. There is only one  column having formacting issue. In my template, I set it as percentage, but my output column did not apply that at all. So that was the reason I searched ExcelPackage to accomplish this, but SSIS only can return xls file.  Is there a way to convert xls to xlsx programmatically without using Microsoft office on the server side?<br />
Thank you!<br />
Laurie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-513</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 24 Jun 2011 16:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-513</guid>
		<description>I just checked one of her templates, she creates a named range and applies the formatting to the column.  Then, when she loads the data from SQL to EXCEL, she sets the named range as her target.  This way she can put a header and other data at the top of the sheet and append her data into the named range.  This results in formatting being applied to every cell in every row.</description>
		<content:encoded><![CDATA[<p>I just checked one of her templates, she creates a named range and applies the formatting to the column.  Then, when she loads the data from SQL to EXCEL, she sets the named range as her target.  This way she can put a header and other data at the top of the sheet and append her data into the named range.  This results in formatting being applied to every cell in every row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-512</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 24 Jun 2011 16:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-512</guid>
		<description>Laurie,

I have not personally used SSIS to output XLS files, but my DBA at work has and all her reports are fully formatted from the First Row to Last Row.  It sounds like there is a problem with your template that SSIS is using.  Is you template completely formatted, did you apply the formatting on the column?  You should try fixing the template versus using ExcelPackage/NPOI to double process your Excel file.  Let me know what happens after you apply your formatting to the column, if it doesn&#039;t work I can look at one of my DBA&#039;s file to see how she setup her report template for SSIS.

Zach</description>
		<content:encoded><![CDATA[<p>Laurie,</p>
<p>I have not personally used SSIS to output XLS files, but my DBA at work has and all her reports are fully formatted from the First Row to Last Row.  It sounds like there is a problem with your template that SSIS is using.  Is you template completely formatted, did you apply the formatting on the column?  You should try fixing the template versus using ExcelPackage/NPOI to double process your Excel file.  Let me know what happens after you apply your formatting to the column, if it doesn&#8217;t work I can look at one of my DBA&#8217;s file to see how she setup her report template for SSIS.</p>
<p>Zach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurie</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-511</link>
		<dc:creator>Laurie</dc:creator>
		<pubDate>Fri, 24 Jun 2011 15:55:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-511</guid>
		<description>Hi Zach,
I am new to NPOI. I have used SSIS to output xls file using my predifned template. Now the outputed xls file included my predefined clomun names and associated cell format in the first row, and predefined sample data with the right cell formact in the second row, and the output data satrting from row 4 to row 780 without any formatcting. I need to use NPOI to force all cloumn row from 4 to 780 using same cell formact as row 2. I was able to use excelPackage to do that but I need to manually open xls file in Excel and renamed to xlsx. Do you think it is possible to use NPOI to convert xls to xlsx and reused my working codes with ExcelPackage, or I have to use NPOI to do all the work?
Thank you for your help!
Laurie</description>
		<content:encoded><![CDATA[<p>Hi Zach,<br />
I am new to NPOI. I have used SSIS to output xls file using my predifned template. Now the outputed xls file included my predefined clomun names and associated cell format in the first row, and predefined sample data with the right cell formact in the second row, and the output data satrting from row 4 to row 780 without any formatcting. I need to use NPOI to force all cloumn row from 4 to 780 using same cell formact as row 2. I was able to use excelPackage to do that but I need to manually open xls file in Excel and renamed to xlsx. Do you think it is possible to use NPOI to convert xls to xlsx and reused my working codes with ExcelPackage, or I have to use NPOI to do all the work?<br />
Thank you for your help!<br />
Laurie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.zachhunter.com/2010/05/npoi-excel-template/comment-page-1/#comment-492</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Mon, 20 Jun 2011 16:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachhunter.com/?p=252#comment-492</guid>
		<description>In order to use a &quot;new empty&quot; sheet, you need to create the rows &amp; cells.  In the default state (a new sheet with no data), nothing is initialized so nothing is accessible.  To start using a blank sheet, you need to create a row and then create the cell.

&lt;code&gt;Sheet sheet = workbook.CreateSheet(&quot;Sheet1&quot;);
Row row = sheet.CreateRow(0);
row.CreateCell(0).SetCellValue(&quot;Cell A1&quot;);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>In order to use a &#8220;new empty&#8221; sheet, you need to create the rows &amp; cells.  In the default state (a new sheet with no data), nothing is initialized so nothing is accessible.  To start using a blank sheet, you need to create a row and then create the cell.</p>
<p><code>Sheet sheet = workbook.CreateSheet("Sheet1");<br />
Row row = sheet.CreateRow(0);<br />
row.CreateCell(0).SetCellValue("Cell A1");</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

