How to retrieve SQL statement in the CR 2008

I'm using Crystal Reports 2008 in MS Visual Studio 2008, how can i retrieve SQL statement from *.rpt file, i have tried this code, but it doesn't work:
ReportDocument rdReport = new ReportDocument();
rdReport.Load("Reports/EmployeeTest.rpt", OpenReportMethod.OpenReportByTempCopy);
CrystalDecisions.ReportAppServer.Controllers.RowsetController rsController;
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rdClient = rdReport.ReportClientDocument; // on this line it throws an exception "The ReportClientDocument property can only be accessed when the report is opened using a Report Application Server."
CrystalDecisions.ReportAppServer.DataDefModel.ISCRGroupPath rdGroupPath = new CrystalDecisions.ReportAppServer.DataDefModel.GroupPath();
string temp;
string sql;
rsController = rdClient.RowsetController;
sql = rsController.GetSQLStatement(rdGroupPath, out temp);
maybe i'm doing something wrong ?
thanks

Hello Ludek,
when I try to get the report from the session I got an error like this (I am using State Server Session mode i.e out proc in my application)
ReportClientDocument     'reportDocument.ReportClientDocument' threw an exception of type 'System.InvalidOperationException'     CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument {System.InvalidOperationException}
+base     {"The ReportClientDocument property can only be accessed when the report is opened using a Report Application Server."}     System.SystemException {System.InvalidOperationException}
StackTrace     "   at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_ReportClientDocument()"     string
so is it the problem of not opened with RAS. Does installation of RAS solves the problem, If so Is it a free-ware or needs to be purchased.
Ashok

