Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Parameters just not working Post Reply Post New Topic
Author Message
bigbloo
Newbie
Newbie
Avatar

Joined: 09 Mar 2010
Location: Canada
Online Status: Offline
Posts: 19
Quote bigbloo Replybullet Topic: Parameters just not working
    Posted: 09 Mar 2010 at 2:32pm
I'm desperate.
I've created a report in CR2008. I selected one field and made it a dynamic ( I also tried static without luck) parameter, When I refresh report, the dialog box opens and I enter the paramater values ( tried range and single values). Report runs, but always returns all the records in the table.
I've tried placing paramater field in GH, and currently have it in suppressed detai line. (Don't quite understand what the difference would be in where it's placed either).
 
Anyone???????
Bigbloo
--------------------------------------------------
Information is power only when it's shared.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Mar 2010 at 2:42pm
Are you using the paramater in the select expert?
you should have something like :
{?param}={table.field}
IP IP Logged
bigbloo
Newbie
Newbie
Avatar

Joined: 09 Mar 2010
Location: Canada
Online Status: Offline
Posts: 19
Quote bigbloo Replybullet Posted: 09 Mar 2010 at 3:26pm
I'm in design screen.
I open Field explorer, rt click on Parameter Fields and select NEW.
I enter data in the Create New PAramter dialog box, then click 'OK'.
Then I insert the parameter field into (I've tried both) either the Group header, or a detail section.
 
These are the steps according to the help file if I'm reading it correctly.
 
Appreciate any help you can give me.
I must be missing something very basic. 
Bigbloo
--------------------------------------------------
Information is power only when it's shared.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Mar 2010 at 6:06pm
A parameter does not inherently limit the data in a report (nor would you want it to). It is gives you the option to limit data in the way you tell it to.
You declare how you want it to limit the data in the select expert.
Open the select expert and add in your selection criteria in there.
You can select the field you want to limit from your table fields and make it = the parameter. If the paramter type is the same as the field type you can see it in the drop down lists inside the select expert.
Crystal does not know what do do with the param until you tell it.
Say you make a parameter of a date field and add it to the report. Does that mean you want records > than ?Date or < the ?date or = or something else? Crystal does not know. You declare that in the select expert to define how you want that param to limit the data...e.g.
{table.Datefield} < {?DateParam}
Does this help?


Edited by DBlank - 09 Mar 2010 at 6:09pm
IP IP Logged
bigbloo
Newbie
Newbie
Avatar

Joined: 09 Mar 2010
Location: Canada
Online Status: Offline
Posts: 19
Quote bigbloo Replybullet Posted: 09 Mar 2010 at 6:21pm
I'm going to think through your answer and try it thamk you.
I thought parameter provides a user running a report with a dialog box to select, in my case, date ranges for transactions.
I thought the select expert selected a subset of records in a table against which the report will run, but doesn't give the user a choice.
 
Have I totally misunderstood?
Bigbloo
--------------------------------------------------
Information is power only when it's shared.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Mar 2010 at 6:33pm
Close.
They work together.
You can write a select statemetn with or wothout paramters. As you note you use the params to allow runtiume selection criteria. However you still have to tell crystal in the select expert that when a user enters the param how it should limit the data and on which field.
The name of the param does not link it to any field in the table. You do that by using it in the select statement.
 
IP IP Logged
bigbloo
Newbie
Newbie
Avatar

Joined: 09 Mar 2010
Location: Canada
Online Status: Offline
Posts: 19
Quote bigbloo Replybullet Posted: 09 Mar 2010 at 6:38pm
That's the clearest explanation I've seen - thank you! I'll work on it as soon as SP2 has installed Sleepy
Not too familiar with SAP, but the help file certainly doesn't mention Select Expert in the create parameters steps.
Bigbloo
--------------------------------------------------
Information is power only when it's shared.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Mar 2010 at 6:39pm
For your date range param you can do this in 2 ways.
Create 1 param (called ?Date) and allow for a range (a setting in the param).
You write you select staement as:
{table.datefield} in Minimum({?Date}) to Maximum({?Date})
 
or you create 2 different parameters (say ?StartDate and ?EndDate) and you use them in you select statement as:
{table.datefield} in {?StartDate} to {?EndDate}
IP IP Logged
bigbloo
Newbie
Newbie
Avatar

Joined: 09 Mar 2010
Location: Canada
Online Status: Offline
Posts: 19
Quote bigbloo Replybullet Posted: 09 Mar 2010 at 8:20pm
It Worked! Thank you very much.
May I ask one more question - what's the difference in placing the parameter field in the GH or the Detail section?
Bigbloo
--------------------------------------------------
Information is power only when it's shared.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Mar 2010 at 6:57am
As far as I know the placement of the param into the report canvas has no effect at all on the report (other than where the param value will be displayed).
There are 2 parts to the Select Expert, one for record select and the other for group selection. You can use a param in either part of this so maybe that is what they were referencing???
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.063 seconds.