<?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/"
	>

<channel>
	<title>Robyn's Emo Life</title>
	<atom:link href="http://www.balaraco.com/robyn/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.balaraco.com/robyn</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 22 Feb 2009 05:21:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An evening of Rockband</title>
		<link>http://www.balaraco.com/robyn/?p=47</link>
		<comments>http://www.balaraco.com/robyn/?p=47#comments</comments>
		<pubDate>Sun, 22 Feb 2009 05:21:04 +0000</pubDate>
		<dc:creator>kittymeow</dc:creator>
				<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.balaraco.com/robyn/?p=47</guid>
		<description><![CDATA[Hola everyone! Ryan and I were playing rockband and took some video. He posted them on his blog so go take a look here. Please don&#8217;t laugh&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Hola everyone! Ryan and I were playing rockband and took some video. He posted them on his blog so go take a look <a href="http://www.balaraco.com/?p=78#more-78">here</a>. Please don&#8217;t laugh&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balaraco.com/robyn/?feed=rss2&amp;p=47</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amusing Video</title>
		<link>http://www.balaraco.com/robyn/?p=42</link>
		<comments>http://www.balaraco.com/robyn/?p=42#comments</comments>
		<pubDate>Wed, 18 Feb 2009 04:13:31 +0000</pubDate>
		<dc:creator>kittymeow</dc:creator>
				<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.balaraco.com/robyn/?p=42</guid>
		<description><![CDATA[Hi Everyone! I bet you are all wondering why I haven&#8217;t posted in a while&#8230;well..that is because my life is boring and I don&#8217;t really have much to talk about.   So, instead of bore you all with my unamusing life, I present to you a highly amusing video from the TV show &#8220;The [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Everyone! I bet you are all wondering why I haven&#8217;t posted in a while&#8230;well..that is because my life is boring and I don&#8217;t really have much to talk about. <img src='http://www.balaraco.com/robyn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So, instead of bore you all with my unamusing life, I present to you a highly amusing video from the TV show &#8220;The Chasers War on Everything&#8221;. Enjoy&#8230;I know i did! <img src='http://www.balaraco.com/robyn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object width="480" height="295" data="http://www.youtube.com/v/O1LG_R9j2sw&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/O1LG_R9j2sw&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balaraco.com/robyn/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Valentine&#8217;s Day</title>
		<link>http://www.balaraco.com/robyn/?p=24</link>
		<comments>http://www.balaraco.com/robyn/?p=24#comments</comments>
		<pubDate>Sun, 15 Feb 2009 02:43:11 +0000</pubDate>
		<dc:creator>kittymeow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.balaraco.com/robyn/?p=24</guid>
		<description><![CDATA[Hola everyone! I really don&#8217;t have much to say so I will leave everyone with pictures of cute Alaskan malamute puppies! I hope Ryan buys me one!



]]></description>
			<content:encoded><![CDATA[<p>Hola everyone! I really don&#8217;t have much to say so I will leave everyone with pictures of cute Alaskan malamute puppies! I hope Ryan buys me one!<br />
<span id="more-24"></span><br />
<img class="aligncenter size-full wp-image-25" title="puppies!" src="http://www.balaraco.com/robyn/wp-content/uploads/2009/02/puppies1.jpg" alt="puppies!" width="450" height="338" /></p>
<p><img class="aligncenter size-full wp-image-26" title="Puppy!" src="http://www.balaraco.com/robyn/wp-content/uploads/2009/02/puppy2.jpg" alt="Puppy!" width="450" height="487" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balaraco.com/robyn/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generating PDFs in ASP.NET with C#</title>
		<link>http://www.balaraco.com/robyn/?p=8</link>
		<comments>http://www.balaraco.com/robyn/?p=8#comments</comments>
		<pubDate>Tue, 10 Feb 2009 03:29:14 +0000</pubDate>
		<dc:creator>kittymeow</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://www.balaraco.com/robyn/?p=8</guid>
		<description><![CDATA[Hola people! Enjoy some code   ASP.net is evil&#8230;


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;

public partial class newbusiness_display_NewBusinessAll : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
      [...]]]></description>
			<content:encoded><![CDATA[<p>Hola people! Enjoy some code <img src='http://www.balaraco.com/robyn/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ASP.net is evil&#8230;<span id="more-8"></span><br />
<span style="font-size: 9pt;">
<pre>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;

public partial class newbusiness_display_NewBusinessAll : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //get cookie value for name and admin status
            //If no cookie exists, redirect user to the login page
            if (Request.Cookies["UserInfo"] == null)
                Response.Redirect("login.aspx");

            //If the loggedIn value of the cookie is not true, redirect user to the login page
            if (Request.Cookies["UserInfo"]["loggedIn"] != "true")
                Response.Redirect("login.aspx");

            //Get cookie values
            string name = Request.Cookies["UserInfo"]["Name"].ToString();

	    //TODO: Validate Cookie Data

            createTable(name);
        }
        catch (Exception)
        {
            //Put error code here
        }
    }
    //Create PDF document with sql data written to a table
    protected void createTable(string value1)
    {
        try
        {
            int numColumns = 9; //Initialize the number of columns
            int count = 0;      //Initializa a counter
            double totalPremium = 0;    //Initialize the running total for the Premium

            MemoryStream m = new MemoryStream();    //Initialize a memory stream object

            //Create a landscape document with the specified margins (l,r, t, b)
            Document myDoc = new Document(PageSize.A4.Rotate(), 25, 25, 50, 20);    

            Response.ContentType = "application/pdf";   //Specify the content type of the document to be pdf
            PdfWriter.GetInstance(myDoc, m);    //Create an instance of the document

            //Create page footer
            Chunk myFooter = new Chunk(DateTime.Now.ToShortDateString() + "      " + "Page " + (myDoc.PageNumber + 1),
                FontFactory.GetFont(FontFactory.HELVETICA_OBLIQUE, 8, new Color(46, 84, 141)));
            HeaderFooter footer = new HeaderFooter(new Phrase(myFooter), false);    //Create a footer object with the chunk data
            footer.Border = Rectangle.NO_BORDER;    //Specify no border around the footer
            footer.Alignment = Element.ALIGN_RIGHT; //Specify the footer text alignment
            myDoc.Footer = footer;                  //Set the document's footer to the footer object

            myDoc.Open();   //Open the document

            string[] rowData = new string[9];   //Initialize a string array of 9 elements
            string[] headers = {"Department", "PRM", "Insured", "Company", "Effecive Date", "Line",
                                   "Premium", "Producer", "New/Rewrite"};   //Create an array for the column headers

            DataSet myDS = GetData(value1);   //Call GetData function to get a data set from the SQL database
            DataTableReader myReader = myDS.Tables["Records"].CreateDataReader();  //Create a data reader from the Records table from myDS

            PdfPTable dataTable = new PdfPTable(numColumns);    //Create a table with 9 columns
            dataTable.DefaultCell.Padding = 0;                  //Set table cell padding to zero
            float[] headerwidths = { 10, 15, 15, 13, 8, 10, 10, 10, 9 };     //Specify column widths (in percents)
            dataTable.SetWidths(headerwidths);                              //Set the widths for the columns
            dataTable.WidthPercentage = 100;        //Set the table width percentage to 100

            dataTable.DefaultCell.BorderWidth = 0;  //Specify no table border
            dataTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT; //Set cell text to left align

            //Loop thru the header array
            for (int i = 0; i &lt; numColumns; i++)
            {
                //Create a chunck and format the array element
                Chunk myData = new Chunk(headers[i], FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 11, new Color(46, 84, 141)));
                Phrase myPhrase = new Phrase(myData);   //Create a phrase from the chunk
                dataTable.AddCell(myPhrase);            //Insert phrase into table
                dataTable.DefaultCell.PaddingBottom = 10;   //Set the bottom cell padding to 10
            }
            dataTable.HeaderRows = 1;
            dataTable.DefaultCell.PaddingBottom = 3;    //Set the cell padding from now on to 3

            //While there are records in the dataset
            while (myReader.Read())
            {
                string name = myReader["LName"].ToString() + ", " + myReader["FName"].ToString();   //Format the insured's name
                DateTime myDate = DateTime.Parse(myReader["eDate"].ToString());     //Create a date abject
                string formattedDate = myDate.ToString("MM/dd/yy");             //Format the date
                totalPremium += Double.Parse(myReader["Premium"].ToString());       //Add premium amount to a running total

                //Alternate row colors
                if (count % 2 == 0)
                    dataTable.DefaultCell.BackgroundColor = new iTextSharp.text.Color(200, 213, 232);
                else
                    dataTable.DefaultCell.BackgroundColor = new iTextSharp.text.Color(255, 255, 255);

                //Add each record into an array
                rowData[0] = myReader["Department"].ToString();
                rowData[1] = myReader["PRM"].ToString();
                rowData[2] = name;
                rowData[3] = myReader["Company"].ToString();
                rowData[4] = formattedDate;
                rowData[5] = myReader["LOB"].ToString();
                rowData[6] = String.Format("{0:C}", myReader["Premium"]);
                rowData[7] = myReader["Producer"].ToString();
                rowData[8] = myReader["NR"].ToString();

                //Loop thru the array and write the contents to the table
                for (int j = 0; j &lt; numColumns; j++)
                    dataTable.AddCell(rowData[j]);
                count++;    //Increment the counter
            }
            //Add premium total to table
            Chunk myPremium = new Chunk("Total Sales: " + String.Format("{0:C}", totalPremium),
                FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 11, new Color(46, 84, 141)));   //Create chunk for formatting
            Phrase myTotalPremium = new Phrase(myPremium);  //Create Phrase from chunk
            dataTable.DefaultCell.Colspan = 9;  //Specify the row's colspan
            dataTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT;    //Specify text alignment
            dataTable.DefaultCell.PaddingTop = 10;  //Set the cell padding
            dataTable.DefaultCell.BackgroundColor = new iTextSharp.text.Color(255, 255, 255);   //Set the cell background color
            dataTable.AddCell(myTotalPremium);  //Add cell to table

            string reportTitle = "Personal Lines New Business Report";  //Create report title
            Chunk title = new Chunk(reportTitle, FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 14,
                new Color(46, 84, 141)));   //Format report title
            myDoc.Add(title);   //Add the title to the document
            myDoc.Add(new Paragraph(" "));  //Add a blank line to the document
            myDoc.Add(dataTable);   //Add the table to the document

            myDoc.Close();  //Close the document
            Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);    //Write the document to the output stream
            Response.OutputStream.Flush();  //Flush the output stream
            Response.OutputStream.Close();  //Close the output stream
        }
        catch (Exception)
        {
            //Put error code here
        }
    }
    //Returns a dataset from an MSSQL database
    protected DataSet GetData(string value1)
    {
        string errMsg = "";

        try
        {
            //SQL connection string
            SqlConnection conn = new SqlConnection("YourConnectionStringHere");

            //Open database connection
            conn.Open();
            string sql = "";

            sql = "SELECT * FROM TableName WHERE ColumnName = '" + value1 + "' ORDER BY ColumnName DESC";

            SqlCommand sqlQry = new SqlCommand(sql, conn);      //Create a SQL Command object
            sqlQry.CommandTimeout = 30;     //Set the timeout of the object

            //Create a Data Adapter
            SqlDataAdapter sqlDA = new SqlDataAdapter();
            sqlDA.SelectCommand = sqlQry;   //Select the SQL command for the data adapter

            //Create Data Set
            DataSet sqlDS = new DataSet();
            sqlDA.Fill(sqlDS, "Records");   //Fill the dataset with the table "Records"

            conn.Close();   //Close the DB connection

            return sqlDS;
        }
        catch (SqlException x)
        {
            //Put error code here
            return null;
        }
    }
}</pre>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balaraco.com/robyn/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOLA!!!</title>
		<link>http://www.balaraco.com/robyn/?p=3</link>
		<comments>http://www.balaraco.com/robyn/?p=3#comments</comments>
		<pubDate>Sun, 08 Feb 2009 03:10:16 +0000</pubDate>
		<dc:creator>kittymeow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.balaraco.com/robyn/?p=3</guid>
		<description><![CDATA[Hola everyone! Welcome to Robyn&#8217;s Emo Life! Ryan came up with the title&#8230;isn&#8217;t he nice&#8230; Just because I like blood, death, and destruction does not make me emo&#8230;    Well&#8230;I don&#8217;t really have much to say at the moment so I shall leave everyone with a humorous video Ryan showed me&#8230;Enjoy!

]]></description>
			<content:encoded><![CDATA[<p>Hola everyone! Welcome to Robyn&#8217;s Emo Life! Ryan came up with the title&#8230;isn&#8217;t he nice&#8230; Just because I like blood, death, and destruction does not make me emo&#8230; <img src='http://www.balaraco.com/robyn/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   Well&#8230;I don&#8217;t really have much to say at the moment so I shall leave everyone with a humorous video Ryan showed me&#8230;Enjoy!</p>
<p><object width="640" height="360" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1824771&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><param name="AllowScriptAccess" value="true" /><param name="src" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1824771&amp;fullscreen=1" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balaraco.com/robyn/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
