Solved

crystal reports - dynamic parameter

Posted on 2013-06-06
9
436 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

734 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