cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report adding command to report disappear when adding parameter

dbah01
Discoverer
0 Kudos
97

Dear Crystal Experts,

I have a report in which I want to add a command using the {?DocKey@} as parameter as in screen shot below. At this point the DocKey@ parameter already exists in the Parameter Fields. The moment I add the command it gets removed in the Database Expert, i.e. it does not get added. It's not a problem when adding a new parameter. Anyone have an idea what could be the problem?

We are using SAP Crystal Report 2020 Support pack 2 patch 1. Connection type to the database is OLE DB (ADO) SQLOLEDB.

Thanks.

dbah01_0-1737527529989.png

 

View Entire Topic
DonWilliams
Active Contributor
0 Kudos

Try removing the @ from the formula name.

Never use the Shift top row characters on your keyboard in the names of anything, those Characters are typically reserved for internal use.

Also, for Command Parameters you should be using them in the Command UI:

DonWilliams_0-1737726523254.png

There could be an issue with the MS Client you are using, sometimes MS OLE DB Client works and sometimes not...

As a test ONLY, create a 64 ODBC DSN to your SQL Server and see if that works?

 

dbah01
Discoverer
0 Kudos
SQL local variable must contain the @ as per SQL syntax: DECLARE { @local_VARIABLE data_type [ = value ] }
DonWilliams
Active Contributor
0 Kudos

Yes but you have the @ at the end of the name and not the beginning as described in the SQL docs:

@local_variable The name of a variable. Variable names must begin with an at (@) sign. Local variable names must comply with the rules for identifiers.