Showing results for 
Search instead for 
Did you mean: 

How can specify a SQL hint from an existing report?

0 Kudos

I am porting an app from COM based CR to CR Visual Studio 2010. I've managed to update my database connection on the fly thanks to help on this forum. Now I want to get an Oracle style hint into my SQL. I've read all the threads lamenting the passing of SQLQueryString, so there appears to be no easy answer to this. I have a number of table linked reports that in the old version would take the SQLQueryString, and replace WHERE with WHERE /*+ <hinttext> */ . My OleDBProvider then interprets the hint text to do various options. Is there some way I can get this hintext string into my SQL? It doesn't have to go in any particular place in the SQL statement, it just needs to be there somewhere and I need to be able to generate the <hinttest> at runtime.


Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

Only suggestion I'd have is to use ADO .NET datasets created off of your query and point the report at that (assuming the number of records returned is less than a few thousand). No hints, etc. See KB [1281732 - How to pass a SQL query to a Crystal reports in a Visual Studio .NET application?|]

Also, see Kb [1371957 - How can I get the SQL Query from a Crystal Report and Subreport using the RAS .NET SDK?|]

- Ludek

0 Kudos

Only other suggest is try to use SQLExpression. I should push that option into the SQL Statement.

Or use a Command Object, there is code in here to convert your report from up too two tables to a Command, if more than that then you have to re-write your reports.

Warning, you can not have more than one data source in the report.


Edited by: Don Williams on Jan 3, 2012 10:20 AM

Answers (0)