cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Sql Queries for a Report from Crystal Server in java

Former Member
0 Kudos

Hi Team,

We required to excute the the configured crystal report and need to generate the Excel file as tabular format(Not like the crystal report template format). So, Could you please provide us the code to get the Sql Queries for the reportId.

Thank you...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ashok,

Try using the below code snippet to check whether you are able to get the sql for the report.

         GroupPath grpPath = new GroupPath();
        //get CR SQL query string
        String reportSQL=reportClientDoc.getRowsetController().getSQLStatement(grpPath,null);
        System.out.println("report SQL String: "+reportSQL);

Thanks,

Prithvi