Similar Messages

  • How Can I Retrieve SQL Statement From The User ?

    Hi
    I want to know, how can I make the user can enter the SQL statement from himself ?? in this code he can't enter it. Only he can display the SQL that i wrote it...
    this is my Code:
    import java.sql.*;
    public class db_testing {
         static final String DRIVER = "com.mysql.jdbc.Driver";            
         static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
         public static void main(String[] args) {
              Connection cn=null;
              Statement st= null;
              ResultSet rset=null;
              try{
                   Class.forName(DRIVER);
                   cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
                   st=cn.createStatement();
                   rset=st.executeQuery("select * from employee");
                   ResultSetMetaData metadata=rset.getMetaData();
                   System.out.println("The begining: ");
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(metadata.getColumnName(i)+"\t");
                   System.out.println();
                   System.out.println();
                   while(rset.next()){
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(rset.getObject(i)+"\t\t");
                   System.out.println();}
              catch(Exception e){
                   e.printStackTrace();
              finally{
                   try{
                   cn.close();
                   st.close();
                   rset.close();
                   catch(Exception e1){
                        e1.printStackTrace();
    }

    The following changes in the code will make the user to give the input
    import java.sql.*;
    public class db_testing {
    static final String DRIVER = "com.mysql.jdbc.Driver";
    static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
    public static void main(String[] args) {
    Connection cn=null;
    Statement st= null;
    ResultSet rset=null;
    try{
    Class.forName(DRIVER);
    cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
    // st=cn.createStatement();
    // rset=st.executeQuery("select * from employee");
    PreparedStatement pstmt=null;
    pstmt=cn.prepareStatement("select * from employee where id=?");
    pstmt.setInt(1,Integer.parseInt(args[0]));
    rset=pstmt.executeQuery();
    ResultSetMetaData metadata=rset.getMetaData();
    System.out.println("The begining: ");
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(metadata.getColumnName(i)+"\t");
    System.out.println();
    System.out.println();
    while(rset.next()){
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(rset.getObject(i)+"\t\t");
    System.out.println();}
    catch(Exception e){
    e.printStackTrace();
    finally{
    try{
    cn.close();
    st.close();
    rset.close();
    catch(Exception e1){
    e1.printStackTrace();
    }

  • How to Retrieve SQL Statements in RDF Reports

    I need to retrieve the SQL statements from my reports without having to call each of them up in Reports Builder. The reports are in binary (RDF format). Does anyone know of a way to do this?

    Hello,
    Convert your RDF into a text format :
    - REX
    - XML/HTML/JSP if your are using Reports 9.0.x or greater)
    and search in these text files .
    Regards

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • Retrieve SQL Statement from Transaction_ID

    Hi,
    Is there any way to retrieve SQL Statement for LOCAL/SOURCE_TRANSACTION_ID listed in DBA_APPLY_ERROR ?
    Database version: 11.2.0.2
    Thanks,
    BSS.

    Hi,
    I am not sure if you can get that sql_id but if you use LOGMINER can get the SQL Text (ie.V$LOGMNR_CONTENTS.SQL_REDO) for a given transaction id.
    hth,
    Pradeep

  • Expensive SQL Statements of the day?

    Hi...
    How can i find out Expensive SQL Statements of the day please.?
    Our SAP Version is ECC 6.0 on Oracle 10.2.0.4.0
    Rgds

    Hi Srinivas,
    On ECC 6.0, go to ST04 t-code --> performance --> SQL Cache --> You see SQL Statements where you need to sort by SQL Statements by Total Execution Time(ms).
    I have tried on one of my R/3 4.7EE system, ST04n --> Resource COnsumption --> Top SQL Statements --> you will see 50 Top most expensive SQL Statements interms of wait time.
    also Read: [Re: Diagnosis of the expensive ABAP programs having database time > 90%;
                      [Please Read before Posting in the Performance and Tuning Forum;
    Regards,
    Kanthi Kiran

  • How to Capture  sql statement

    we have 1 server oracle and many clients.
    when client sends sql statement to server.How to Capture sql statement to analysis berfore it sent to server and execution.
    Edited by: 955185 on Aug 27, 2012 4:22 AM

    955185 wrote:
    yes. how to do this?Check these link all of them talking about Already executed sql in database by Users , but i don't know if what you ask is possible since they already connect to database
    If you attending to analysis sql read the below links and start your analysis,
    Last executed sql
    http://www.databasejournal.com/features/oracle/article.php/3373701/Watching-SQL-Execute-on-Oracle---Part-I.htm
    http://stackoverflow.com/questions/55899/how-to-see-the-actual-oracle-sql-statement-that-is-being-executed

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • How to find sql statement with Unix process pid

    Hi
    how to find sql statement with Unix process pid
    is there any view to find that.
    please if so let me know
    Thanks in advance

    this is how I am doing this:
    oracle 7352340 7459066 0 07:47:10 - 0:00 oracleJDERED (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle 7459066 5386396 2 07:47:10 pts/1 0:01 sqlplus
    select sid,serial# from v$session where process='7459066';
    SID SERIAL#
    2178 6067
    select sql_text
    from
    v$sqlarea a,
    v$session b
    where a.hash_value = b.sql_hash_value
    and b.sid = 2178
    ;

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • XML Publisher - can we specify multiple SQL statements in the report?

    Hi there,
    can we specify multiple SQL statements in the report with XML Publisher?
    Regards,
    Liviu

    Could we eventually generate with the Wizards available in XML Publisher desktop 5.6.2 an xml file with a structure like the one given below? The reason is to facilitate creation of the two rowsets. Thanks, Liviu.
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
         <ROWSET2>
              <ROW2>
                   <FIELD1>Query1</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW2>
         </ROWSET2>
         <ROWSET>
              <ROW>
                   <FIELD1>Query2</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW>
         </ROWSET>
    </DATA>

  • Custom SQL statement on the fly

    Is it possible to construct dynamic SQL statement in DB adapter on the fly?

    One Solution is pass your sql statement to the procedure and fire it from the procedure.
    stmt_str := 'INSERT INTO ' || tablename || ' VALUES
    (:deptno, :dname, :loc)';
    EXECUTE IMMEDIATE stmt_str
    USING deptnumber, deptname, location;
    refer this thread Dynamic database adapter
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to monitor perticuler sql statement using the INDEX or not?

    I am running on a long running quary, and the output is comming very late. So i want to know the sql quary is using the index or not? How to know that?

    If you want to check the real execution plan of a running query without waiting for query completion, you can try following steps that you should adapt to your query and your environment:
    1. start the query
    select
    count(*)
    from all_objects, all_objects;2. Retrieve in another session the SQL_ID and the CHILD_NUMBER of the running query:
    select sql_id, child_number, sql_text
    from v$sql
    where sql_text like '%all_objects%';3. use DBMS_XPLAN.DISPLAY_CURSOR to get the real execution plan from shared pool using SQL_ID and CHILD_NUMBER from step 2:
    select * from table(dbms_xplan.display_cursor(<sql_id>,<child_number>));Actually you don't need to restart the query if it is already running because the hint GATHER_PLAN_STATISTICS is only needed if you want to have current execution statistics.
    Edited by: P. Forstmann on 2 mars 2011 10:23

  • Information on how to run SQL queries on the CUCM itself please

    Good Day All,
    I need to run an sql query on the CUCM to list all of my directory numbers, their partition, and their external mask values.
    I came across this excerpt below earlier so I have a bit of an idea how to do it but iw would be great to see some other examples of sql queries.
    Any assistance is most appreciated.
    Also, is there a document somewhere to tell me how to run these queries?
    Thanks in advance
    Regards
    Amanda
    Currently Being Moderated
    05/04/2011 5:18 AM (in response to Joshua Royle)
    Re: Is there a way of pulling a report off CM showing all phones that have diverts on?
    Try if running this SQL query from the CLI helps you, it should list all DN's that have CFA enabled to VM or a DN:
    run sql select dnorpattern,cfadestination,cfavoicemailenabled from CallForwardDynamic c, numplan n where c.fknumplan = n.pkid and (cfadestination != '' or cfavoicemailenabled ='t')

    Hi Amanda
    Basically it's standard SQL, so it wouldn't hurt to google 'informix select statements' and do a little reading to get the basics. There are millions of permutations of queries so it's a matter of understanding the syntax, and then applying that to the database in question. The only difference when running commands from the CLI are that:
    - You prefix the standard informix SQL statement with 'run sql'
    - You don't get any help from CUCM with the syntax, so you might be well advised to use something that understands SQL a little and colorises it as you type, and then paste the resulting commands into the CUCM SSH window. I use a text editor named JEdit, if you create a text file and save it as a file ending in .sql it will highlight your syntax.
    - Other programs are available that do reasonable syntax highlighting (e.q. SquirrelSQL) that are designed for querying the DB directly, but you can't actually query directly against the DB for security reasons. You'd still have to copy/paste the commands.
    Now... to understand the DB you'll need a reference describing all the tables etc. This is here:
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_reference_guides_list.html
    Pick your version of CUCM and download the 'Data Definition' document.
    A few notes on the command:
    run sql : is just the CLI command that tells the shell to run the following text as SQL.
    select : the SQL command to retrieve data
    dnorpattern,cfadestination,cfavoicemailenabled : the column names to retrieve
    callforwarddynamic c, numplan n : the names of two tables, and the abbreviations you want to refer to them as
    where c.fknumplan = n.pkid : this tells SQL to return values from the two tables where these fields match up. In the data definition you'll see notes that c.fknumplan (i.e. the fknumplan column in the callforwarddynamic table, as noted by the c. prefix) refers to the PKID column in the numplan field. This is a very standard type of join in the CCM DB.
    and (cfadestination != '' or cfavoicemailenabled ='t') : another clause, basically in this query we want to see only rows where cfadestination isn't blank or cfavoicefmailenabled is set to 't' for true).
    Most tables are linked in one of two ways in this database:
    - a column prefixed 'fk' refers to the pkid field (there is always only one pkid field per table) in the table following the 'fk' prefix. E.g. above fknumplan refers to the numplan table, pkid field. fkdevice would refer to the device table, pkid field.
    - a column prefiex 'tk' refers usually to an enum table which is prefixed with 'type'. This is a table that maps the number value in the 'tk' field to a string. An example would be tkmodel - this represents the phone physical model type (e.g. 7962), and maps to a table called typemodel, and the 'enum' column in that table.
    Regards
    Aaron HarrisonPrincipal Engineer at Logicalis UK
    Please rate helpful posts...

  • Passing plsql parm to a sql statement in the procedure  database link name

    Would like to pass a parm that is the database link name to a stored procedure.  I defined this as below. var1 is the name of the db link that I would like to pass
    create or replace procedure   proc1  (var1 in varchar2) as
    cursor c1 is
    select num,name,city from emp@var1;
    However, this is getting a plsql error in the above code   as bad bind variable, db link name expected.
    Is there a method to pass a variable within a stored proc into a SQL statement that has a cursor ..
    thanks

    Hi,
    Database links have to be hard-coded.  If you really need to specify the database link at run-time, then you need Dyanmic SQL.
    Why do you need to do this?   How many databases are involved?  Do you have new database links all the time?  The more you can say about your business requirements, the more helpful we can be.
    Are there only a couple of possible database links?  If so,  you might consider hard-coding each of them, and branching to the appropriate one in your code.
    is the real variable here the environment (Development, Test, Production) that you're in?  For example, do you need to use one database link in Development, a different one in Test, and a third in Production, but you don't want to change the code when you move from one environment to another?  If so, you can try conditional comilation.

Maybe you are looking for

  • Memory upgrade on mid 2010 MacBook pro 13.3"

    I decided it was time to upgrade the original 4GB memory in my mid 2010 2.4 ghz core 2 duo 13.3 inch MacBook pro and bought a 2X4GB pack from PNY. Unfortunately the memory is not reconized and my laptop doesn't start when using both 4 GB sticks. Howe

  • Safari and other apps crash constantly.  Why?

    Safari and many other apps crash constantly - the screen just goes black and then back to the home screen.  Is this a common problem?

  • No javac...

    I'm the very beginner, and I was trying to install java SE for windows (i have vista); i downloaded java and jdk but i can not compile the code because there is no javac executable file in the downloaded stuff. What else should i download to finally

  • Credit not updated

    Hello everyone, Merry Xmas ! So, as you all know today is Xmas and because of that I have spent all my 520 minutes credit subscription by 22nd December 2012. My subscription is to call landline in Brazil from U.K , however on 24th I should be acredit

  • Large file compression

    Hi there all, I have CS3 extended and have been compiling a series of high resolution photographs into one layer in photoshop.  I have copy and pasted each photo and then stitched them together resulting in a file that is 1.35Gb.  I want to compress