<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>boggy time</title>
	<link>http://boggy.digitbit.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 10 Jan 2008 07:18:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Warriors vs Spurs highlights up</title>
		<link>http://boggy.digitbit.com/warriors-spurs-highlights-up/</link>
		<comments>http://boggy.digitbit.com/warriors-spurs-highlights-up/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 07:17:03 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
	<dc:subject>warriors</dc:subject>
		<guid isPermaLink="false">http://boggy.digitbit.com/warriors-spurs-highlights-up/</guid>
		<description><![CDATA[To help everyone forget about tonight&#8217;s debacle in Portland, check out my highlights from the Spurs game on Monday.




]]></description>
			<content:encoded><![CDATA[<p>To help everyone forget about tonight&#8217;s debacle in Portland, check out my highlights from the Spurs game on Monday.</p>
<p><object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/x_9c9vI6HjU&#038;rel=1"></param>
<param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/x_9c9vI6HjU&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://boggy.digitbit.com/warriors-spurs-highlights-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Winning the Web contest</title>
		<link>http://boggy.digitbit.com/winning-the-web-contest/</link>
		<comments>http://boggy.digitbit.com/winning-the-web-contest/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 06:28:27 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
	<dc:subject>making money</dc:subject>
		<guid isPermaLink="false">http://boggy.digitbit.com/winning-the-web-contest/</guid>
		<description><![CDATA[I saw this contest on Winning the Web where I have a chance to win $100 and a free t-shirt.  All I have to do is write a post about who should win the contest, Winning the Web or TylerCruz.com.  The loser of the contest will pay $100 to 3 lucky contest participants [...]]]></description>
			<content:encoded><![CDATA[<p>I saw this contest on <a href="http://www.winningtheweb.com">Winning the Web</a> where I have a chance to win $100 and a free t-shirt.  All I have to do is write a post about who should win the contest, Winning the Web or <a href="http://www.tylercruz.com">TylerCruz.com</a>.  The loser of the contest will pay $100 to 3 lucky contest participants who voted for the winning blog.  So I&#8217;m dusting off this blog and I&#8217;ve decided to vote for&#8230;drumroll please&#8230; Gyutae Park&#8217;s Winning the Web!</p>
<p>Ok, here three reasons why I&#8217;m voting for him:<br />
1) Gyutae figured out a great way to get his blog out there by promoting a contest on <a href="http://www.johnchow.com">JohnChow.com</a>.  Because of it, I checked out his blog and I found that he had a lot of great content about making money on the web.  He has a lot of creative ideas (as evidenced by this contest) and he knows how to write.  Winning the Web is now one of my regular reads on my RSS reader.<br />
2) The guy is rich!  He spent $1500 on a contest to promote his blog by buying two Johnchow reviews and a <a href="http://www.johncow.com">Johncow</a> review.  I wish I was rich&#8230;<br />
3)  I need a new shirt to wear. Although honestly, the shirt looks kind of ugly and purple.  But with $100 I could buy a better, nicer, non-purple shirt, and I could use this shirt to clean my toilet.</p>
<p>Honestly, I&#8217;m impressed by how creative both these two bloggers are with this contest.  I hadn&#8217;t heard about TylerCruz.com before but I just checked it out and it looks like a good read as well.  So now I&#8217;m going to add the blog to my RSS feed as well.  And who knows? Maybe for their next contest, I will vote for Tyler.  Unless I win the $100.  In that case, it&#8217;s Winning the Web forever!  Alright, I just needed to write 300 words so that about does it.
</p>
]]></content:encoded>
			<wfw:commentRss>http://boggy.digitbit.com/winning-the-web-contest/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learning JasperReports</title>
		<link>http://boggy.digitbit.com/learning-jasperreports/</link>
		<comments>http://boggy.digitbit.com/learning-jasperreports/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 07:17:17 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
	<dc:subject>programming</dc:subject><dc:subject>ireport</dc:subject><dc:subject>jasper reports</dc:subject><dc:subject>java</dc:subject><dc:subject>programming</dc:subject><dc:subject>reports</dc:subject>
		<guid isPermaLink="false">http://boggy.digitbit.com/?p=3</guid>
		<description><![CDATA[At work, I've been tasked to do some reporting for a Java application that we have and I've been trying to learn the JasperReports library.  Unfortunately, the existing documentation/tutorials that I've found have been somewhat limited.  For example, I spent a few days pulling my hair out trying to understand how to get [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I've been tasked to do some reporting for a Java application that we have and I've been trying to learn the <a href="http://www.jasperforge.org/">JasperReports</a> library.  Unfortunately, the existing documentation/tutorials that I've found have been somewhat limited.  For example, I spent a few days pulling my hair out trying to understand how to get the subreports functionality working.  I think I've figured out the basics now, so here is a simple tutorial.</p>
<p><strong>Setup</strong></p>
<ul>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=36382&#038;package_id=28579">Download</a> JasperReports 1.2.7</li>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=64348">Download</a> IReport Designer 1.2.7</li>
<li>I'm using Eclipse as my Java development environment, but you can use whatever you want.</li>
</ul>
<p><strong>Creating our project<br />
</strong></p>
<p>In Eclipse, create a new Java project. To get everything compiled correctly, you need to have the following jars (from the JasperReports distribution) in your project classpath.</p>
<ul>
<li>jasperreports-1.2.7.jar</li>
<li>commons-digester-1.7.jar</li>
<li>commons-collections-2.1.jar</li>
<li>commons-logging-1.0.2.jar</li>
<li>commons-beanutils-1.5.jar</li>
<li>itext-1.3.1.jar</li>
</ul>
<p>Also, create a <strong>reports </strong>subdirectory for my reports to go into.  For this simple project, I want to display in a subreport a list of PersonBean objects.<strong><br />
</strong></p>
<p>iReport is a visual reporting tool for creating JasperReports which frees you from having to muck with the JasperReports jrxml files. It's free and so far seems pretty decent.</p>
<p>Open it up, and go to the <em>File menu > New Document</em>.  I created a document called <strong>'master'</strong> which will generate a <strong>master.jrxml</strong> file for you. Use the '<strong>Static Tool</strong>' button in the toolbar to add some text to the detail band.</p>
<p>To embed a subreport, Go to <em>Edit menu > Insert Element > Subreport</em> and then clicked on a spot in the detail band.  This will bring up the Subreport wizard.  Choose to create new subreport and accept all the defaults.</p>
<p>Back in the IDE, you need to write some code to compile the jrxml files.
<div class="syntax_hilite">
<div id="java-4">
<div class="java"><span style="color: #808080; font-style: italic;">// compile master report</span><br />
JasperReport jasperReport = JasperCompileManager.<span style="color: #006600;">compileReport</span><span style="color: #66cc66;">&#40;</span><br />
<span style="color: #ff0000;">"reports/master.jrxml"</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #808080; font-style: italic;">// compile subreport</span><br />
JasperReport subReport = JasperCompileManager.<span style="color: #006600;">compileReport</span><span style="color: #66cc66;">&#40;</span><br />
<span style="color: #ff0000;">"reports/subreport.jrxml"</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>There are two parameters to pass in, the subreport and a datasource.  In this example we are using a <em>net.sf.jasperreports.engine.data.JRBeanArrayDataSource</em> object which accepts an array of JavaBean objects.</p>
<div class="syntax_hilite">
<div id="java-5">
<div class="java"><a href="http://www.google.com/search?q=allinurl%3AMap+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Map</span></a> parameters = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AHashMap+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">HashMap</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
parameters.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"subreport"</span>, subReport<span style="color: #66cc66;">&#41;</span>;</p>
<p>PersonBean<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> people = <span style="color: #000000; font-weight: bold;">new</span> PersonBean<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">new</span> PersonBean<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Bob"</span>, <span style="color: #cc66cc;">21</span>, <span style="color: #ff0000;">"New York"</span><span style="color: #66cc66;">&#41;</span>,<br />
<span style="color: #000000; font-weight: bold;">new</span> PersonBean<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Chris"</span>, <span style="color: #cc66cc;">27</span>, <span style="color: #ff0000;">"California"</span><span style="color: #66cc66;">&#41;</span>,<br />
<span style="color: #000000; font-weight: bold;">new</span> PersonBean<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Sally"</span>, <span style="color: #cc66cc;">30</span>, <span style="color: #ff0000;">"Texas"</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#125;</span>;</p>
<p>JRBeanArrayDataSource ds = <span style="color: #000000; font-weight: bold;">new</span> JRBeanArrayDataSource<span style="color: #66cc66;">&#40;</span>people<span style="color: #66cc66;">&#41;</span>;<br />
parameters.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"subreportData"</span>, ds<span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>After that we fill the report and output the file to pdf.</p>
<div class="syntax_hilite">
<div id="java-6">
<div class="java">JasperPrint jasperPrint = JasperFillManager.<span style="color: #006600;">fillReport</span><span style="color: #66cc66;">&#40;</span>jasperReport,<br />
parameters, <span style="color: #000000; font-weight: bold;">new</span> JREmptyDataSource<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</p>
<p>JasperExportManager.<span style="color: #006600;">exportReportToPdfFile</span><span style="color: #66cc66;">&#40;</span>jasperPrint,<br />
<span style="color: #ff0000;">"reports/myreport.pdf"</span><span style="color: #66cc66;">&#41;</span>;</div>
</div>
</div>
<p></p>
<p>Now we go back to iReport and finish up our reports.  In our subreport, add a columnHeader band, and then add the three column titles (name, age, location) to it.  In the detail band, add the corresponding three fields (<strong>$F{name}</strong>, <strong>$F{age}</strong> and <strong>$F{location}</strong>.  Make sure you set the age field expression class to <em>java.lang.Integer</em> and declare fields (<em>View > Fields</em>).  You should have something similar to this:</p>
<p><img alt="iReports subreport" title="iReports subreport" src="http://boggy.digitbit.com/subreport.png" /></p>
<p>Switch to the master report, right click on the subreport image and select '<strong>Properties</strong>'.  In the Subreport tab, choose '<strong>Use datasource expression</strong>' in the combo  and input '<strong>$P{subreportData}</strong>' as your expression. Switch to the Subreport (other) tab, select '<strong>net.sf.jasperreports.engine.JasperReport</strong>' and input '<strong>$P{subreport}</strong>' as your expression.  These correspond to the two parameters we passed in above in the Java code.  Finally declare the two parameters (<em>View > Parameters</em>).</p>
<p>To actually generate the report, go back to your IDE and run the java code.  A sparkly new pdf awaits.
</p>
]]></content:encoded>
			<wfw:commentRss>http://boggy.digitbit.com/learning-jasperreports/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
