Horizontal Nav

Saturday, 21 June 2014

5 Essentials For Your Project Reports

Monitor your project with clear status reports.
#1: Major risks
List the top 3 risks to the project on your report. These should be the big risks that you want your sponsor to be aware of and perhaps even take action on. If you are expecting a decision about the best route forward or next steps then point this out on the report.

As risk status can change almost daily, talk to the risk owner before you prepare the report and make sure that you have all the details about the latest situation. You don't want to be reporting something that is out of date!
#2: Major issues
Include a list of the top 3 issues on the project and what you are doing about them. Again, if you need input from your project sponsor to help resolve them, be sure to mention it! Include the name of the person who is managing the issue (the issue owner) and the date by when you think the issue will be resolved.

#3: Progress summary
Sponsors are really interested in how much progress is being made so this is an important section. List the major project milestones and whether or not they have been achieved on the target dates. Don't try to include all your milestones: just pick the significant ones. If you haven't hit a milestone, make a note of the day you said you would achieve it along with the new forecasted date so you can see how significantly your plan has changed.

The scheduling features in ProjectManager.com will automatically show you any slippage or changes to the due dates for project tasks through an advanced suite of project reports. You can use this information in your status reports to save you time.
#4: Budget forecast
Another thing that sponsors want to know about is how much the project is costing and whether or not it is on track to spend more or less than you originally predicted. The status report is an opportunity to provide an early warning if the project looks like it is going to be over budget (or under budget, as the unspent money could be allocated to other work).

There's no need to provide lots of detail, just the high level figures of what you originally budgeted, how much has been spent to date and what you think the expenditure will be when the project is over.
#5: Status indicator
Make it easy for people to see if the project is going well with a Red/Yellow/Green status indicator. The traffic light colors highlight whether the project needs management attention (Red), is at risk of not hitting its targets (Yellow) or is progressing according to plan (Green).

The simplest way to display this information is by using a colored box at the top of the report. Type the word Red, Yellow or Green as well as using color in case your sponsor is looking at the report printed out in black and white!
A dashboard can pull all this information together in one place and use real-time updates from your project team. The more you can automate when it comes to project status reports, the less time it will take you to prepare the information every month. That's time you could be spending on other project tasks!
Use the dashboard and reporting features of ProjectManager.com to highlight progress and status. It automates the collection of data and makes your project's position really clear.

Monday, 16 June 2014

Display Marquees on ASP.Net Webpage

Introduction

In this article we will see how to display various marquees on an ASP.Net webpage. This article will explain the following things.

  1. Simple Marquee with text.
  2. Simple Marquee with controls in it.
  3. Dynamic Marquee Populated from database values.

Background
To make our ASP.Net web page very design effective we need to display some animation on the page. One of the animations can be done using a marquee in ASP.Net. We can scroll the text within specified area for that maximum developers use the login like using Ajax update panel, timer and in this cases every time we need the partial post back to server. But use of a marquee will not do any partial post back to the server and in a very simple manner we can show the scrolling text or images using marquee. So let's see how to display a marquee from basic level to advance level one-by-one.

Simple Marquee with Text
To display marquee HTML provide the <marquee></marquee> tag in which we can show any simple text or controls like hyperlinks, images etc. See the following piece of code used to show only simple marquee with text. One more thing about marquee is that they move in a given area, that means the controls (parent) they move.


<marquee><strong> Simple Marquee Text</strong></marquee>
Using this single line of code we are able to show the scrollable text on our ASP.Net web-page. Further we will see how to provide the direction to our marquee while the  previous example will create the marquee moving to the left direction which is default marquee direction.

To provide direction to our marquee we can use direction attribute in marquee. See the following lines which will move our marquee with left and right direction.

<div style="width: 927px; background-color: #FFFF00;">
   <marquee direction="left"><strong> Simple Marquee Text(Left Direction)</strong></marquee>
    </div>
    <div style="width: 927px; background-color: #CCFFCC;">
      <marquee direction="right"><strong> Simple Marquee Text(Right Direction)</strong></marquee>
   </div>

Simple Marquee with Controls
I think so up to now you understand how to show simple marquee with text. So let's move to show the marquee containing an ASP.Net control in it. See the following lines which contain hyperlink control and Image Control. 

<div style="background-color: #FFCCFF">
    <marquee direction="Up"><strong> <a href="#">Simple Marquee With Hyperlink In Up Direction</a></strong></marquee>
   </div>
    <div style="background-color: #CCCCFF">
    <marquee direction="down"><strong> <asp:Image ID="img" runat="server" ImageUrl="~/wait.gif"/></strong></marquee>
   </div>

In the previous two marquees we showed one hyperlink control with an up direction and one image control with a down direction.
Up to here we have seen a basic marquee with text and using controls. Now we will see some advanced marquees which populated from a database and when we take our mouse pointer over them they will stop and we move out of it, then again it will start working. 

Dynamic Marquee with Database
In so many cases we need to show some news for our application provided by the site administrator. The news can be dynamic every time new news occurs. That kind of news can be shown in a marquee. In the first example we will see the marquee which will move in up direction and second one which will move in down direction. For providing mouseover stop and start we have an attribute like:

