Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Input Parms not working in Record Selector Post Reply Post New Topic
Author Message
Colonel45
Newbie
Newbie


Joined: 10 May 2011
Location: United States
Online Status: Offline
Posts: 35
Quote Colonel45 Replybullet Topic: Input Parms not working in Record Selector
     Posted: 10 May 2011 at 10:41am
The following code for the {?Dept_ID} input parameter is not working correctly when I select a value other than blank for the dept_id input parm:
 
(cstr({PCG_Monthly_Resource_Summary_VW.DEPID}) = {?Dept_ID} or {?Dept_ID} = '') and
{PCG_Monthly_Resource_Summary_VW.transactiondate} <= {?DateEnd} and
{PCG_Monthly_Resource_Summary_VW.transactiondate} >= {?DateStart}
 
See below for the parameter values.
 
For some reason the only way the report will display any values is if I select the default value which is blank, if I select any of the actual department id's it doesn't show any results even though they are in the record set. Please help, I'm new to Crystal reporting.
 
the DEPID field from the database is a NUMBER
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 May 2011 at 11:35am
are you getting an error that the array must be subscripted ?
try changing your type to numeric and assigning ) to all (which i assume is your "")
 
 
({?Dept_ID}=0 or {PCG_Monthly_Resource_Summary_VW.DEPID}) = {?Dept_ID}) and
{PCG_Monthly_Resource_Summary_VW.transactiondate} <= {?DateEnd} and
{PCG_Monthly_Resource_Summary_VW.transactiondate} >= {?DateStart}


Edited by DBlank - 10 May 2011 at 11:35am
IP IP Logged
Colonel45
Newbie
Newbie


Joined: 10 May 2011
Location: United States
Online Status: Offline
Posts: 35
Quote Colonel45 Replybullet Posted: 11 May 2011 at 2:50am
It does not throw an error at all, it just will not return any values if I select a value other than blank (' ') in the parameter section. If I select blank I get a list of all the records but if I select a DEPT_ID in the parameter section then it returns no values at all when I know that it should.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 May 2011 at 3:43am
did you try my suggestion of the working with a numeric param?
IP IP Logged
Colonel45
Newbie
Newbie


Joined: 10 May 2011
Location: United States
Online Status: Offline
Posts: 35
Quote Colonel45 Replybullet Posted: 11 May 2011 at 3:48am
I just changed it now and it worked correctly, thank you very much. Now since I changed that input parm to numeric I ran into another issue with a different part of my report. Is there an easy way to convert the numeric array back to a string array for use in other parts of the report?
 
I am using the Join() statment to concatenate the values of the input part into a Lable for the report.
 
So if a person picks Department 1 and Department 2 then it will list those departments in a lable on the report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 May 2011 at 3:52am

arrays are not my forte at all but so I understand, you have no meta data in the report that converst the number to a name and you are doing this via a formula only or can you use a different field in the report to get display data (names)?

IP IP Logged
Colonel45
Newbie
Newbie


Joined: 10 May 2011
Location: United States
Online Status: Offline
Posts: 35
Quote Colonel45 Replybullet Posted: 11 May 2011 at 10:37am
I don't have any code in the report that converts the number to a name due to the fact that the list of department's is very very long so I can't hard code it.
 
Should I just create another post on how to convert at numerica array to string array?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 May 2011 at 10:41am
probably should.
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