How to display data from database in a user required way

Last post 05-17-2008 9:50 PM by vasuvani. 5 replies.

Sort Posts:

  • How to display data from database in a user required way

    05-16-2008, 1:26 AM

    Hi all,

    I have table in my DB with following columns

    ID,emp_id,project_id,empfname,emplname,projname,workdate,worktype,timespent.

    Following is the sample data in my table

    1      15     6    praveen katta    project1      5/12/2008    Coding                1
    2  15 6 praveen katta project2 5/12/2008 Modifications 3
    11  15 8 praveen katta project3 5/12/2008 Coding 0.5
    12  15 7 praveen katta project4 5/12/2008 Testing 1
    13  15 9 praveen katta project5 5/12/2008 Modifications 2
    14  15 6 praveen katta project6 5/12/2008 Coding 1
     

    as i mentioned the columns, data is in the same order

    I am allowing the user to select from date...based on this i set the end date ie.,frmdate + 6days... no problem

     now i need to pull the report for a week and display to the user in the following format

    WorkType    |  5/12/2008  |  5/13/2008  |  5/14/2008  | 5/15/2008  | 5/16/2008  |  5/17/2008  |  5/18/2008  |  Hours

    Coding        |  totalhrs on 5/12/2008 day for coding   |  totalhrs on 5/13/2008 day for coding  |...................................................................................| total hours for the week

    I need to display in the above format...can any one help me out ..plzzzzzzzz.... 

     

  • Re: How to display data from database in a user required way

    05-16-2008, 1:33 AM

    Do you want the display in a web application or on a console?

    Also, this sounds like a home work project.  Is it?

     

    If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
  • Re: How to display data from database in a user required way

    05-16-2008, 4:48 AM

    Hi,

    This is an web application...it's our internal application... 

    do u have any solution...???Crying

     

  • Re: How to display data from database in a user required way

    05-17-2008, 4:59 AM
    Answer

    I'm not going to code the whole thing and hand it to you.  That's your job.

    If you have specific problems, post them.

    If you don't know where to start, there are a host of asp.net books and online articles and tutorials that explain how to do this.  There are starter kits on this website so you can see working pages in action along with the code.  Check that stuff out, then come back with specific problems that you are having trouble with.

    If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!
  • Re: How to display data from database in a user required way

    05-17-2008, 3:07 PM
    • Loading...
    • anthonypj
    • Joined on 05-11-2007, 3:31 PM
    • Posts 273

    :-) well said

  • Re: How to display data from database in a user required way

    05-17-2008, 9:50 PM
    Answer
    • Loading...
    • vasuvani
    • Joined on 05-16-2008, 6:31 PM
    • New Jersey, USA
    • Posts 413

    You can accomplish this in several ways. Try this: 

    Create a select statement for sum of timespent group by worktype and workdate for the given date range.

    Now use pivoting technique (pivot the workdate column) or looping to dump the data into a dataset/datatable

    Now attach this to GridView dynamically.

    Regards

    Vasu

     

     

    Regards, Sreenivas (Vasu) Chaparala
    ps:Unless a question, this is an attempt to provide guidance. Turning this into a solution, if required, is ones own responsibility. Expecting the entire solution as-is is inappropriate for any professional.
Page 1 of 1 (6 items)