Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need Help with New Project

encstephencsteph Posts: 2Member
hello,

I need some help.

Site Details:

ASP.NET
SQLServer 2000 DB

I have been contracted to create a website for a gambler friend of mine who wants to keep track of his wins/losses. He currently does it with spreadsheets/manual calculations and wants the work done for him automatically.

I have about 80% of the application figured out but I am having a little trouble figuring out the best way to handle one aspect of his request.

He wants the "Home Page" to display his Year-to-Date results which isn't a problem in itself. Where the problem comes in is how he wants those results broken down for his viewing pleasure.

He wants to see the results broken down by: Region(Vegas, Atlantic city, etc...) then within each region he wants it broken down by resort, then within each resort he wants profit/loss for that casino. In addition to the above totals he wants the results broken down by "type" of gambling (baccarat, blackjack, roulette, etc...) and within that type he wants total number of sessions played, total profit/loss and and average profit/loss per session.

Here is an example I did in HTML for him to approve:

Year-To-Date
Atlantic City
Casino: A.C. Hilton
Game: Baccarat
# of Sessions: 4
Total Profit: $120
Per Session: $30
Game: Mini Baccarat
# of Sessions: 2
Total Profit: $120
Per Session: $60
Game: Roulette
# of Sessions: 4
Total Profit: $12
Per Session: $3
Casino Profit YTD: $300

My question is: How the heck do I do that?

Here is the data that is being input into the database:

Resort Region Game Date Profit

Taj Mahal A.C. Baccarat 2005-01-02 50.00
Taj Mahal A.C. Baccarat 2005-01-03 25.00
Trump Plaza A.C. Mini Baccarat 2005-01-02 50.00
Taj Mahal A.C. Video Poker 2005-01-02 50.00
Taj Mahal A.C. Video Poker 2005-01-03 25.00
Trump Plaza A.C. Mini Baccarat 2005-01-03 25.00
Trump Plaza A.C. Pai Gow Poker 2005-01-02 50.00
Trump Plaza A.C. Pai Gow Poker 2005-01-03 25.00
Trump Marina A.C. Let It Ride 2005-01-03 25.00
Trump Marina A.C. Craps 2005-01-02 50.00
Trump Marina A.C. Craps 2005-01-03 25.00
Tropicana A.C. 3 Card Poker 2005-01-02 50.00
Tropicana A.C. 3 Card Poker 2005-01-03 25.00



I thought of pulling the data back and pusing it into an array and then just looping thru the array but not sure how I can get the data to line up the way I want without looping thru it hundreds of times.

Any/all help will be most appreciated since I am about to start pulling my hair out with this one!

Sorry about how long this question is but I wanted to make sure I gave you all the most pertinent details I could.

Sincerely,

Eric

