How to execute SQL Query from the Crystal report X1

Dear All,
I am using crystal report X1. In my application am creating run time MS Access tables and giving table name at run time based on my requirement . From these tables I want to fetch data based on some condition and to display using crystal report X1. I have never used the SQL Queries in the Crystal reports. Please help me out.
Thanks and Regards,
Rahaneef T

Please note;
This forum is dedicated to all other development-related questions which are not directly addressed by other forums. This includes Business Objects SDKs, products, or technologies which do not fall under BusinessObjects Enterprise, BusinessObjects Edge, Crystal Reports Server, or Crystal Reports (for example Desktop Intelligence SDK, Universe Designer SDK, Portal Integration Kits, Java User Function Libraries, and other third party technologies or development languages).
This looks more like a Crystal Reports design issue?
Ludek

Similar Messages

  • How to execute SQL Query in Code behind Using infopath 2010?

    Hi,
    I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
    Thanks In Advance
    Shoeb Ahmad

    Hello,
    You first need to add new SQL DB connection then you need execute connection from code behind.
    See below link to create new connection
    http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
    http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
    Then use below code to execute this connection:
    AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
    string origCommand = Select * from tablename;
    conn.Command = origCommand;
    conn.Execute();
    Finally bind your table:
    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
    http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to transport SQL Query from SQVI Tcode?

    Dear Friends,
    Can any one tell me how to transport SQL Query from <b>SQVI</b> Tcode.
    Full Points will be rewarded.
    Thanks & Reagrds
    Ravi

    go to sqvi tool .....
    select u r query name ......in the menubar ....quickview....> additianal functions.......>generate program
    after doing generate program ....go to again same menu path as i have mentioned above [quickview....> additianal functions.......>display report name it will give the report name of the select query ..........copy the report name and give it abap editor[se38] u will get u r query program......with all authority checks.....
    in start of selection event of u r program u will find u r select query.
    reward points if helpful

  • How to execute sql scripts from Powershell across multiple databases

    Re: How to execute sql scripts from Powershell across multiple databases
    I have an tsql script that I want to run across a list of databases. How is the best way to do this in Powershell? Thanks.

    My example below, using just the SMO and not breaking up the batches, the ExecuteWithResults give the following error when the .sql file contains a GO. My script files are as simple as a DECLARE and then a GO.
    WARNING: SQL Script Failed
    The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-list" comm
    and which is conflicting with the default formatting.
        + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperationException
        + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
    Also, when executing from the ISE, is there a way to force the ISE to release the files. I am having to close the ISE and reopen my script every time I want to make a testing change to the .sql file.
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
    $scriptspath = "C:\temp\psExecuteSQLScripts\scripts"
    $SQLServer = "fidevc10"
    $SQLDB = "Bank03"
    # Create SMO Server Object
    $Server = New-Object ('Microsoft.SQLServer.Management.Smo.Server') $SQLServer
    # Get SMO DB Object
    $db = $Server.Databases[$SQLDB]
    # Load All SQL Scripts in Directory
    $scripts = Get-ChildItem -Path (Join-Path $scriptspath "*") -Include "*.sql" -Recurse
    # Loop through each script and execute
    foreach ($SQLScript in $scripts)
    $fullpath = $SQLScript.FullName
    # Read the Script File into Powershell Memory
    $reader = New-Object System.IO.StreamReader($fullpath)
    $script = $reader.ReadToEnd()
    # Execute SQL
    Write-Host "Executing $SQLScript on $SQLDB...."
    try
    $ds = $db.ExecuteWithResults($script)
    Foreach ($t in $ds.Tables)
    Foreach ($r in $t.Rows)
    Foreach ($c in $t.Columns)
    Write-Host $c.ColumnName "=" $r.Item($c)
    Write-Host "Complete"
    catch [Exception]
    Write-Warning "SQL Script Failed"
    echo $_.Exception|format-list -force
    Write-Host " " -BackgroundColor DarkCyan

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • Get SQL Query from the Region Source

    Hi,
    The below query gives me the region source code,
    SELECT region_source into p_sql_stmt
    FROM apex_application_page_regions
    WHERE region_id = 01129836282 AND
    page_id = 54 AND
    application_id = 215;
    Initially I use to have only the SQL region source code as mentioned below , So using the above query i use to pass the sql code to p_sql_stmt
    SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE FROM AR_V_ADDRESS_HISTORY WHERE PROJECT_ID = :P51_PROJECT_ID
    Now the changes what i did in the page region source is i am using a PLSQL return query which is mentioned below
    declare
    qry varchar2(32000);
    begin
    qry := ' SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE';
    for c1 in ( SELECT * FROM AR_ADDRESS_TYPE)
    loop
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_1"';
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_2"';
    end loop;
    qry := qry || ' FROM AR_V_ADDRESS_HISTORY
    WHERE
    PROJECT_ID = :P51_PROJECT_ID ';
    return(qry);
    end;
    If i execute the above code in the with dbms_output.put_line in the SQL developer or TOAD it prints the sql query which i wanted, Since i am using this in a apex page i need to get the SQL code from the apex page.
    Can any one please suggest me how to get this sql code using the above plsql code.
    Please suggest me in this issue
    Thanks
    Sudhir

    One way to get the sql statement is
    Create a global variable in the package spec where your function returns sql statement and assign the final sql statement to the package spec variable before the return.
    Write a wrapper function to return the stored sql statement value.
    Example code below:
    create or replace package xx_test_pkg as
    g_sql_stmt CLOB;
    function get_sql() return clob;
    function get_stored_val() return clob;
    end;
    create or replace body package xx_test_pkg as
    function get_sql return clob ..
    v_sqlstmt clob;
    begin
    v_sqlstmt := 'select * from emp';
    -- assign to global variable before returning the value
    g_sql_stmt := v_sqlstmt;
    return v_sqlstmt;
    end;
    function get_stored_val() ....
    begin
    return g_sql_stmnt;
    end;
    end;

  • How to set database location in the crystal report X1 from the Source code.

    Dear All,
    I am using Crystal report X1 for report generation.Now I am setting the database location manually in the crystal report. How can I Set the database location from the Source code.
    Awaiting for your reply.
    Thanks in advance.
    Regards,
    Rahaneef T

    Here's a routine that also searches for subreports to set the log on info. Simply remove that aprt to set the main report logon info:
    IDatabaseTablePtr pTable;
    //get first table
    pTable = m_Report->Database->Tables->GetItem(1) ;
    long lTableCount = m_Report->Database->Tables->Count;
    for( long lTable=1; lTable<=lTableCount; lTable++ )
         pTable = m_Report->Database->Tables->GetItem(lTable);
         pTable->ConnectionProperties->DeleteAll();
         pTable->ConnectionProperties->Add("DSN", "Name of your DSN");
         pTable->ConnectionProperties->Add("Database", "Demo");
         pTable->ConnectionProperties->Add("Password", "sa");
         pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    // Log on the tables of the subreports.
    long lSectionCount = m_Report->Sections->Count;
    for( long lSection=1; lSection<=lSectionCount; lSection++ )
         ISectionPtr pSection = m_Report->Sections->Item[lSection];
         long lSubreportCount = pSection->ReportObjects->Count;
         for( long lSubreport=1; lSubreport<=lSubreportCount; lSubreport++ )
              IReportObjectPtr pSubreportObject = pSection->ReportObjects->Item[lSubreport];
              CRObjectKind crObjectKind;
              pSubreportObject->get_Kind(&crObjectKind);
              if( crObjectKind == crSubreportObject )
                   ISubreportObjectPtr SubReportPtr = pSubreportObject;
                   IReportPtr pSubReport = SubReportPtr->OpenSubreport();
                   long lTableCount = pSubReport->Database->Tables->Count;
                   for( long lTable=1; lTable<=lTableCount; lTable++ )
                        pTable = m_Report->Database->Tables->GetItem(lTable);
                        pTable->ConnectionProperties->DeleteAll();
                        //pTable->ConnectionProperties->Add("DSN", "dwcb12003");
                        pTable->ConnectionProperties->Add("Database", "CrystalEport_DB");
                        pTable->ConnectionProperties->Add("Password", "sa");
                        pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    If that doesn't work you need to tell us what is the error you are getting and paste in the code you are using.

  • How to Launch a Query from the Easy Access Menu

    Hello Experts,
    Once I have created, saved and tested my query how can I set it up so that my users can either type in a transaction at the Easy Access Menu or select my query from the Easy Access Menu and launch the query input screen that displays fields for:
    Reporting Period
    Selection Criteria - Personnel Number, Employment Status, Personnel Area etc.
    Program Selections - company code
    Output Format
    Thanks.
    Regards,
    Jeanette

    Hello Jeanette
    You may refer to following thread
    Assign transaction code to SAP Query (created via SQ01)
    Hope this helps
    Best Regards
    Reddy

  • How to execute sql file from servlet

    Hi,
    I am using JSP, Servlets and Oracle 8i in my application. I want to execute .sql file from java code. Is it possible to do that,
    as we execute .sql file from sql plus prompt.
    Suppose I have abc.sql file and I want to execute it from java code.
    If any body have the solution then pl. reply with sample code.
    Thanks,
    Rajesh

    If any body have the solution then pl. reply with
    sample code.No, no, dec - s/he doesn't want the actual solution, but the full code!
    /k1

  • Sample code of how to execute sql loader from visual basic

    Hi,
    Can anyone please provide me with sample code of how to
    run sql loader from inside a visual basic 6.0 application with Oracle 8.1.7.3 database or please point me to documentation/tech books containing such examples?
    Thanks very much
    John

    You have to use the command shell to activate a file.bat. The Shell command has the following parameters :
    Shell(Pathname, Windows Style )
    [email protected]
    Joel P�rez

  • How to remove business area from the Hyperion report

    Hi All,
    Kindly tell me the steps required to remove the business area from the Hyperion report.
    Regards,
    Ajay

    s

  • How to call a query from the backing bean ?

    Hi all,
    Another question for you guys :
    I made a jspx page with an input form and a submit button.
    When I click the submit button, the action my_action in my backing bean is executed.
    This is the code :
    public BindingContainer getBindings() {
    return BindingContext.getCurrent().getCurrentBindingsEntry();
    public String my_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("EmployeesView");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    I hoped that the query 'EmployeesView' was executed in this way, but I get the following exception :
    java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be cast to oracle.binding.OperationBinding
    So how should I execute the query EmployeesView ?
    Second part of the question : What if I typed the name an employee in my form, and I want to
    execute a query that selects all the Employees with that name ?
    How do I make a query with a variable as input in the WHERE clause ?
    Thanks in advance.
    Edited by: Facehugger on 7-apr-2010 11:15

    I'm still trying all the stuff you guys says, but still no result.
    This is my backing bean :
    +// the button action+
    +public String my_action()  {+ 
    +// get the selected rows from the multiselect table and store the objectid's in an String array+
    RowKeySet rks = graph_table.getSelectedRowKeys();
    Iterator itr = rks.iterator();
    Object key;
    int nbr_objects = 0 , i = 0;
    if (rks.size()>0)  nbr_objects = rks.size();
    +String[] objectid = new String[nbr_objects];+
    while(itr.hasNext())
    +{+
    key = itr.next();
    graph_table.setRowKey(key);
    Object o = graph_table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
    Row row = rowData.getRow();
    +objectid[i] = row.getAttribute("Objectid").toString();+
    i+;+
    +}+
    +// now get all the x and y values for these objectid's from the database out of the table history.+
    BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
    for (int j=0 ; j<nbr_objects; j+){+
    +// get X and Y values for object number j+
    DataPoints history = new DataPoints();
    OperationBinding operationBinding = bc.getOperationBinding("retrieveHistory");   ===> operationBinding stays NULL ???+
    +operationBinding.getParamsMap().put("OBJECTID", objectid[j]);+
    Object retVal = operationBinding.execute();
    +// ==> retVal should contain a List of all X and Y values for the provided objectid.+
    +// while (retVal has values)+
    +// {+
    +// List_of_x_values.add(retVal.valueX);+
    +// List_of_y_values.add(retVal.valueY);+
    +// }+
    history.add(List_of_x_values);
    history.add(List_of_y_values):
    +// call the soap method to do some calculations+
    methodname.forecast(history);
    +}+
    +}+
    In my application module :
    public void retrieveHistory(String objectid) {
    getHistory().setWhereClause("OBJECTID = '" + objectid + "'");
    System.out.println("current query : "+getHistory().getQuery());
    getHistory().executeQuery();
    public ViewObjectImpl getHistory() {+
    return (ViewObjectImpl)findViewObject("History");+
    The query for the VO History : SELECT * FROM HISTORY
    Please anyone ?
    Edited by: Facehugger on 9-apr-2010 14:19

  • How to execute SQL Instruction from Application Module

    Hi people
    I´d like to know how I can execute a SQL Instruction like "delete from user" from the Application Module ..prepareSession method...
    I´m Using Jdev 10 with ADF Faces
    thank you

    Hello,
    Code example:
    @Override
      protected void prepareSession ( Session session ) {
        super.prepareSession( session );
        setDebugOff();
      private static final String DEBUGOFF = "begin IVA_UI_ALGEMEEN_PCK.SET_DEBUG_OFF; end;";
      public boolean setDebugOff () {
        boolean success = false;
        PreparedStatement debugOffSP = null;
        try {
          debugOffSP = getDBTransaction().createPreparedStatement( DEBUGOFF, 0 );
          success = debugOffSP.execute();
        } catch ( Exception e ) {
          success = false;
        } finally {
          if ( debugOffSP != null ) {
            try {
              debugOffSP.close();
            } catch ( Exception e ) {
              log.warning( e.getMessage() );
        return success;
      }-Anton

  • How to use SQL Query from VC

    Hi all, with the adoption of SQ01 transaction, now I've a SQL Query defined in SAP R/3 system.
    How to use it with Visual Composer 7.0 SP14 ?
    Thanks in advance
    Gianfranco

    Hi ,
    It is simple to use quiery in Vc.
    Go for Find data control in Right side of  V.C .
    Enter System name:The system used for your quiery i.e R3 (Before u should mapp the R3 alias to the VC user in portal)
    Look for :Look for service by name.
    Service :Ur quiery
    Regards,
    Govindu

  • How to execute sql query stored in  a variable

    Hi
    define query = 'select * from abc;'
    then how to execute this defined variable query.
    Thanks,
    Shyam

    EXECUTE IMMEDIATE mmy_sql --(variable
    INTO     mmy_default_bill_type;
    by kumar.

Maybe you are looking for

  • I can't print web downloads, specifically pdf files, with Firefox.

    I get an error message if I try and look at the page in print preview which says: " Couldn't open the file. It may be corrupt or a file format that Preview doesn't recognize. " I can print the same pages in Safari. The only remedy I can see so far is

  • Live Type Template not displaying correctly in FCE

    I'm trying to use the "Ink Title" template from the Live Type Template Browser: File > Open Template > Template Browser. But when I import the .ipr file into FCE 3.5.1 it comes across with a transparent background and is not showing the artwork. I se

  • Lync Calling Integration

    Hi, I am wondering if someone could perhaps shed some light on this matter. Over the past few days we have tried using various Voip/Sip C# applications in attempt to initiate a call from these applications to a user running Lync. We are testing again

  • Webi Reports Prompts Order

    Hi, We have migrated BO 6.5.1 Webi report to Xi R2 and observed that the order of prompts is different between 6x and Xi R2. I don''t see any option to perform custorm display of prompts as custom prompt page does not show prompts defined in Universe

  • RDS 2012 R2 - RemoteApp Disconnected

    Hi RDS 2012 R2 Experts, I would like some guidance here if possible My setup is a follow. 1x 2012r2 with the following role, Broker, Web access, Gateway and License called RDS01 2x 2012r2 Session Host called RSH01 an RSH02 1x wildcard cert I would li