cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the report query from java

Former Member
0 Kudos

Hi,

I need to get the report query of an rpt file when calling it from java.

Is there any method to do that??

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Elie,

-You can get query of a report from SDK point of view using getCommandText() method.

-Since you have not specified which Java SDK are you using, I will try to explain the steps from JRC SDK.

-There is no direct method or class to return SQL command at runtime using JRC. However you can use the method from RAS SDK to acheive this functionality in JRC. That is, you need to use latest eclipse jar files to make use of RAS method in JRC.

-The steps will be as follows :

//Obtain collection of tables from this database controller.

Tables tables = databaseController.getDatabase().getTables();

ITable table = tables.getTable(i);

ICommandTable ic= (ICommandTable) table;

// Command can be obtained from the report using getCommandObject() method

command=ic.getCommandText();

Thanks,

Chinmay

Former Member
0 Kudos

Thanks Chinmay,

This is exactly what I want.