<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gilbert Adjin's Tech Blog</title>
	<atom:link href="http://gilbertadjin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gilbertadjin.wordpress.com</link>
	<description>Where Developers Meet (WDM)</description>
	<lastBuildDate>Thu, 31 Dec 2009 14:18:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='gilbertadjin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d00e673b9f649e0553813fc94887f5f9?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Gilbert Adjin's Tech Blog</title>
		<link>http://gilbertadjin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gilbertadjin.wordpress.com/osd.xml" title="Gilbert Adjin&#8217;s Tech Blog" />
		<item>
		<title>DEVELOPING YOUR TECHNICAL CAREER</title>
		<link>http://gilbertadjin.wordpress.com/2009/12/31/developing-your-technical-career/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/12/31/developing-your-technical-career/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:18:26 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Career Development]]></category>
		<category><![CDATA[agile coaching]]></category>
		<category><![CDATA[pragmatic bookshelf]]></category>
		<category><![CDATA[the passionate programmer]]></category>
		<category><![CDATA[The Pragmatic Programmer]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/12/31/developing-your-technical-career/</guid>
		<description><![CDATA[Hi developers or do i say hi programmers….., anyway hi all. One thing we have to know is that its not all about writing codes, testing application or doing the technical stuff that will help us improve our career. A lot is needed alongside;knowing how to mingle with your team, marketing your products; why don’t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=313&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi developers or do i say hi programmers….., anyway hi all. One thing we have to know is that its not all about writing codes, testing application or doing the technical stuff that will help us improve our career. A lot is needed alongside;knowing how to mingle with your team, marketing your products; why don’t you stop reading those technical books this holidays and try your hands on any of these books from the pragmatic bookshelf and I bet you will never regret it</p>
<p>Just ebay for these books.</p>
<p>1. practices-of-an-agile-developer-working-in-the-real-world-pragmatic-programmers.</p>
<p>2.the-passionate-programmer-creating-a-remarkable-career-in-software-development-pragmatic-life</p>
<p>3.agile-coaching</p>
<p>4.land-the-tech-job-you-love-pragmatic-life</p>
<p>5.The Pragmatic Programmer, From Journeyman To Master </p>
<p>Happy happy Xmas and prosperous new year. May the Lord Almighty help us to be wise, fair, and kind in all our affairs. Stay blessed </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/313/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=313&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/12/31/developing-your-technical-career/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>
	</item>
		<item>
		<title>CRYSTAL REPORT USING TABLES AS DATASOURCE</title>
		<link>http://gilbertadjin.wordpress.com/2009/12/12/crystal-report-using-tables-as-datasource/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/12/12/crystal-report-using-tables-as-datasource/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 12:46:17 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Java Links]]></category>
		<category><![CDATA[.net crystal reports with tables as datasource]]></category>
		<category><![CDATA[crystal reports first time]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[vs 2005 crystal reports 2005]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/12/12/crystal-report-using-tables-as-datasource/</guid>
		<description><![CDATA[Crystal reports can be created in .Net applications with different data sources including using tables, stored procedures, typed datasets and also without a data source.
In this article we are going through how to create a crystal report for the first time using database tables as the datasource.
1. You have to create your windows project in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=310&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Crystal reports can be created in .Net applications with different data sources including using tables, stored procedures, typed datasets and also without a data source.</p>
<p>In this article we are going through how to create a crystal report for the first time using database tables as the datasource.</p>
<p>1. You have to create your windows project in using VS 2005. After creating the project, right on then project name in the solution explorer, select “add” and then “add new” as shown below.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb.png?w=411&#038;h=235" width="411" height="235" /></a> </p>
<p>2. In the add new dialog box, select “crystal Report” and name it, and then click on the add button.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb1.png?w=419&#038;h=256" width="419" height="256" /></a></p>
<p>3. You will be presented with the “crystal report gallery” dialog, choose “using the report wizard” and click on ok</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb2.png?w=422&#038;h=201" width="422" height="201" /></a>&#160;</p>
<p>4.In the choose data source dialog, go to the “ Create New Connection” node and then select the “OLE DB(ADO)” sub node.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image3.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb3.png?w=439&#038;h=183" width="439" height="183" /></a> </p>
<p>4. You will then be required to provide the database connection information. Slect the “Microsoft OLE DB provider for SQL server” and click on the next button</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image4.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb4.png?w=447&#038;h=192" width="447" height="192" /></a> </p>
<p>5. Here you provide the database logon parameters</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image5.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb5.png?w=454&#038;h=239" width="454" height="239" /></a> </p>
<p>6. After successfully connecting to the database, you then select the table (s) you want to display its content on your report</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image6.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb6.png?w=458&#038;h=217" width="458" height="217" /></a> </p>
<p>6. After selecting the table(s) you select the actual columns you want to display<a href="http://gilbertadjin.files.wordpress.com/2009/12/image7.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb7.png?w=468&#038;h=217" width="468" height="217" /></a> </p>
<p>7. After choosing the columns you will display, you can click on next to choose the columns for grouping and then for filtering, and then finally you choose the format to display your report.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image8.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb8.png?w=479&#038;h=231" width="479" height="231" /></a> </p>
<p>8. After you have finished designing your report, you then drag a “crystal reports viewer” onto your form.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image9.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb9.png?w=478&#038;h=215" width="478" height="215" /></a> </p>
<p>Then create a code under the form load event to show your report on for load</p>
<p>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;create a new report document&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;and load the report from its source    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;use Application.StartupPath to get the address of your report fro deployment issues    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim rpd As New ReportDocument    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rpd.Load(&quot;C:\Gilbert\Personal\Projects\BlogPosts\BlogPosts\tableDS.rpt&quot;)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Me.CrystalReportViewer1.ReportSource = rpd    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; SetDBLogonForReport(rpd) </p>
<p>&#160;&#160;&#160; End Sub </p>
<p>&#160;&#160;&#160; &#8216;for deployment issues make sure the database paramaters are encrypted   <br />&#160;&#160;&#160; &#8216;and saved in the mysettings class</p>
<p>Private Sub SetDBLogonForReport(ByVal myReportDocument As ReportDocument)   <br />&#160;&#160;&#160;&#160;&#160;&#160; Dim myConnectionInfo As ConnectionInfo = New&#160;&#160; ConnectionInfo()    <br />&#160;&#160;&#160;&#160;&#160;&#160; myConnectionInfo.DatabaseName = &quot;datalinkDB&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160; myConnectionInfo.UserID = &quot;sa&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160; myConnectionInfo.Password = &quot;qwerty&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160; myConnectionInfo.ServerName = &quot;localhost&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160; myConnectionInfo.IntegratedSecurity = &quot;false&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160; Dim myTables As Tables = myReportDocument.Database.Tables    <br />&#160;&#160;&#160;&#160;&#160;&#160; For Each myTable As&#160; CrystalDecisions.CrystalReports.Engine.Table In myTables    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; myTableLogonInfo.ConnectionInfo = myConnectionInfo    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; myTable.ApplyLogOnInfo(myTableLogonInfo)    <br />&#160;&#160;&#160;&#160;&#160;&#160; Next    <br />&#160;&#160; End Sub</p>
<p>Below is a picture when the application is run</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/image10.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb10.png?w=557&#038;h=259" width="557" height="259" /></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=310&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/12/12/crystal-report-using-tables-as-datasource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>HIDING CONTROLS WHEN PRINTING WITH WINDOW.PRINT()</title>
		<link>http://gilbertadjin.wordpress.com/2009/12/05/hiding-controls-when-printing-with-window-print/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/12/05/hiding-controls-when-printing-with-window-print/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:22:09 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[.NET Links]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[hide controls when printing]]></category>
		<category><![CDATA[printing a window in asp.net]]></category>
		<category><![CDATA[printing in asp.net]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[windows.print]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/12/05/hiding-controls-when-printing-with-window-print/</guid>
		<description><![CDATA[Sometimes in web applications (ASP.NET) we prefer printing a window without some controls that appear on the interface. For example, printing a window by clicking on a print button without showing the print button on the printed document. In this example we are printing a student’s results without showing the Print and the close buttons.
To [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=286&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes in web applications (ASP.NET) we prefer printing a window without some controls that appear on the interface. For example, printing a window by clicking on a print button without showing the print button on the printed document. In this example we are printing a student’s results without showing the Print and the close buttons.</p>
<p>To start, we place the two control in a DIV control.Drag the “DIV” control from the HTML controls section. Name the DIV control by giving a value to ID property as shown below. Place the print and close button in the DIV control. </p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/clip_image002.jpg"><img style="display:inline;border-width:0;" title="clip_image002" border="0" alt="clip_image002" src="http://gilbertadjin.files.wordpress.com/2009/12/clip_image002_thumb.jpg?w=520&#038;h=343" width="520" height="343" /></a></p>
<p>Note that in creating ASP.NET applications, there are two types of source codes, the VB/C# source code and the HTML code. First we create a script to hide the DIV control as shown below. In the script below the “dv1” is the ID value of the DIV control</p>
<p>Add this script to the HTML source</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:114.16%;font-family:&#39;direction:ltr;height:158px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> &lt;script language=<span style="color:#006080;">&quot;javascript&quot;</span> type=<span style="color:#006080;">&quot;text/javascript&quot;</span>&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>    <span style="color:#0000ff;">function</span> hidePrint(){</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>     document.getElementById(<span style="color:#006080;">&quot;dv1&quot;</span>).style.display=<span style="color:#006080;">'none'</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>     window.print();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>     window.close();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>             }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> &lt;/script&gt;</pre>
<p><!--CRLF--></div>
</div>
<p>Note that the script should be in between the &lt;head&gt;&lt;/head&gt; tag of the html source code</p>
<p>Select the print button and go to the html source code and add the <strong>onclick</strong> property . The value of the onclick property should be the created javascript function (named hidePrint()). The button’s html code should look like the one below after the addition of the onclick property</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:130.59%;font-family:&#39;direction:ltr;height:109px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> &lt;input type=<span style="color:#006080;">&quot;button&quot;</span> id=<span style="color:#006080;">&quot;Button1&quot;</span> runat=<span style="color:#006080;">&quot;server&quot;</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> value=<span style="color:#006080;">&quot;Print&quot;</span> <span style="color:#0000ff;">class</span>=<span style="color:#006080;">&quot;fltbutton&quot;</span>  style=<span style="color:#006080;">&quot;width:60px&quot;</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> onclick=<span style="color:#006080;">&quot;javascript:hidePrint();&quot;</span> /&gt;</pre>
<p><!--CRLF--></div>
</div>
<p>This is all you have to do and you are good to go.</p>
<p>Below is a window showing the student’s results and the Print and the Close Button</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/clip_image004.jpg"><img style="display:inline;border-width:0;" title="clip_image004" border="0" alt="clip_image004" src="http://gilbertadjin.files.wordpress.com/2009/12/clip_image004_thumb.jpg?w=543&#038;h=286" width="543" height="286" /></a></p>
<p>What is printed after clicking on the “print” button</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/12/clip_image006.jpg"><img style="display:inline;border-width:0;" title="clip_image006" border="0" alt="clip_image006" src="http://gilbertadjin.files.wordpress.com/2009/12/clip_image006_thumb.jpg?w=546&#038;h=297" width="546" height="297" /></a></p>
<p>Cheers!!!!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=286&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/12/05/hiding-controls-when-printing-with-window-print/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/clip_image002_thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/clip_image004_thumb.jpg" medium="image">
			<media:title type="html">clip_image004</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/12/clip_image006_thumb.jpg" medium="image">
			<media:title type="html">clip_image006</media:title>
		</media:content>
	</item>
		<item>
		<title>REPORTING WITH PRINTDOCUMENT IN .NET</title>
		<link>http://gilbertadjin.wordpress.com/2009/11/28/reporting-with-printdocument-in-net/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/11/28/reporting-with-printdocument-in-net/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 12:17:34 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[.NET Links]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[creating reports in .net]]></category>
		<category><![CDATA[Printdocument]]></category>
		<category><![CDATA[reporting with printdocument]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/11/28/reporting-with-printdocument-in-net/</guid>
		<description><![CDATA[Due to flexibility in creating reports with some tools in the .NET framework , using PrintDocument() class in creating reports is fading out. But sometimes you don&#8217;t have a choice but to use it. For instance creating reports without any predefined data source or generating reports where needed columns are determined at runtime. 

In this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=269&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Due to flexibility in creating reports with some tools in the .NET framework , using PrintDocument() class in creating reports is fading out. But sometimes you don&#8217;t have a choice but to use it. For instance creating reports without any predefined data source or generating reports where needed columns are determined at runtime. </p>
</p>
<p>In this post we will go through creating a report using the PrintDocument. Our datasoure will also come from a listview which contains a list of file types and their sizes from an indexed drive. When using the report document everything is drawn to the report interface, thus you draw a string, an image,a line. the difficulty in here also is, you yourself determine at runtime where your text, lines and images should be positioned</p>
<p>To start with, first drag a PrintPreviewDialog control on your form. The control is named “PrintPreview1”.</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image3.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb3.png?w=412&#038;h=170" width="412" height="170" /></a> </p>
<p>Then go to the code view and create&#160; your procedure below.</p>
<p>Private Sub detaildisksreport_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim linesPerPage As Single = 0    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim yPos As Single = 0    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Static count As Integer = 0    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim x, y, c, i As Integer    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim leftMargin As Single = e.MarginBounds.Left    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim topMargin As Single = e.MarginBounds.Top </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;declaring fonts to use in your reports   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim backFont As New Font(&quot;Arial&quot;, 10, FontStyle.Italic)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim HeaderFont As New Font(&quot;Arial&quot;, 20, FontStyle.Bold)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim normfont As New Font(&quot;Times New Roman&quot;, 18, FontStyle.Regular) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216; Calculate the number of lines per page.   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; linesPerPage = e.MarginBounds.Height / normfont.GetHeight(e.Graphics) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;x determines the horizontal positions whiles y determines the vertical position </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216; Drawing an image on top of the report   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim b As Rectangle    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim pic As New Rectangle(40, 5, pic1.Width + 40, pic1.Height + 40)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawImage(pic1.Image, pic) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;drawing a line around the image   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; b = New Rectangle(40, 5, pic1.Width + 40, pic1.Height + 40)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawRectangle(Pens.Black, b) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; linesPerPage = e.MarginBounds.Height / normfont.GetHeight(e.Graphics)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; linesPerPage = linesPerPage &#8211; 5 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216; Drawing our report titles   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 190    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; y = pic1.Height + 70 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot;DETAIL DRIVE REPORT&quot;, HeaderFont, Brushes.Black, x, y) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; y += 40   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 25    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot; FOLDERS ON DRIVE :&#160; &quot; &amp; Me.cmbCat.SelectedItem.ToString.ToUpper, HeaderFont, Brushes.Black, x, y)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; y += 40    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 10    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot;REPORT GENERATED ON &quot; &amp; Now.ToLongDateString.ToUpper, HeaderFont, Brushes.Black, x, y)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; y += 10    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 5 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawLine(Pens.Black, 5, y + 30, 820, y + 30)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 10    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; y += 60    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; c = y </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot;FOLDER NAME&quot;, HeaderFont, Brushes.Blue, x, y)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x += 260 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot;NUMBER OF FILES&quot;, HeaderFont, Brushes.Blue, x, y)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; x += 330 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(&quot;FOLDER SIZE&quot;, HeaderFont, Brushes.Blue, x, y) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawLine(Pens.Black, 5, y + 30, 820, y + 30) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 33   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; y = c + 40 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; i = 0   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;adding the content to the report    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; For i = count To Me.LsvCDs.Items.Count &#8211; 1 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim len As Integer   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If LsvCDs.Items.Item(i).SubItems(0).Text.Length &gt; 25 Then    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; len = 25    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Else    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; len = LsvCDs.Items.Item(i).SubItems(0).Text.Length    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; End If </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawImage(Me.SmallImages.Images(0), 15, y + 2) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(Me.LsvCDs.Items.Item(i).SubItems(0).Text.Substring(0, len), normfont, Brushes.Blue, x, y)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x += 400    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(Me.LsvCDs.Items.Item(i).SubItems(1).Text, normfont, Brushes.Blue, x, y)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x += 220    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.Graphics.DrawString(Me.LsvCDs.Items.Item(i).SubItems(2).Text, normfont, Brushes.Blue, x, y) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8217;setting the y value to point to the next line   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;reseting the x value to the margin    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; y += 30    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = 33 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;checking to see if the current page is full   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If y + normfont.Height &gt; e.PageSettings.PaperSize.Height Then    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; count = i + 1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.HasMorePages = True    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Return </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; End If   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Next </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; count = 0   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.HasMorePages = False    <br />&#160;&#160;&#160; End Sub</p>
</p>
<p>Also add the code below to a button click event and you are good to go.</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">Dim</span> pd <span style="color:#0000ff;">As</span> <span style="color:#0000ff;">New</span> PrintDocument()</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#008000;">'adding the print method created to the printdocument printpage event</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">AddHandler</span> pd.PrintPage, <span style="color:#0000ff;">AddressOf</span> disksreport_PrintPage</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#008000;">'passing the print doucument to the PrintPreviewDialog</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span> PrintPreview1.Document = pd</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> PrintPreview1.ShowDialog()</pre>
<p><!--CRLF--></div>
</div>
<p>Below are sample interfaces, using printDocument to generate reports</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image4.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb4.png?w=433&#038;h=220" width="433" height="220" /></a> </p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image5.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb5.png?w=432&#038;h=191" width="432" height="191" /></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/269/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=269&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/11/28/reporting-with-printdocument-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>TABLEMODEL AS DATASOURCE IN JASPER REPORTS</title>
		<link>http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 14:05:30 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Java Links]]></category>
		<category><![CDATA[if conditions in jasper reports]]></category>
		<category><![CDATA[ireport]]></category>
		<category><![CDATA[J2SE]]></category>
		<category><![CDATA[jasper reports]]></category>
		<category><![CDATA[jasperviewer]]></category>
		<category><![CDATA[tablemodels as datasource]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/</guid>
		<description><![CDATA[It is a common requirement in many J2SE (client,swing) applications to present data in a tabular way and also print this tabular format as a report.
Jasper reports provides implementation that makes the task of generating reports from tabular formats simple in Swing   applications. In this demonstrations, we will be using Jasper reports 3.6.1, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=256&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It is a common requirement in many J2SE (client,swing) applications to present data in a tabular way and also print this tabular format as a report.</p>
<p>Jasper reports provides implementation that makes the task of generating reports from tabular formats simple in Swing   <br />applications. In this demonstrations, we will be using Jasper reports 3.6.1, Netbeans 6.1 and Ireport 3.6.1.</p>
<p>Let start by designing our report. In generating reports from tablemodels the report fields must match the column names of the tablemodel, but sometimes it becomes impractical to use the actual column names as report fields. Jasper Reports provides a way to generate reports from TableModels without having to map the actual table columns to the report fields. We can name our   <br />report fields COLUMN_X, where x is the column index, starting with zero. Note “COLUMN” all characters should be capitals as “column” will give you error message at run time.</p>
<p>Also in case you have 3 columns in your table and you define a report field “COLUMN_4” , which is for column 5, null values will be displayed for each row in the report under that field. To prevent null values from displaying in a text field you can edit the expression for that field e.g. (($F{COLUMN_4}==null)? &quot;&quot;:$F{COLUMN_4}.toString()), which means if the if the value of $F{COLUMN_4} is null ,display nothing else display the value. To do this, right click the text field and select “edit expression”, an expression editor will pop up for you to change the expression.</p>
<p>Below is a picture of our report at design time</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb2.png?w=406&#038;h=236" width="406" height="236" /></a> </p>
<p>After creating our report, we go to our application (using Netbeans as the IDE), we add a JTable and a JButton to our JFrame. We the create a method which accepts&#160; the table model to create the report, tbProducts is the name of the Jtable. Check <a title="http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/" href="http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/">http://gilbertadjin.wordpress.com/2009/05/05/populating-a-jtable-with-a-collection-list/</a> to see how to populate a list of javabean object to a Jtable</p>
<p>private void <strong>generateReports</strong>(String name, Map param) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; try { </p>
<blockquote><p>&#160;&#160;&#160;&#160;&#160; String source = &quot;C:/sabonay/jasperreports/&quot; + name + &quot;.jrxml&quot;;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (new File(source).exists() == false) {      <br />&#160;&#160;&#160;&#160;&#160; xputils.showMessage(&quot;Please go to setting and Choose report Source&quot;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </p>
</blockquote>
<blockquote><p> JasperReport jasperReport = JasperCompileManager.compileReport(source);     <br /> JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, <strong>new JRTableModelDataSource(tbProducts.getModel()));</strong> </p>
</blockquote>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JasperViewer.viewReport(jasperPrint, false); </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (Exception e) {   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(&quot;reports Error&#160; &quot; + e.toString()); </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>Cheers !!!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=256&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/11/22/tablemodel-as-datasource-in-jasper-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>LOAD IMAGES DYNAMICALLY INTO JASPER REPORTS</title>
		<link>http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 11:38:00 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Java Links]]></category>
		<category><![CDATA[connecting jasper reports to a java application]]></category>
		<category><![CDATA[how to close japer reports without closing java application]]></category>
		<category><![CDATA[image as parameter in jasper reports]]></category>
		<category><![CDATA[insert images into jasper reports at runtime]]></category>
		<category><![CDATA[ireport]]></category>
		<category><![CDATA[J2SE]]></category>
		<category><![CDATA[jasper reports]]></category>
		<category><![CDATA[jasper reports without a datasource]]></category>
		<category><![CDATA[NETBEANS]]></category>
		<category><![CDATA[pictures in jasper reports]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/</guid>
		<description><![CDATA[If you want to insert images from the file system (e.g. C:\images folder) into jasper reports at runtime, for example changing a logo depending on user selection or simply allowing the user to browse for his or her image to be displayed&#160; in the report then here is a simple process of doing that.
Let start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=252&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you want to insert images from the file system (e.g. C:\images folder) into jasper reports at runtime, for example changing a logo depending on user selection or simply allowing the user to browse for his or her image to be displayed&#160; in the report then here is a simple process of doing that.</p>
<p>Let start with the report design using ireport. In this instance the picture will be passed to the report as a parameter.</p>
<p>So let’s create a parameter in our report and call it “photo”</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb.png?w=367&#038;h=210" width="367" height="210" /></a> </p>
<p>As shown in the picture above, the data type of our parameter should be “java.lang.Object”</p>
<p>After this, drag the image , from the tool bar, on to your report.Right click on the image and choose “Properties” from the menu</p>
<p><a href="http://gilbertadjin.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb1.png?w=343&#038;h=203" width="343" height="203" /></a> </p>
</p>
<p>Under the image tab of the dialog box, make sure you select “java.awt.image” for the Image Expression Class. Once this is done, you are done with the report design</p>
<p>Lets go to netbeans , do some coding and connect our designed report to a java application.</p>
<p>First we need to declare a variable of type image,</p>
<p>Image photo;</p>
<p>Also we create a method , which on click of a button, loads a picture from the file system and initializes the “photo: variable.</p>
<p>JFileChooser fc = new JFileChooser();</p>
<p>private void getPicture() {</p>
<p>fc.setFileFilter(new FileNameExtensionFilter(&quot;Images&quot;, &quot;jpg&quot;, &quot;gif&quot;, &quot;bmp&quot;));</p>
<p>if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {</p>
<p>fc.setCurrentDirectory(fc.getCurrentDirectory());</p>
<p>ImageIcon icon = new ImageIcon(fc.getSelectedFile().getAbsolutePath());</p>
<p>icon = new ImageIcon(icon.getImage().getScaledInstance(350, 350, Image.SCALE_DEFAULT));</p>
<p>photo = icon.getImage();</p>
<p>}</p>
<p>After getting our picture, create an instance of the Map class and pass our “variable” as a parameter.</p>
<p>Map&lt;String, Object&gt; param = new HashMap&lt;String, Object&gt;();</p>
<p>param.put(&quot;photo&quot;, photo); //the “photo” should be the same name as the parameter name in our report</p>
<p>We then create a method that passes our created parameter to the report and we are done. below is the method that does the job.</p>
<p>private void generateReports(String name, Map param) {</p>
<p>try {</p>
<p>String source = &quot;C:/sabonay/jasperreports/&quot; + name + &quot;.jrxml&quot;;</p>
<p>if (new File(source).exists() == false) {</p>
<p>xputils.showMessage(&quot;Please&#160; report Source does not exist&quot;);</p>
<p>return;</p>
<p>}</p>
<p>JasperReport jasperReport = JasperCompileManager.compileReport(source);</p>
<p>JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, param, new <b>JREmptyDataSource()</b>);</p>
<p>JasperViewer.viewReport(jasperPrint, false);</p>
<p>//the false parameter makes sure the application does not close on closing the report</p>
<p>} catch (Exception e) {</p>
<p>System.out.println(&quot;reports Error &quot; + e.toString());</p>
<p>}}</p>
<p>Make sure to reference the necessary jasper jar files in your application</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=252&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/11/13/load-images-dynamically-into-jasper-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/11/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>STRINGS IN JAVA</title>
		<link>http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 08:30:00 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Java Links]]></category>
		<category><![CDATA[Convert strings to byte array]]></category>
		<category><![CDATA[converting bytes arrays to string]]></category>
		<category><![CDATA[converting char arrays to strings]]></category>
		<category><![CDATA[J2SE]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/</guid>
		<description><![CDATA[“Wow !!!! Now Thus Intereeessssting” That was how i exclaimed when i saw these interesting features of the STRING class in java. All this while when i wanted to convert a character array to a string , i had to go through a loop. For example
String password = “” ;
char[] pass = this.txtPassword.getPassword();
for (int i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=233&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>“Wow !!!! Now Thus Intereeessssting” That was how i exclaimed when i saw these interesting features of the STRING class in java. All this while when i wanted to convert a character array to a string , i had to go through a loop. For example</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>String password = “” ;<br />
char[] pass = this.txtPassword.getPassword();<br />
for (int i = 0; i &lt; pass.length; i++) {<br />
password = password + pass[i];<br />
}</strong></span></p>
<p>But this char[] pass can easily be converted to string by just a line of code:</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>char[] pass = this.txtPassword.getPassword();<br />
String password=new String(pass);</strong></span></p>
<p>Also another interesting feature of the string class is that you can easily get the string value out of a byte array and vice versa with so much ease. check this.</p>
<p><span style="color:#0000ff;font-size:x-small;"><strong>byte[] array=&#8221;sdfdfd&#8221;.getBytes();<br />
String string=new String(array);</strong></span></p>
<p>These are not all, there are more interesting features, exploree!!!!</p>
<p>Fellows, enjoy the weekend</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=233&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/10/30/strings-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>
	</item>
		<item>
		<title>FORM.SHOWDIALOG() IN JAVA</title>
		<link>http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 16:35:24 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[Java Links]]></category>
		<category><![CDATA[form.show implementation]]></category>
		<category><![CDATA[J2SE]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[jdialog]]></category>
		<category><![CDATA[jpanel]]></category>
		<category><![CDATA[jpanels]]></category>
		<category><![CDATA[NETBEANS]]></category>
		<category><![CDATA[Netbeans 6.7]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/</guid>
		<description><![CDATA[Have you wondered how to show a panel(form) as a dialog in java applications  as done in .NET applications by using the form.showDialog() method?  For example, when a user selects “Add New” from a Customer combobox, the customer panel shows as a dialog for a new entry before the user can continue. If you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=227&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Have you wondered how to show a panel(form) as a dialog in java applications  as done in .NET applications by using the form.showDialog() method?  For example, when a user selects “Add New” from a Customer combobox, the customer panel shows as a dialog for a new entry before the user can continue. If you have been searching for this, here is your stop.</p>
<p>We will be making use of one JDialog, and your FORMS(JPanels in this sense).</p>
<p>To implement this add a JDialog to your application. Declare a variable contentPane and add the constructor like the one specified below.</p>
<p><span style="color:#000000;font-size:small;"><strong>private Container contentPane = null;</strong></span></p>
<p><span style="color:#000000;font-size:small;"><strong>public popupsjdialog(java.awt.Frame parent, JPanel panel, boolean modal) {<br />
//super(parent, modal);<br />
contentPane = this.getContentPane();<br />
initComponents();<br />
this.setSize(panel.getSize().width + 30, panel.getSize().width + 50);<br />
panel.setLocation(10, 30);<br />
contentPane.add(panel);<br />
repaint();<br />
this.setLocationRelativeTo(null); </strong></span></p>
<p><span style="color:#000000;font-size:small;"><strong> } </strong></span></p>
<p>Your are now done. Now to show any JPanel as a dialog add the following code to your event.</p>
<p><strong><span style="font-size:small;">helpdetailpanel hd = new helpdetailpanel(helpContent);<br />
hd.setSize(700, 700);<br />
popupsjdialog d = new popupsjdialog(null, hd, true);<br />
d.setVisible(true);</span></strong></p>
<p>Helpdetailpanel is a Jpanel (form) you want to show as a dialog and the popupsjdialog is an instance of the Jdialog we created its constructot above.</p>
<p>Cheers !!!!!!!!!!!!!!!!!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=227&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/10/21/form-showdialog-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>
	</item>
		<item>
		<title>DEPLOYING ASP.NET APPS USING IIS 7</title>
		<link>http://gilbertadjin.wordpress.com/2009/10/10/deploying-asp-net-apps-using-iis-7/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/10/10/deploying-asp-net-apps-using-iis-7/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:00:48 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[.NET Links]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis 7]]></category>
		<category><![CDATA[VS 2005]]></category>
		<category><![CDATA[windows vista]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/10/10/deploting-asp-net-apps-using-iis-7/</guid>
		<description><![CDATA[You have finished developing your ASP.net application using VS 2005 in Windows Vista environment and you need to deploy, just go ahead and deploy in the vista environment, you do not have to look for Windows XP before you can do this. Here are few steps to follow to deploy your application using IIS 7 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=219&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You have finished developing your ASP.net application using VS 2005 in Windows Vista environment and you need to deploy, just go ahead and deploy in the vista environment, you do not have to look for Windows XP before you can do this. Here are few steps to follow to deploy your application using IIS 7 .</p>
<ol>
<li>
<div>First make sure all the components of the IIS server is installed on your system. To do this, Go to Start &gt; Control Panel &gt;Programs and Features and the click on the &#8220;Turn Windows features on or off&#8221; on the left task pane of the window as shown below.</div>
<p><img src="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas1.png" alt="" /></li>
<li>
<div>On the windows feature dialog box that pops up, make sure the Internet Information Service node and all its child nodes are checked as shown below or else get your original Windows Vista CD, <strong>check all the nodes</strong> and install these features.</div>
<p><img src="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas2.png" alt="" /></li>
<li>
<div>To access the IIS Manager after the installation, Go to Start&gt;Control Panel&gt;Administrative Tools &gt;Internet Information Services (IIS) Manager or go to run (Window Key + R) and enter &#8220;inetmgr&#8221; and you will get an interface like the one below.</div>
<p><img src="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas3.png" alt="" /></li>
<li>
<div>Now we are good to go on and deploy our ASP.Net Web Application. Navigate to the Default Web Site Node, then right click on it and choose &#8220;Add Application&#8221; from the context menu. A dialog box will pop up as shown below. The alias is the name of your website, for example if you enter Ghana, or accra , or kumasi, when accessing your website from your local computer, you will be typing &#8220;localhost/Ghana, or localhost/accra, or localhost/Kumasi&#8221;</div>
<p><img src="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas4.png" alt="" /></p>
<p>Click on the &#8220;Physical path:&#8221; button to browse for the website folder of your application and click on the &#8220;OK&#8221; button.</li>
<li>
<div>A new node with the name you entered in the alias textbox will appear under the &#8220;Default Web Site&#8221; node. Select the node, and make sure your connection string, default documents are set to the required values. The picture below clarify these</div>
<p><img src="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas5.png" alt="" /></li>
<li>After making the required changes, you are done. Make sure your IIS server is running (you can check this by clicking on the &#8220;Default Web Site&#8221; node and on the right task pane, under manage web site, make sure the &#8220;star&#8221; link is disabled else click on it to start the server). Go to your browser and enter your URL, in this case &#8220;http://localhost/ghana&#8221; or right click your application from IIS GUI and select browse.</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=219&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/10/10/deploying-asp-net-apps-using-iis-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas1.png" medium="image" />

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas2.png" medium="image" />

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas3.png" medium="image" />

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas4.png" medium="image" />

		<media:content url="http://gilbertadjin.files.wordpress.com/2009/10/101009_2000_deplotingas5.png" medium="image" />
	</item>
		<item>
		<title>EXPORTING THE CONTENT OF A DATASOURCE INTO EXCEL</title>
		<link>http://gilbertadjin.wordpress.com/2009/10/04/exporting-the-content-of-a-datasource-into-excel/</link>
		<comments>http://gilbertadjin.wordpress.com/2009/10/04/exporting-the-content-of-a-datasource-into-excel/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 12:48:36 +0000</pubDate>
		<dc:creator>Gilbert Adjin Frimpong</dc:creator>
				<category><![CDATA[.NET Links]]></category>
		<category><![CDATA[arrays into excel using vb.net]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[exporting the content of a datagrid into excel]]></category>
		<category><![CDATA[Ghana]]></category>
		<category><![CDATA[KNUST]]></category>
		<category><![CDATA[late binding to excel objects]]></category>
		<category><![CDATA[writing to excel using vb.net]]></category>

		<guid isPermaLink="false">http://gilbertadjin.wordpress.com/2009/10/04/exporting-the-content-of-a-datasource-into-excel/</guid>
		<description><![CDATA[Hi fellows, this post is about exporting the content of your data source (dataset, data table, data grid) into MS-Excel using VB.NET. All you need to is to read the data from your data source into a 2-dimensional array and then send the content straight to excel. With this you don&#8217;t have to be adding [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=206&subd=gilbertadjin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi fellows, this post is about exporting the content of your data source (dataset, data table, data grid) into MS-Excel using VB.NET. All you need to is to read the data from your data source into a 2-dimensional array and then send the content straight to excel. With this you don&#8217;t have to be adding rows to excel one after the other.</p>
<p>Let’s start, we have a data table called “dsstudents” with 5 columns “IndexNo, Name, Year Group, Program, Gender”. We then declare a variable Private Students(,) As String as our 2-dimensional array. We are then ready to go (code). Note that we are using late binding to the excel objects here, thus we are not referencing the excel object at the design time but it’s done in runtime.</p>
<p>Below are two methods that will get the job done. Cheers!!!!</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><a>Private</a></span><a><span style="color:blue;"> Sub</span> readContent()</a><a> <span style="color:blue;"> </span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">If</span> <span style="color:blue;">Me</span>.dsStudent.Rows.Count &gt; 0 <span style="color:blue;">Then<br />
</span><span style="color:blue;">ReDim</span><span style="color:blue;"> Me</span>.courses(<span style="color:blue;">Me</span>.dsStudent.Rows.Count + 2, 7)</a><a></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">For</span> i <span style="color:blue;">As</span><span style="color:blue;"> Integer</span> = 0 <span style="color:blue;">To</span><br />
<span style="color:blue;">Me</span>.dsStudent.Rows.Count &#8211; 1<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:green;">&#8217;setting the column headers for each column<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(0, 0) = <span style="color:maroon;">&#8220;Index No&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(0, 1) = <span style="color:maroon;">&#8220;Students&#8217; Name&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(0, 5) = <span style="color:maroon;">&#8220;Year group&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(0, 6) = <span style="color:maroon;">&#8220;Program Name&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(0, 11) = <span style="color:maroon;">&#8220;Student Gender&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:green;">&#8216;getting the actual content from our datasource<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(i + 2, 0) = <span style="color:blue;">Me</span>.dsStudent.Rows(i)(0).ToString<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(i + 2, 1) = <span style="color:blue;">Me</span>.dsStudent.Rows(i)(1).ToString<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(i + 2, 3) = <span style="color:blue;">Me</span>.dsStudent.Rows(i)(2).ToString<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(i + 2, 4) = <span style="color:blue;">Me</span>.dsStudent.Rows(i)(3).ToString<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> students(i + 2, 5) = <span style="color:blue;">Me</span>.dsStudent.Rows(i)(4).ToString<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">Next<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> createExcel()<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">End</span><span style="color:blue;"> If<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">End</span><span style="color:blue;"> Sub<br />
</span></a></span></p>
<p><a>The implementation of the createExcel() method<span style="color:blue;font-family:Courier New;font-size:10pt;"><br />
</span></a></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><a>Private</a></span><a><span style="color:blue;"> Sub</span> createExcel()<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">Dim</span> oExcel <span style="color:blue;">As</span><span style="color:blue;"> Object<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">Dim</span> oBook <span style="color:blue;">As</span><span style="color:blue;"> Object<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:blue;">Dim</span> oSheet <span style="color:blue;">As</span> <span style="color:blue;">Object<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a>&#8216;Start a new workbook in Excel.<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oExcel = CreateObject(<span style="color:maroon;">&#8220;Excel.Application&#8221;</span>)<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oBook = oExcel.Workbooks.Add<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:green;">&#8216;Add headers to the worksheet on row 1.<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oSheet = oBook.Worksheets(1)<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oSheet.Range(<span style="color:maroon;">&#8220;c1&#8243;</span>).Value = <span style="color:maroon;">&#8220;EXPORTING DATASOURCE CONTENT INTO EXCEL&#8221;<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a><span style="color:green;">&#8216;Sending the data to Excel by specifying where to start from (cell) and the rows and &#8216;columns need.</span><br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oSheet.Range(<span style="color:maroon;">&#8220;B8&#8243;</span>).Resize(<span style="color:blue;">Me</span>.dsStudent.Rows.Count + 2, 7).Value = <span style="color:blue;">Me</span>.setudent<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oExcel.visible = <span style="color:blue;">True<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oSheet = <span style="color:blue;">Nothing<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oBook = <span style="color:blue;">Nothing<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oExcel.quit()<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> oExcel = <span style="color:blue;">Nothing<br />
</span></a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><a> GC.Collect()<br />
</a></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"><a>End</a></span><a><span style="color:blue;"> Sub</span></a></span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gilbertadjin.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gilbertadjin.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gilbertadjin.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gilbertadjin.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gilbertadjin.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gilbertadjin.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gilbertadjin.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gilbertadjin.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gilbertadjin.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gilbertadjin.wordpress.com/206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gilbertadjin.wordpress.com&blog=6863530&post=206&subd=gilbertadjin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gilbertadjin.wordpress.com/2009/10/04/exporting-the-content-of-a-datasource-into-excel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dda317f32634767655bb6e94f3313d19?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gilbertadjin</media:title>
		</media:content>
	</item>
	</channel>
</rss>