Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2005
    Posts
    1

    Unanswered: SQL Stored Procedure and Crystal Reports 8.5

    Hi guys!

    I am new in Crystal reports so please help me on this one.

    I have to create a report that will bring back the TOP 20 customers per Sales Rep. My SQL stored procedure needs a parameter @SalesRep to execute. My stored procedure links between 2 tables. How do I get this stored procedure executed in Crysal Reports to give me results. The SP works fine.

    THANKS!!

  2. #2
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    74

    Try this ...

    The report should be a stored procedure report, and the procedure should only return a result, like in my example

    create procedure SomeProcName as
    select blah, more-blah, even_more_blah from table_name

    This is the only thing the procedure should do. If it produces any debug text or anything else it won't work.
    If you then choose to use the SomeProcName as source in Crystal you should be able to add the three fields in your report.

    In the first step (in Crystal) where you choose where to get data from, you choose Database, click the options button, tick the stored procedures option, click ok, and then do a refresh. You should now have your procedure available as a datasource. The rest is more of a Crystal issue than a DB-issue .... come to think of it, it actually was from the beginning too ....

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, devising a query that returns the Top 20 records per sales rep is an SQL Issue. If you post your table structure somebody on this forum can help you devise a statement that will feed your report.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    74

    Yes, but No ....

    "Well, devising a query that returns the Top 20 records per sales rep is an SQL Issue. If you post your table structure somebody on this forum can help you devise a statement that will feed your report."

    True, however, when AuctionLamb stated in his/her message that :

    "How do I get this stored procedure executed in Crysal Reports to give me results. The SP works fine."

    I assumed that the SQL-part of the problem was solved, and that the SP returned the TOP 20 records that was the issue here ....
    Perhaps I got ahead of myself ...


  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    C'mon Nephilim! You should know that clients rarely ask the question they want the answer to. The most important part of requirments gathering is reading their minds.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    74

    So true I almost peed in my pants laughing at it ...

    Hehehe ... well then maybe Mr/Mrs AuctionLamb can fill us in a bit about what's the issue really is here...

    Guess I shouldn't move to US then, you guys got the same problems we do here in Sweden.

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Not only do we have the same problems, but we have them on a scale that actually changes the quality of the problem instead of just the quantity.

    At least in my experience, Sweden is till a monoculture outside of the Stockholm area. Even though there are people (both visitors ad immigrants) from other cultures, they've adopted the Swedish culture (or are clearly tourists). Here in the US it is more like London, you find 30 or more significant cultural groups in a single large city!

    That adds a lot to the complexity of things, and makes it much more interesting to make things "easy to understand" because you have to cover a much larger target. This does a lot to contribute to the complexity of a geek's life!

    -PatP

  8. #8
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by Nephilim
    Hehehe ... well then maybe Mr/Mrs AuctionLamb can fill us in a bit about what's the issue really is here...

    Guess I shouldn't move to US then, you guys got the same problems we do here in Sweden.
    Really? The same problems? I guess I haven't been watching the news enough. Which foreign country did Sweden invade? Also, sorry to hear that your economy sucks too. I am mildly suprised, though, to hear that your constitution allows you to elect a Texan to your top political office.

    You have my deepest sympathy. I feel your pain, I really do.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  9. #9
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    74
    Really? The same problems? I guess I haven't been watching the news enough. Which foreign country did Sweden invade? Also, sorry to hear that your economy sucks too. I am mildly suprised, though, to hear that your constitution allows you to elect a Texan to your top political office.

    You have my deepest sympathy. I feel your pain, I really do.
    *laughs uncontrontrolleably*

    Ok, you DONT have the exact same problems we do. I'm not gonna make this thread a flamewar about who's contry got the worst problems. All I can say is that when your "Mr Fancy-pants" make a false move, a million lives or two (at least) goes to waste, when in our case a few hundred people makes a fist in their pocket and mumbles about how unfair everything is. The bottom line would be that we both have jerks as country leaders, but mine is a little (understatement) noted in worldly affairs.

  10. #10
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I think a million is an exageration.

    My estimate is in the range of 100,000 to 150,000 lives.

    Still a respectable degree of carnage.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  11. #11
    Join Date
    Sep 2003
    Location
    j;l
    Posts
    6

    other software discussion fourm ?

    except this discussion forum , does anyone can suggest other good software discussion forum to me ? thx in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •