Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter field advice Post Reply Post New Topic
Author Message
funkyrobot
Newbie
Newbie


Joined: 10 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote funkyrobot Replybullet Topic: Parameter field advice
     Posted: 10 Mar 2009 at 7:53am
Hello all. New to this forum (so, hello Embarrassed) and new to Crystal Reports and judging by what I have seen, this is the best place to ask for some advice.
 
I am currently developing my second ever Crystal report (shows how new I am) and have hit a bit of a snag with the parameter fields I wish to use.
 
I have taken over the job of report writing from someone who wrote all of our company's reports in Crystal 8.5. The company has decided to update to Crystall 11 so I'm stepping through coverting old reports and writing new ones.
 
The problem I have with the parameter field is related to Crystall 11's lack of appreciation for a Null value. The older reports we used always (8.5)contained a 'select for all' option in the parameter list to select all values (e.g. all suppliers). I am running into trouble trying to adopt this logic to Crystall 11.
 
I am using Crystal 11 as a standalone product and my database connection is via Advantage over a network, if that makes sense. Our databases are custom tables built in code.
 
I have a table called 'Supplier' which details supplier info. When you run my report you can select certain suppliers or all of them. As the table is so large, if you select the '>>' option in the parameter menu to select all the records it takes ages to move them all across. It would be nice to have a 'select all' option in parameter list (or a blank one to leave for all) but as I'm using a dynamic parameter this can't happen.
 
I was trying to add another parameter that asked the question 'Do you wish to searh all the suppliers'. I was hoping that if the answer was 'yes' then the search function could run without having to select a supplier from the list. If the answer was 'no' the prog could popup the supplier parameter. I don't think this will work in Crystal as I don't think you can select a parameter based on a previous parameter selection. Or am I wrong here?
 
Basically, what i'm after, is a Crystal 11 solution to the old 8.5 solution of the 'select all' value, without having the delay caused by the '>>' button.
 
Has anyone got any ideas about how this could be done? My parameter fields are currently 'date', 'supplier' and 'product variety'. Do I need to amend these or add something new? Can I actually program Crystal so that it displays a parameter based on a previous paramter input?
 
Many thanks in advance all, any help would be much appreciated. If you need to know anymore please ask. Smile
 
Regards. Funky.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Mar 2009 at 4:19pm

Not sure if this is what you are looking for but if your existing table does not have an "All" record then you can use an add command and a union to add an "...All" option, point that to your parameter then handle it in your select statement.

IP IP Logged
funkyrobot
Newbie
Newbie


Joined: 10 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote funkyrobot Replybullet Posted: 11 Mar 2009 at 9:15am
Originally posted by DBlank

Not sure if this is what you are looking for but if your existing table does not have an "All" record then you can use an add command and a union to add an "...All" option, point that to your parameter then handle it in your select statement.

 
Hello. Thanks for this.
 
Sorry this reply sounds very silly, but I read somewhere on here that adding a union messes up the way the report works? Also, if I add this into the connection will it change the connection for other reports in any way, and will it change anything in my table structures?
 
Thanks again.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Mar 2009 at 9:31am

Adding in a Command (where you place the Union) only changes it for that one report and will not change your other reports, tables, views, stored procs, etc..

Unions can bog the report down depending on the size of the data but it should not "mess it up".
If your table has multiple listings per supplier rather than a master supplier list showing each one once you may need to alter the COmmand code to group on the supplier name other wise your join will go wacky connecting all the items multiple times and exponentially increasing your rows. If it connects singularly you should be fine.

For myself I was able to get into the master listing of items that I needed and add "All" options for areas I needed them to avoid the Union issues and try to keep it clean but many times people do not have that luxury.

IP IP Logged
funkyrobot
Newbie
Newbie


Joined: 10 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote funkyrobot Replybullet Posted: 12 Mar 2009 at 3:54am
Hi DBlank.
 
Added in the Union code as suggested on the other thread (cut and pasted it in with the relevant table and field names) but i'm getting this error:
 
'Failed to retrieve data from the database.
Details: HY00:[Extended Systems][Advantage SQ][ASA]Error 7200: AQE Error: State = 42000; NativeError =  2115; [Extended systems][Advantage SQL Engine]Expected lexical element not found: FROM You are missing the keyword FROM after the column definitions in your SELECT statement. -- Location of error in SQL statement is 47: (line: 4 column: 15)
 
Any ideas??
 
Thanks a lot for your help!
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 7:08am
Can you post your command and what type of DB are you using?

Edited by DBlank - 12 Mar 2009 at 7:08am
IP IP Logged
funkyrobot
Newbie
Newbie


Joined: 10 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 13
Quote funkyrobot Replybullet Posted: 12 Mar 2009 at 8:13am
Originally posted by DBlank

Can you post your command and what type of DB are you using?
 
Thanks DBlank.
 
I'm using the sample code that was shown in the other thread:
 
SELECT TEXT
FROM SUPPLIER
UNION
SELECT '...All'
 
The DB i'm using is a custom built Advantage system. We have custom built tables that were originally developed in DOS and clipper apps and our newer programs are made in Delphi.
 
The tables are custom built and when I access them through Crystal it has been through the Advantage server option. If that makes sense.
 
Thanks again for your help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2009 at 8:21am
The above example is using SQL. I am not familiar with Delphi so you would need to alter your command to work within that framework. That is definately getting out of my level of knowledge.
Anyone else comfortable with assisting here?Thumbs%20Up
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum