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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Parameter for an ID doesn't work with the {}

Status
Not open for further replies.

ciscowiz

MIS
Apr 21, 2004
146
US
I use CR9. I am passing a string parameter to my report that is for a uniqueidentifier in my SQL Server 2000 DB. The format of the uniqueidentifier is {00000000-0000-0000-0000-000000000000}. The report will return data just fine if the parameter is without the leading and ending {}, but if the brackets are included, no data is displayed. I looked at the Database>>Show SQL Query and copied that and pasted it into my SQL Query Analyzer, which runs queries against the DB, and it returns the same data regardless of the {} included or not so the report should still be getting data whether the identifier has brackets {} or not, according to the query the report is using anyway. Any clue as to why the reports query would pull back data but not display it?
Thanks,
Bryan
 
curly brackets {} are used within Crystal for field names.

Please clarify what you mean by "passing a string parameter". Passing from an application? How exactly?

If passing the value without the brackets works for you, why not use that approach?

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
In MS SQL Server, there is a data type called "uniqueidentifier" which is in the format I described in my first post, a string of hexadecimal digits enclosed in curly brackets {}. I am using a parameter of type "String" in my report to filter based on this uniqueidentifier. I am passing the identifier from a web app in the form of a query string which is the value after the '?': The problem is that sometimes the query string has curly brackets and sometimes it doesnt and that is something I can't change. I can run the report in the CR designer successfully using that parameter without the braces but if I include it, the report displays no data. Again, if I copy the code from the "Show SQL Query" it pulls back data regardless of the curly brackets so the query the report is sending to the DB returns the same data no matter what.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top