Click here to Skip to main content
6,595,444 members and growing! (14,828 online)
Email Password   helpLost your password?
Languages » C# » Applications     Intermediate

TaskLister 1.0a

By NinethSense

An article about builing a task tracker software.
C#.NET 2.0, Win2K, WinXPVS2005, Dev
Posted:25 May 2006
Views:21,508
Bookmarked:22 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
8 votes for this article.
Popularity: 2.87 Rating: 3.18 out of 5
1 vote, 12.5%
1
1 vote, 12.5%
2

3
1 vote, 12.5%
4
5 votes, 62.5%
5

Sample Image

Introduction

This piece of software can be used for the following:

  • Tracking the project work flow - a Task Lister.
  • Track the issues reported by the client.
  • Project estimation etc.

The features I have integrated, presently, are:

  • Export to HTML and Excel Worksheet.
  • Simple interface.
  • No database used - XML file for storing data.
  • Always-on-top feature.

Background

I was using an Excel sheet for a long time for tracking issues reported by the client. Once I got some free time, I made a small utility for this purpose. That means, I made this tool as per my requirements. Not sure how much this will be useful for you. Well, you can create more fields, features etc., if you wish. Also, if you suggest, I can make it for you.

Using the code

First, the application reads the TaskLister.xml file to a DataSet, and then it fills a DataGridView. The DataGridview gives the users option to add, remove, edit, set priority, set status etc.

ds.ReadXml(XMLfile);

dataGridView1.DataSource = ds.Tables["table1"];

For saving the data, a simple line is used:

ds.WriteXml(XMLfile, XmlWriteMode.WriteSchema);

Exporting to HTML and Excel Worksheets uses the below code - you can see here that the export to Excel is a trick...

private void exportToHTMLToolStripMenuItem_Click(object sender, EventArgs e)
{
    saveFileDialog1.Filter = 
      "HTML Files|*.htm*|Excel Worksheet files|*.xls";
    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
    {
      FileInfo fi = new FileInfo(saveFileDialog1.FileName);
      StreamWriter sw = fi.CreateText();
      sw.WriteLine("<html><head><title>" + 
                   "TaskLister Export</title>"); 
      sw.WriteLine("<style>th, td {border-bottom:solid 1px" + 
                   " brown;border-right:solid 1px brown;}" + 
                   " table {font:normal 12px arial}" + 
                   "</style></head><body>");
      sw.WriteLine("<table cellpadding=0 cellspacing=0 " + 
                   "style='border:solid 1px brown'>");
      sw.Write("<tr bgcolor='#FF9933'><th align='center' " + 
               "width='30px'>No.</th><th align='center' " + 
               "width='50px'>Priority</th><th align='center' " + 
               "width='100px'>Ref.</th><th align='center'" + 
               " width='250px'>Task</th><th align='center' " + 
               "width='70px'>Status</th><th align='center' " + 
               "width='30px'>Hrs.</th><th align='center' " + 
               "width='200px'>Comments</th></tr>");
      foreach (DataRow dr in ds.Tables["table1"].Rows)
      {
          sw.Write("<tr><td align='center'> " + dr[0] + 
                   "</td><td align='center'> " + dr[1] + 
                   "</td><td> " + dr[2] + 
                   "</td><td width='250px'> " + dr[3] + 
                   "</td><td align='center'> " + dr[4] + 
                   "</td><td width='30px'> " + dr[5] + 
                   "</td><td width='200px'> " + dr[6] + 
                   "</td></tr>");
      }
      sw.WriteLine("</table>");
      sw.WriteLine("<span style='font:italic 8px times new roman'>" + 
                   "Created with TaskLister1.0 from Praveen." + 
                   "</span></body></html>");
      sw.Close();
    }
}

History

This is the first version of my code.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

NinethSense


Member
Praveen.V.Nair - aka NinethSense - Microsoft MVP - is a person with an abnormal passion for technology. He has been playing with electronics from the age of 10 and with computers from the age of 14. He usually blogs at http://blog.ninethsense.com/.
Occupation: Architect
Company: PIT Solutions
Location: India India

Other popular C# articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh)FirstPrevNext
GeneralPort to VB.net Pinmembergnixon11:36 24 Mar '08  
GeneralRe: Port to VB.net PinmemberNinethSense19:53 24 Mar '08  
GeneralThanks! PinmemberLaurent Cozic12:57 13 Nov '07  
GeneralRe: Thanks! PinmemberNinethSense19:06 13 Nov '07  
QuestionXLS a trick? Pinmembersoulmaster888:27 17 Aug '07  
AnswerRe: XLS a trick? PinmemberNinethSense9:21 18 Aug '07  
AnswerUse DataGridView Extension PinmemberAlexander Alexandrov1:31 21 Aug '07  
GeneralRe: Use DataGridView Extension Pinmembersoulmaster887:19 22 Aug '07  
GeneralRe: Use DataGridView Extension PinmemberAlexander Alexandrov21:36 22 Aug '07  
GeneralThanks for checking my project PinmemberNinethSense0:46 29 May '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 25 May 2006
Editor: Smitha Vijayan
Copyright 2006 by NinethSense
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project