onmouseover="this.stop()" onmouseout="this.start()"

In the above line "this" refers to the marquee on which we have given the attribute. See the full code below to populate the marquee from database and display it on the page.

<table>
<
tr>
<
td>
 <asp:Panel ID="Panel1" runat="server" BackColor="#FFFFCC" BorderStyle="Inset" 
            
BorderWidth="3" Width="454px" GroupingText="Dynamic Marquee From Database(Up Direction)">
 <marquee direction="up"  onmouseover="this.stop()" onmouseout="this.start()"
scrolldelay="100" style="height: 127px; width: 457px;">
<
asp:Literal ID="lt1" runat="server"></asp:Literal></marquee>
        </asp:Panel>
</
td>
<
td>
<
asp:Panel ID="Panel2" runat="server" BackColor="#CCFFCC" BorderStyle="Inset" 
            
BorderWidth="3" Width="454px" 
            
GroupingText="Dynamic Marquee From Database(Down Direction)">
 <marquee direction="down"  onmouseover="this.stop()" onmouseout="this.start()"
scrolldelay="100" style="height: 127px; width: 457px;">
<
asp:Literal ID="lt2" runat="server"></asp:Literal></marquee>
        </asp:Panel>
</
td>
</
tr>
   </table>

In the line of code shown above you can see we are using two panel controls and in which we are using a marquee with direction, onmouseover, onmousout, scrolldelay for some the speed of marquee if you want show that marquee must move slowly then increase the scrolldelay attribute from 100 to 200 or what it may be. In the same marquee you have seen that we are using a Literal control; this control we are using for displaying the text which we are binding to it from database. To bind the text to literal control use the  following code in the page load event.

protected void Page_Load(object sender, EventArgs e)
    {
        
DataSet ds1=obj.GetRecord();/*this obj is referring to some class in which GetRecord method is present which return the record from database. You can write your //own class and method.*/
        
string s1;
s1 = 
"<table><tr><td>";
for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
{
        s1 += 
"<a href=Somepage.aspx style=font-family: fantasy; font-size: large; font-weight:bold; font-style: normal; color: #660066>"+ds1.Tables[0].Rows[i][1].ToString()+"</a></td>";
    s1 += 
"<br/>";
}
s1 += 
"</tr></table>";
lt1.Text = s1.ToString();
lt2.Text = s1.ToString();
 }

In the code shown above you see that we are using one string s1 in which we first give a table row and then we are looping through the dataset object for every record and including it in s1 string with the hyperlink control and finally we bind that s1 to our literal control. 

Conclusion
From the explanation above I hope you understand the basic marquee creation and dynamic marquee populated from database. I hope this article will be helpful to you.

Thursday, 5 June 2014

StringBuilder Class in C#

Most of the programmer use string, as they are easy to use and provides effective interaction with the user. Every time we manipulate a string object we get a new string object created. 

String is immutable means that once it has been created, a string cannot be changed. No characters can be added or removed from it, nor can its length be changed.

The String object is immutable while StringBuilder object is mutable. Both String and StringBuilder are reference type. But String acts like a value type.
StringBuilder is located in the System.Text namespace. 

The following table lists the methods you can use to modify the contents of a StringBuilder.



The System.Text.StringBuilder class can be used when you want to modify a string without creating a new object. Using the StringBuilder class can boost performance when concatenating many strings together in a loop.


Method
Description
StringBuilder.Append
Appends information to the end of the current StringBuilder.
StringBuilder.AppendFormat
Replaces a format specifier passed in a string with formatted text.
StringBuilder.Insert
Inserts a string or object into the specified index of the current StringBuilder.
StringBuilder.Remove
Removes a specified number of characters from the current StringBuilder.
StringBuilder.Replace
Replaces a specified character at a specified index.

Program to explain StringBuilder Class

using System;
using System.Text;
namespace StringBuilder_example
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sbstr = new StringBuilder("We are the world");
            Console.WriteLine(sbstr);           
            sbstr.Append(" we are the people");
            Console.WriteLine(sbstr);
            float currency=3400.50f;
            sbstr.AppendFormat(" Our individual salary : {0:C}. ", currency);
            Console.WriteLine(sbstr);
            sbstr.Insert(11, "people of ");
            Console.WriteLine(sbstr);
            sbstr.Remove(11, 10);
            Console.WriteLine(sbstr);

            sbstr.Replace("world", "Indian");
            Console.WriteLine(sbstr);

            Console.ReadKey();
        }
    }
}


Output of above program


Difference between String and StringBuilder class


String
StringBuilder
System.String is immutable
System.StringBuilder is mutable
Concatenation is used to combine two strings
Append method is used.
The first string is combined to the other string by creating a new copy in the memory as a string object, and then the old string is deleted
Insertion is done on the existing string.
String is efficient for small string manipulation
StringBuilder is more efficient in case large amounts of string manipulations have to be performed



Conclusion

I hope that this article would have helped you in understanding StringBuilder Class in C#. StringBuilder can improve the performance of your application.