473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to create dynamic report pending on user parameter

132 100+
Hi, I hope someone could help me on this, I have a query of several fields from which I want to create report of few fields selected by user. Say total fields be 30 as Field1...Field30, The first three fields will be displayed on the reports but only one of the rest fields (Field4...30) will be available depending on the user request. The User will be prompted to enter one field only to view the report. This report should be displayed on the same template
Aug 29 '10 #1

✓ answered by liimra

You are welcome. I wanted to test the result using all 27 fields. Unfortunately, when using the IIF statement for 19 times, you will probably get "complex expression" error. That is why you create two fields in the Query (each will handle part of the 27 fields); Then you concatenate both fields in another field which will be displaying the extra field based on the user's choice.

Kindly note what I just stated in the attached database.

Regards,
Ali

5 3216
liimra
119 100+
You can use conditional formatting. It should do it for you. Suppose you have a form called "SeA", and you have a Combo Box called "Cmbo" from which the user will select the fourth field he/she wants. In the fourth field of the Query-Report (DesignView), you can use the following:
Expand|Select|Wrap|Line Numbers
  1.  FourthField: IIf([Forms]![SeA]![Cmbo] = "Catg1",[Field1], IIf([Forms]![SeA]![Cmbo] = "Catg2",[Field2],IIf([Forms]![SeA]![Cmbo] = "Catg3",[Field3],IIf([Forms]![SeA]![Cmbo] = "Catg4",[Field4],""))))

The above applies for 4 fields. Use same method for the 27 fields and you are done.

Regards,
Ali
Aug 29 '10 #2
Mr Key
132 100+
Thankx alot Liimra! I have tried to implement your Idea by Creating a query that have three Fields and tried to enter the Expression "ForthField" in the ForthFied of a myquery named "Query1" and Run this query, but it displays only the first entered three fields and the ForthFied is empty, may be because of the following reasons:
1. The terms "Catg1", "Catg2","Catg3","Catg4" is not well understood and not defined in my IIfs expression
2. The Combobox, Selects one records from all fields and by default its Unbound
Due to these reasons:
(a)How am I going to set values to these "Catg1", "Catg2","Catg3","Catg4"?
(b)Should I Bound this Combobox to something as?
Sep 4 '10 #3
Mr Key
132 100+
I have also tried to inlude CheckBox to decide on the column it couldn't work
Sep 4 '10 #4
liimra
119 100+
You are welcome. I wanted to test the result using all 27 fields. Unfortunately, when using the IIF statement for 19 times, you will probably get "complex expression" error. That is why you create two fields in the Query (each will handle part of the 27 fields); Then you concatenate both fields in another field which will be displaying the extra field based on the user's choice.

Kindly note what I just stated in the attached database.

Regards,
Ali
Attached Files
File Type: zip 30.zip (26.9 KB, 205 views)
Sep 5 '10 #5
Mr Key
132 100+
Thankx Mr Ali, It sounds like miracle to me, I have been working for it for months now without any solution. This is what I was looking for. Thankx
Sep 6 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Climber | last post by:
Hello, I want to now how to do a dynamic report with Crystal Report (C# .Net), the number of colum and row are different each time because they depend of my data base. Thanks Climber
0
by: Benny | last post by:
Hello Experts, Currently Im working on a web application using asp.net with C#. I need to create a report depends on user's selection of the database fields, i.e. the user may want to display...
1
by: saratogajoe | last post by:
User will make choices from multiple drop-down lists of variables with the capability of making more than one choice from each list. Can this be done without using vb or sql. If not, what would be...
6
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main...
6
by: Peter Herath | last post by:
I want to create a dynamic report using a crosstab query...... pls someone look into my attached example database and help me out to do the report generation.... example is like dis...: there...
2
by: zoro25 | last post by:
Hi, I want to create a dynamic report and for that I'm using a very simple Combo Box (only one item) and I want to use this filter on my report. Here's the code I came up with: Private Sub...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
1
by: remya1000 | last post by:
i'm using VB.net 2003 application program. i'm trying to convert a VB6 program to VB.NET. The VB6 code i'm trying to convert is shown below. declared g_Share() array in module and trying to add...
1
by: Sundhas | last post by:
Hey! I am working on jrxml to create dynamic re0ports. I have parameterized the columns i.e. the jrxml for that report can be used to generate other reports as well. However, i have not managed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.