Solved

crystal reports - dynamic parameter

Posted on 2013-06-06
9
434 Views
Last Modified: 2013-06-12
I am adding a dynamic parameter to a report. I select a field for the value, then select a field for the description.  The problem I have is: When I run the report and select a parameter from mt list it brings in both the vale and the description. The value is a number, the description is a date. It pulls it in as 962 - 2013-05-25 00:00:00. Then gives me an error saying a number is required.
0
Comment
Question by:qbjgqbjg
  • 6
  • 3
9 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39227065
Where are you using the parameter?

Can you show the formula?

I just built one the same way and don't have a problem
What version of Crystal?

mlmcc
0
 

Author Comment

by:qbjgqbjg
ID: 39227213
XI, The parameter is used in selection formula.
{ESGACTTR.ACCT_TYPE} = "E" and
({@dept} = {?Dept} or {?Dept} = '*') and
({@div} = {?Div}   or {?Div} = '*') and
({@act} = {?Act}   or {?Act} = '*') and
({@obj} = {?Obj}   or {?Obj} = '*') and
({@Fund} = {?Fund} or {?Fund} = '*') and
{ESGACTTR.ACCT_YEAR} = {?FiscalYear} and
{ESXTRANR.DOC_DATE} in {@DateBegin} to {@DateEnd} and
{CmdPayPer.PAY_PERIOD} = {?PayPeriod} and
{CmdPayPer.FISCAL_YEAR} = {?FiscalYear}
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39227255
Which parameter?

Can you show a screen shot of the parameter edit screen?

mlmcc
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:qbjgqbjg
ID: 39227328
I changed it a little. I tried making it a string. I hoped that would make  difference but it doesn't. It still makes the description part of the parameter. I have used dynamic before and it worked correctly. Is there a setting for this? Here is a screen shot of the definition and how it comes up.Doc1.docx
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39227411
What data type is PayPeriod?

The parameter type is controlled by the field you choose.

Does it change the type when you choose the data field?

Try a verify database

mlmcc
0
 

Author Comment

by:qbjgqbjg
ID: 39227435
In the original file it is numeric, so it automatically made it numeric and description is a date. I was using a sql command to select a subset of my table to use for the dynamic parameter. So I added 2 additional  fields, one for pay period changed to a string and 1 for the date with just the date(without the time). But neither way works. If I wanted it to bring in the description I would not know what to do to make it do that.This is the command
SELECT
 ESYPPERD.PAY_PERIOD
 , ESYPPERD.PAY_YEAR
 , ESYPPERD.END_DATE
 , ESYPPERD.START_DATE
 , ESYPPERD.CYCLE_CODE
 , ESYPPERD.FISCAL_YEAR
 , CONVERT(VARCHAR(10),ESYPPERD.END_DATE,110) as EndDate
 , CAST( ESYPPERD.PAY_PERIOD as VARCHAR(4)) as PayPeriod
 
 FROM   ESYPPERD ESYPPERD
 
 WHERE  ESYPPERD.CYCLE_CODE = 'b'
 AND ESYPPERD.FISCAL_YEAR =  {?FiscalYear}
AND ESYPPERD.END_DATE <= GETDATE()

ORDER BY
 ESYPPERD.START_DATE
,  ESYPPERD.PAY_PERIOD
0
 

Author Comment

by:qbjgqbjg
ID: 39227454
Even if this had worked with the parameter I would have to convert it back to a number to use it in the report. I was just trying to see if being a string would make it work correctly. Here is the data pulled by the sql for the command. PayPeriods.xlsx
0
 

Accepted Solution

by:
qbjgqbjg earned 0 total points
ID: 39229264
Since there does not seem to be a way to make this work, I have decided to do this report without using the Dynamic parameter and just have them enter pay period without selecting it.
0
 

Author Closing Comment

by:qbjgqbjg
ID: 39240409
There was no solution, so I am going to do it another way.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question