Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Update report with new paramater Post Reply Post New Topic
Author Message
kingjoe
Newbie
Newbie
Avatar

Joined: 07 Jul 2011
Location: United States
Online Status: Offline
Posts: 5
Quote kingjoe Replybullet Topic: Update report with new paramater
     Posted: 07 Jul 2011 at 4:37am
hello i am using crystal reports 9 and relativly new to crystal reports.
 
I am trying to add a new paramater to the report so that it pulls data from different divisions within the company.
 
The way it is setup now is that i pulls sale data from the database what i want it to do is pull data from the different divisions seperatly.
 
i added a new paramater to do this but i am having trouble updating the sql query so that it only pulls the data for that division.
 
I am not sure what is needed so i will post the sql query
 
 SELECT "job_hdr"."order-no", "job_hdr"."enter-date", "job_hdr"."name", "job_hdr"."item-desc", "job_hdr"."prod-code", "job_hdr"."unit-price", "job_hdr"."x-dec", "job_hdr"."parent-order", "so_hdr"."x-char", "job_hdr"."so-no", "ship_log"."tran-date", "ship_log"."quantity", "job_hdr"."country"
 FROM   {oj ("PUB"."job-hdr" "job_hdr" LEFT OUTER JOIN "PUB"."so-hdr" "so_hdr" ON ("job_hdr"."company"="so_hdr"."company") AND ("job_hdr"."parent-order"="so_hdr"."order-no")) LEFT OUTER JOIN "PUB"."ship-log" "ship_log" ON ("job_hdr"."company"="ship_log"."company") AND ("job_hdr"."order-no"="ship_log"."order-no")}
 WHERE  "ship_log"."tran-date"={d '2011-07-07'}
 ORDER BY "job_hdr"."country"
 
Not sure what else is needed please let me know.
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 07 Jul 2011 at 4:41am

is this in a command file?

you can put the parameter in the record selection especially if you want to give the option to run the report for all divisions
 
create a parameter with the division and ALL as an option
in the record selection enter
 
if {parameter}='ALL' then true else {field}={parameter}
sharona
IP IP Logged
kingjoe
Newbie
Newbie
Avatar

Joined: 07 Jul 2011
Location: United States
Online Status: Offline
Posts: 5
Quote kingjoe Replybullet Posted: 07 Jul 2011 at 4:45am
Thanks for the quick reply... I am not sure if it is a command file or not... i am just getting into learning this.  I know that there are two paramaters that exsist already in the report. 
 
And where would i add that option in the record.  Sorry for the hand holding request here but i am just not real familar with it at the moment.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Jul 2011 at 6:19am
so you added a parameter to the report already but now you need to make it filter the data?
if you go into the select expert (the button with the hand grabbing a erb dot from 2 blue dots) you add in the what you want the paramter to do.
an example:
{?Division} = {table.division}
IP IP Logged
kingjoe
Newbie
Newbie
Avatar

Joined: 07 Jul 2011
Location: United States
Online Status: Offline
Posts: 5
Quote kingjoe Replybullet Posted: 08 Jul 2011 at 2:19am
Ok i have been trying this and looking it up online but i am still not getting it.
 
There exsisting formula is
 
{ship_log.tran-date} in {?StartDate} to {?EndDate}
 
So i added this to the end
 
for {?Company} = {Company.company}
 
But i always get the message "the remaining text does not appear to be part of the formula"
 
I looked it up and it suggested that i set the data source location which i believe i did. But it is still not working properly.
 
Is there anything else i can look at.
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 08 Jul 2011 at 3:35am
({ship_log.tran-date} in {?StartDate} to {?EndDate} and
{?Company} = {Company.company})
 
do you want the end users to be able to pick more than one company?
 
 
sharona
IP IP Logged
kingjoe
Newbie
Newbie
Avatar

Joined: 07 Jul 2011
Location: United States
Online Status: Offline
Posts: 5
Quote kingjoe Replybullet Posted: 08 Jul 2011 at 3:39am
Well the way i have the paramater setup if they don't select one it defaults to all.. But i want them to select one at a time or everything.
 
So if they don't specify one it defaults to everyone instead of seperate ones.
 
Edit: I tried the formula you specified i get the field name is not known.


Edited by kingjoe - 08 Jul 2011 at 3:41am
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 11 Jul 2011 at 2:41am
you must have your paramters set up as optional then. go to format paramater and set it for not optional.
 
when you created the formula did you double click the field into it or just type it?
 
you may need to verify the data to pull the field in.
sharona
IP IP Logged
kingjoe
Newbie
Newbie
Avatar

Joined: 07 Jul 2011
Location: United States
Online Status: Offline
Posts: 5
Quote kingjoe Replybullet Posted: 11 Jul 2011 at 3:42am
Ok i am unable to format the paramater and i don't see anywhere that it says optional.
 
when i created the formula i used the wizard and double clicked the options into the formula but every time i get either the field name is not known or the remaining text does not appear to be part of the formula.
 
Verify?  i thought i did that by selecting the database but the more i read about it i think i did it wrong..  I go to database-> set datasource location -> then i ctrl click the fields that correspond to the paramater, insert the sql query and click ok. 
 
But the more i see i think i am doing that wrong but i am not sure.
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