[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

[vb.net] Modify parameters at runtime - ParameterDiscreteValue description

Posted on 2003-11-19
3
Medium Priority
?
1,419 Views
Last Modified: 2012-08-13
I have an application that needs to report the current employees on specific departments.
The user must have the option to choose one or more departments to filter the data.

I can add a ParameterField to my report at runtime, I can add ParameterDiscreteValue objects to the DefaultValues collection of the ParameterField, but how can I specify the Description for the Value at runtime? I know this is possible at design time using 'Set Default Values' in the 'Create Parameter' dialog box.

The values are department-IDs (1, 2, 3, etc.) in my database, but I want to give the user the possibility to select the name of the department instead of the ID.

Thanks in advance,

Ruben
0
Comment
Question by:RubenvdLinden
[X]
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 Comments
 
LVL 13

Accepted Solution

by:
EwaldL earned 375 total points
ID: 9777943
i can only see 2 options, which would both include writing your own parameter prompt
a) take the string values, then get hold of the correspoding integer value for the department and pass this to the report
b) take the string values and based on this input fill an appropriate dataset and pass this to the report
you could also create a string parameter in the report, which could then be converted to the relevant integer in a formula which can then be used in the record selection formula inside the report. this should mean though that the report will retrieve all records from the database, not just the ones that will be displayed. so i wouldnt advise this just for performance reasons
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9778910
Another option would be to have your parameter prompt display something like this:
1) Department1_Name
2) Department2_Name
3) ...

Then create a formula field to extract the first character from the selected parameter and convert it to a number.  Use this formula field to filter your data.

Note that if you have more than 9 departments you'll want to label them 01, 02, etc. and extract the first 2 characters...
0
 
LVL 12

Author Comment

by:RubenvdLinden
ID: 9816644
Created my own parameter dialog just like EwaldL suggested. It's filled with objects, the ToString function of the objects lists the strings just like I wanted. I extract the IDs from the selected objects to pass to the parameter field.

Thank you both for your answers.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 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