Crystal Report Parameter Search & SP

  • I am tasked with building a report in Crystal Report V7 in which the vendor number is the main factor of the report. I have to do a parameter search where I can select either all vendors, a single vendor, or multiple vendors. I've never had a problem selecting all possible parameter values, or a single parameter value and I usually build that into my stored procedures. But to be able to select multiple vendors? Do I have to make my Vendor parameter in my stored procedure a cursor?

  • Don't know Crystal, but, assuming this can be done in scope, use your front-end to insert the vendor numbers into a temporary table. Then have your SP use that table, e.g.:

    SELECT v.Number, v.Name, v.City

    FROM Vendors v JOIN #ReptVendors r ON v.Number = r.Number

    ORDER BY v.Number

    --Jonathan



    --Jonathan

  • Also do not know Crystal that well, but you can try and pass the vendors as a comma delimited string to the sp.

  • If I already have the vendor numbers in a permanent table, why would I need to put them in a temporary table?

  • quote:


    If I already have the vendor numbers in a permanent table, why would I need to put them in a temporary table?


    The temporary table would contain only the vendors chosen for the report--the "multiple vendors" possibilty in your post. Then use an inner join to that table to restrict the result set to just those vendors (as in the example I posted).

    --Jonathan



    --Jonathan

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply