Skip to Content
avatar image
Former Member

How to retrieve raw SQL query from report template

A trivial .Net client, a stand alone app. HelloWorld, really.

using CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0.

Loads a template.from a file.

Is it possible to get a raw SQL query, which CR generates internally, based on the parameters of the template?

Google search has returned a few similar questions, but they all seem to refer to RAS.

Much appreciated


Add comment
10|10000 characters needed characters exceeded

  • Former Member

    to elaborate further: we need to get the query from our code, not by looking at SQL Profiler or some SQL traces.

  • Former Member

    this is the query which you see from the Template Designer, using Database\ShowSQLQuery menu.

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 08, 2018 at 05:29 PM

    You need to use RAS which is free to use.

    To get it use this:

    GroupPath gp = new GroupPath();
    string tmp = String.Empty;
    rptClientDoc.RowsetController.GetSQLStatement(gp, out tmp);
    btnSQLStatement.Text = tmp;

    Update runtime here:

    Sample code above is in this test app:


    Add comment
    10|10000 characters needed characters exceeded