We help IT Professionals succeed at work.

parameter selection based on passed parameter

wolfiegrr
wolfiegrr asked
on
Medium Priority
375 Views
Last Modified: 2012-05-07
We use a software system (VB / .NET) that calls Crystal Reports from within the application to produce a report based on the selected report.  When the report is called, CompanyID is automatically passed to the report so that we can run reports specific to that company.

What we are having extreme difficulty doing, is having a parameter selection based on the CompanyID being passed.  

For example, there are 5 companies within the DB.  Each company has 5 services specific to that company we would like to run reports on.  We are getting passed the CompanyID, and we want to only display services in a parameter selection box that go along with that CompanyID.

We tested with cascading parameters, using a dropdown to pick the CompanyID, and we can successfully get it to only display that specific company's services, but this won't work as it allows company A to look at Company B's service reports.  It needs to only be specific to the passed CompanyID.


Comment
Watch Question

Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
How is the company id passed?

Why do you need the parameter prompt?

mlmcc

Author

Commented:
I'm not sure how the actual parameter is being passed to the crystal reports runtime.  I do know that if I have, for example, 3 parameters

CompanyID
Start Date
End Date

when I make CompanyID the first parameter, the Crystal Reports runtime will automatically pick it up, and only ask for Start Date and End Date, not showing the prompt for CompanyID.  But if I run Crystal Reports standalone app, all three parameters, as designed, show up.

I am successfully able to use that CompanyID i receive from the app, and use it as a regular parameter for processing.  Ie., I can write a report based on that to list all service entries in the database between a start date or end date.  I just cant create a parameter prompt based on data from the CompanyID.

What I am looking to do, is once I receive the CompanyID, create a prompt in crystal reports that allows the user to select only the services they deal with.

A good example would be, two companys use our system.  a hair cut salon, and a florist.   If the Florist were to login, and from within the app, click to run the Client List report, their CompanyID would get passed to the crystal reports runtime.  From there, I would want a prompt that only shows the Florists services they can select from.  ie., A dozen Roses, basket arrangement, etc.  So if the Florist clicks on A Dozen Roses as the service, only clients in the report would be displayed that received that service.  I would not want to display the hair salon's service in my prompt, as they have nothing to do with the florists services... and I'm hoping I can do this, because the CompanyID is being passed to the report parameter as CompanyID.  I hope this gives it a bit of context?

I'm attaching a sample screen shot.. right now in our demo system, its listing all services there for every company. I only want it to display services for the specific company based on the passed CompanyID.

Thanks!

service-list.jpg
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Ouch.  Unfortunately, the app we are using is a licensed closed source app, and the reports are in a Report Library, which is basically a list of reports you can place, and then just click Run on them.  No ability to enter additional data before processing the report.

I have been able to get close to the functionality by using Cascading Parameters, ie., create a Company drop-down, and when the company is selected, it only shows the services for that company.  Is there maybe a way of using another field to trigger the cascading parameter to display that company's services and just reference the stored CompanyID so it can pull based on that?  
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
You might be able to limit access by using 2 parameters for the company.  Pass the company id in and use it for record selection and then also use the cascade to limit the records.

Otherwise I think you probably are stuck with what you have unless you can change the application.

mlmcc

Author

Commented:
Ahh, owell.  Thanks for your help!  Was really hoping I could make the passed parameter trigger the cascading parameter, but looks like this won't be possible.  Thanks again for your input!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.