Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to get the SQLQuery in Crystal Report Command ?

My crystal report file (*.rpt) contains two Command objects.

In my code, ReportObject.SQLQueryString only return the first query, but not the second one! Help

Former Member


This is because you are using 2 data sources in the main report and they are not linked. I'm sure you saw the warning. You can either link the commands, although since you are using a command you should put them together so you have one query result for CR to process, or create a subreport and move the second query into it.

I assume you are also using the RDC and although you can modify the SQL in the RDC it was based on older technolgies which at the time it did not support multiple SQL SELECT statements and you had to use a subreport.

Moving forward the RDC is no longer shipped as of CR 2008 and the replacement report engines do not have the ability to programatically modify the SQL statement directly. I highly suggest what ever you are doing to re-evaluate what you are doing and use the Record Selection formula to alter the report filtering.

Thank you


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question