Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal report parameter problem

Status
Not open for further replies.

hamzajosh

Programmer
Sep 18, 2002
182
US
I had a crystal report supplied by my software consultant. This report had some error i was trying to correct. It also had some parameter fields defined in a query. When i went to database -> show query, it asked for parameter values which i entered as 1 for the parameter. I now made some change to the query and saved the report. Now the SQL query uses values 1 for the parameters everytime as it is saved now. How do i mention the parameter value in the query to get it to work carrectly
The parameter name is "Document Type"

for eg the query now looks like
SOP50200."DOCTYPE" = 1
I tried putting
SOP50200."DOCTYPE" = "Document Type"
SOP50200."DOCTYPE" = 'Document Type'
SOP50200."DOCTYPE" = "?Document Type"
SOP50200."DOCTYPE" = '?Document Type'

Nothing works, how do i change this query to again accept parameters, what is the syntax, Please help, THanks
 
Try posting technical information when requesting it.

Crystal version?
Database (and connectivity) used?
How did you change the query (and why????)?
Example data?
Expected Output?
How is the report executed?

If it's Crystal 8.5, modifying the query directly has this unfortunate side effect, and though you might eliminate the line, you are telling Crystal NOT to pass anything because you've elected to hand code the query.

Rather than state how you intend to design a report (modifying the SQL directly), why not post your requirements and get a fresh, seasoned perspective?

-k
 
It's slightly complicated that's why i gave limited information.
We use Great Plains (GP)6.0 highly customised by a consultant who knows only half his job. We use forms printer in Great Plains to print reports created in Crystal. We use Crystal version 8.0. and MS SQL Server and ODBC connectivity. The reports started as templates from forms printer and were worked upon from there to give the desired results. When we print from great plains, certain parameters are passed to it for e.g say we are printing an invoice, then GP passes document number to crystal via forms printer. This parameter is somehow not passing now because i screwed up the query in the report. I just want to know the syntax of how to specify a parameter name in the SQL query,

if the parameter name is defined as Document Type, how will u mention

where tablename.fieldname = Document Type

I just need the syntax for this statement in the query, thanks
 
You don't.

I'd suggest creating a new thread describing your requirements and plan on rewriting the record selection formula in the original report, NOT modifying the SQL directly.

-k
 
There is the alternative of creating a Stored Procedure, Crystal will recognize it's parameters, the question is whether GP will.

-k
 
It's not easy creating the report anew. The reports have to start with templates provided by forms printer and I and my consultant have done so much work on it, redoing it will take too long. I just need to know how to put a parameter syntax in the query in SQL, If i know just this much, i can fix the report in a few minutes rather than a couple of weeks time ( both mine and consultant as well as his fees :) ). Please help
 
You shouldn't try to edit it from the 'Show SQL Query' window unless you really know what you're doing.

Try Database>Edit Selection Formula>Record instead, and let Crystal try to repair the query.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top