Comments

  • iwilld0itiwilld0it Posts: 1,134Member
    Does your buddy want to see this all in one screen?

    Because you could build it so that it shows the basic report with links that your buddy could click to drill down furthur to see more specific details about an item.

    For instance have a list of regions with total win / losses. Your buddy clicks on Las Vegas and a list of of Casino's or resorts reveal themselves ect ...

    As for your database layout, it would be wise to normalize your data. For instance, you would have a table that stores all the names of the regions, casinos, and games your buddy played.

    Regions
    -------
    RegionID RegionName
    1 Las Vegas
    2 Atlantic City

    Casinos
    -------
    CasionID CasinoName RegionID
    1 Taj Mahal 2
    2 Trump Plaza 2

    Games
    -----
    GameID GameName
    1 Baccarat
    2 Let It Ride
    3 Pai Gow Poker

    Stats
    -----
    StatID CasionID GameID Date Profit
    1 1 1 2005-01-02 5.00
    etc...

    It will make easier for you to generate a report in the long run.

    : hello,
    :
    : I need some help.
    :
    : Site Details:
    :
    : ASP.NET
    : SQLServer 2000 DB
    :
    : I have been contracted to create a website for a gambler friend of mine who wants to keep track of his wins/losses. He currently does it with spreadsheets/manual calculations and wants the work done for him automatically.
    :
    : I have about 80% of the application figured out but I am having a little trouble figuring out the best way to handle one aspect of his request.
    :
    : He wants the "Home Page" to display his Year-to-Date results which isn't a problem in itself. Where the problem comes in is how he wants those results broken down for his viewing pleasure.
    :
    : He wants to see the results broken down by: Region(Vegas, Atlantic city, etc...) then within each region he wants it broken down by resort, then within each resort he wants profit/loss for that casino. In addition to the above totals he wants the results broken down by "type" of gambling (baccarat, blackjack, roulette, etc...) and within that type he wants total number of sessions played, total profit/loss and and average profit/loss per session.
    :
    : Here is an example I did in HTML for him to approve:
    :
    : Year-To-Date
    : Atlantic City
    : Casino: A.C. Hilton
    : Game: Baccarat
    : # of Sessions: 4
    : Total Profit: $120
    : Per Session: $30
    : Game: Mini Baccarat
    : # of Sessions: 2
    : Total Profit: $120
    : Per Session: $60
    : Game: Roulette
    : # of Sessions: 4
    : Total Profit: $12
    : Per Session: $3
    : Casino Profit YTD: $300
    :
    : My question is: How the heck do I do that?
    :
    : Here is the data that is being input into the database:
    :
    : Resort Region Game Date Profit
    :
    : Taj Mahal A.C. Baccarat 2005-01-02 50.00
    : Taj Mahal A.C. Baccarat 2005-01-03 25.00
    : Trump Plaza A.C. Mini Baccarat 2005-01-02 50.00
    : Taj Mahal A.C. Video Poker 2005-01-02 50.00
    : Taj Mahal A.C. Video Poker 2005-01-03 25.00
    : Trump Plaza A.C. Mini Baccarat 2005-01-03 25.00
    : Trump Plaza A.C. Pai Gow Poker 2005-01-02 50.00
    : Trump Plaza A.C. Pai Gow Poker 2005-01-03 25.00
    : Trump Marina A.C. Let It Ride 2005-01-03 25.00
    : Trump Marina A.C. Craps 2005-01-02 50.00
    : Trump Marina A.C. Craps 2005-01-03 25.00
    : Tropicana A.C. 3 Card Poker 2005-01-02 50.00
    : Tropicana A.C. 3 Card Poker 2005-01-03 25.00
    :
    :
    :
    : I thought of pulling the data back and pusing it into an array and then just looping thru the array but not sure how I can get the data to line up the way I want without looping thru it hundreds of times.
    :
    : Any/all help will be most appreciated since I am about to start pulling my hair out with this one!
    :
    : Sorry about how long this question is but I wanted to make sure I gave you all the most pertinent details I could.
    :
    : Sincerely,
    :
    : Eric
    :
    :

  • encstephencsteph Posts: 2Member
    Yes, he wants that info all on one screen.

    Then on a separate screen he wants me to break it out into more detail (I.E. Each date he visited the Casino within each region).


    I have my database setup almost exactly like you suggested.

    The sample query I posted is the results of a Stored Procedure that I created to pull back just the info I wanted.

    Eric

    : Does your buddy want to see this all in one screen?
    :
    : Because you could build it so that it shows the basic report with links that your buddy could click to drill down furthur to see more specific details about an item.
    :
    : For instance have a list of regions with total win / losses. Your buddy clicks on Las Vegas and a list of of Casino's or resorts reveal themselves ect ...
    :
    : As for your database layout, it would be wise to normalize your data. For instance, you would have a table that stores all the names of the regions, casinos, and games your buddy played.
    :
    : Regions
    : -------
    : RegionID RegionName
    : 1 Las Vegas
    : 2 Atlantic City
    :
    : Casinos
    : -------
    : CasionID CasinoName RegionID
    : 1 Taj Mahal 2
    : 2 Trump Plaza 2
    :
    : Games
    : -----
    : GameID GameName
    : 1 Baccarat
    : 2 Let It Ride
    : 3 Pai Gow Poker
    :
    : Stats
    : -----
    : StatID CasionID GameID Date Profit
    : 1 1 1 2005-01-02 5.00
    : etc...
    :
    : It will make easier for you to generate a report in the long run.
    :
    : : hello,
    : :
    : : I need some help.
    : :
    : : Site Details:
    : :
    : : ASP.NET
    : : SQLServer 2000 DB
    : :
    : : I have been contracted to create a website for a gambler friend of mine who wants to keep track of his wins/losses. He currently does it with spreadsheets/manual calculations and wants the work done for him automatically.
    : :
    : : I have about 80% of the application figured out but I am having a little trouble figuring out the best way to handle one aspect of his request.
    : :
    : : He wants the "Home Page" to display his Year-to-Date results which isn't a problem in itself. Where the problem comes in is how he wants those results broken down for his viewing pleasure.
    : :
    : : He wants to see the results broken down by: Region(Vegas, Atlantic city, etc...) then within each region he wants it broken down by resort, then within each resort he wants profit/loss for that casino. In addition to the above totals he wants the results broken down by "type" of gambling (baccarat, blackjack, roulette, etc...) and within that type he wants total number of sessions played, total profit/loss and and average profit/loss per session.
    : :
    : : Here is an example I did in HTML for him to approve:
    : :
    : : Year-To-Date
    : : Atlantic City
    : : Casino: A.C. Hilton
    : : Game: Baccarat
    : : # of Sessions: 4
    : : Total Profit: $120
    : : Per Session: $30
    : : Game: Mini Baccarat
    : : # of Sessions: 2
    : : Total Profit: $120
    : : Per Session: $60
    : : Game: Roulette
    : : # of Sessions: 4
    : : Total Profit: $12
    : : Per Session: $3
    : : Casino Profit YTD: $300
    : :
    : : My question is: How the heck do I do that?
    : :
    : : Here is the data that is being input into the database:
    : :
    : : Resort Region Game Date Profit
    : :
    : : Taj Mahal A.C. Baccarat 2005-01-02 50.00
    : : Taj Mahal A.C. Baccarat 2005-01-03 25.00
    : : Trump Plaza A.C. Mini Baccarat 2005-01-02 50.00
    : : Taj Mahal A.C. Video Poker 2005-01-02 50.00
    : : Taj Mahal A.C. Video Poker 2005-01-03 25.00
    : : Trump Plaza A.C. Mini Baccarat 2005-01-03 25.00
    : : Trump Plaza A.C. Pai Gow Poker 2005-01-02 50.00
    : : Trump Plaza A.C. Pai Gow Poker 2005-01-03 25.00
    : : Trump Marina A.C. Let It Ride 2005-01-03 25.00
    : : Trump Marina A.C. Craps 2005-01-02 50.00
    : : Trump Marina A.C. Craps 2005-01-03 25.00
    : : Tropicana A.C. 3 Card Poker 2005-01-02 50.00
    : : Tropicana A.C. 3 Card Poker 2005-01-03 25.00
    : :
    : :
    : :
    : : I thought of pulling the data back and pusing it into an array and then just looping thru the array but not sure how I can get the data to line up the way I want without looping thru it hundreds of times.
    : :
    : : Any/all help will be most appreciated since I am about to start pulling my hair out with this one!
    : :
    : : Sorry about how long this question is but I wanted to make sure I gave you all the most pertinent details I could.
    : :
    : : Sincerely,
    : :
    : : Eric
    : :
    : :
    :
    :

  • iwilld0itiwilld0it Posts: 1,134Member
    For best result, your buddy may want to invest in the Crystal Reports program or SQL Server Reporting services, if he really wants such a complex report. I know crystal has a web component for displaying the report.

    Other than that, you may want to drop several tables of data in a dataset, rather than an array. With a dataset, you can create views on the fly and filter records. So one table in the dataset could be a list of cities and another table could be a list of casinos. Then you can use nested repeater and/or datalist controls. Look at some of these articles.

    http://search.yahoo.com/search?p=nested+repeater+and+datalist&fr=FP-tab-web-t&toggle=1&cop=&ei=UTF-8





    : Yes, he wants that info all on one screen.
    :
    : Then on a separate screen he wants me to break it out into more detail (I.E. Each date he visited the Casino within each region).
    :
    :
    : I have my database setup almost exactly like you suggested.
    :
    : The sample query I posted is the results of a Stored Procedure that I created to pull back just the info I wanted.
    :
    : Eric
    :
    : : Does your buddy want to see this all in one screen?
    : :
    : : Because you could build it so that it shows the basic report with links that your buddy could click to drill down furthur to see more specific details about an item.
    : :
    : : For instance have a list of regions with total win / losses. Your buddy clicks on Las Vegas and a list of of Casino's or resorts reveal themselves ect ...
    : :
    : : As for your database layout, it would be wise to normalize your data. For instance, you would have a table that stores all the names of the regions, casinos, and games your buddy played.
    : :
    : : Regions
    : : -------
    : : RegionID RegionName
    : : 1 Las Vegas
    : : 2 Atlantic City
    : :
    : : Casinos
    : : -------
    : : CasionID CasinoName RegionID
    : : 1 Taj Mahal 2
    : : 2 Trump Plaza 2
    : :
    : : Games
    : : -----
    : : GameID GameName
    : : 1 Baccarat
    : : 2 Let It Ride
    : : 3 Pai Gow Poker
    : :
    : : Stats
    : : -----
    : : StatID CasionID GameID Date Profit
    : : 1 1 1 2005-01-02 5.00
    : : etc...
    : :
    : : It will make easier for you to generate a report in the long run.
    : :
    : : : hello,
    : : :
    : : : I need some help.
    : : :
    : : : Site Details:
    : : :
    : : : ASP.NET
    : : : SQLServer 2000 DB
    : : :
    : : : I have been contracted to create a website for a gambler friend of mine who wants to keep track of his wins/losses. He currently does it with spreadsheets/manual calculations and wants the work done for him automatically.
    : : :
    : : : I have about 80% of the application figured out but I am having a little trouble figuring out the best way to handle one aspect of his request.
    : : :
    : : : He wants the "Home Page" to display his Year-to-Date results which isn't a problem in itself. Where the problem comes in is how he wants those results broken down for his viewing pleasure.
    : : :
    : : : He wants to see the results broken down by: Region(Vegas, Atlantic city, etc...) then within each region he wants it broken down by resort, then within each resort he wants profit/loss for that casino. In addition to the above totals he wants the results broken down by "type" of gambling (baccarat, blackjack, roulette, etc...) and within that type he wants total number of sessions played, total profit/loss and and average profit/loss per session.
    : : :
    : : : Here is an example I did in HTML for him to approve:
    : : :
    : : : Year-To-Date
    : : : Atlantic City
    : : : Casino: A.C. Hilton
    : : : Game: Baccarat
    : : : # of Sessions: 4
    : : : Total Profit: $120
    : : : Per Session: $30
    : : : Game: Mini Baccarat
    : : : # of Sessions: 2
    : : : Total Profit: $120
    : : : Per Session: $60
    : : : Game: Roulette
    : : : # of Sessions: 4
    : : : Total Profit: $12
    : : : Per Session: $3
    : : : Casino Profit YTD: $300
    : : :
    : : : My question is: How the heck do I do that?
    : : :
    : : : Here is the data that is being input into the database:
    : : :
    : : : Resort Region Game Date Profit
    : : :
    : : : Taj Mahal A.C. Baccarat 2005-01-02 50.00
    : : : Taj Mahal A.C. Baccarat 2005-01-03 25.00
    : : : Trump Plaza A.C. Mini Baccarat 2005-01-02 50.00
    : : : Taj Mahal A.C. Video Poker 2005-01-02 50.00
    : : : Taj Mahal A.C. Video Poker 2005-01-03 25.00
    : : : Trump Plaza A.C. Mini Baccarat 2005-01-03 25.00
    : : : Trump Plaza A.C. Pai Gow Poker 2005-01-02 50.00
    : : : Trump Plaza A.C. Pai Gow Poker 2005-01-03 25.00
    : : : Trump Marina A.C. Let It Ride 2005-01-03 25.00
    : : : Trump Marina A.C. Craps 2005-01-02 50.00
    : : : Trump Marina A.C. Craps 2005-01-03 25.00
    : : : Tropicana A.C. 3 Card Poker 2005-01-02 50.00
    : : : Tropicana A.C. 3 Card Poker 2005-01-03 25.00
    : : :
    : : :
    : : :
    : : : I thought of pulling the data back and pusing it into an array and then just looping thru the array but not sure how I can get the data to line up the way I want without looping thru it hundreds of times.
    : : :
    : : : Any/all help will be most appreciated since I am about to start pulling my hair out with this one!
    : : :
    : : : Sorry about how long this question is but I wanted to make sure I gave you all the most pertinent details I could.
    : : :
    : : : Sincerely,
    : : :
    : : : Eric
    : : :
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.