Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


parameter selection based on passed parameter

Posted on 2009-07-05
Medium Priority
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.

Question by:wolfiegrr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 101

Expert Comment

ID: 24782402
How is the company id passed?

Why do you need the parameter prompt?


Author Comment

ID: 24782457
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

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.


LVL 101

Accepted Solution

mlmcc earned 1000 total points
ID: 24786378
I don't believe Crystal can do that.  You need to develop an application to provide the prompts.

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.


Assisted Solution

jgbreeden earned 1000 total points
ID: 24786515
It sounds like you want to control all of this from Crystal, but I think you will need to make changes in the .net app to get the results you want.  Ideally, you would have the service selection box programmed into the app, and pass their selection to the report in the same way the company ID is being passed to the report.

Author Comment

ID: 24786543
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?  
LVL 101

Expert Comment

ID: 24790875
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.


Author Comment

ID: 24842086
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!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question