Crystal Reports XI - How to pull same column value with different select...

I have a report with many (around 30) sub reports and it is giving serious performance issue. I am currently finding out a strategy to improve the performance. I see that most of the sub reports are taking same parameters from main report except for one parameter which is different for each sub report and hard coded in them and pulling up the same column value from a oracle database with a different select criterion. I am trying to find out a way using either of command/crystal formula/SQL expression which can do the same job for me and give me performance improvement. I tried to take the parameters from the main report in one sub report and mapped them to parameters being transferred to the command and then drag and drop the field for which I need to display the value but due to some reason it is not returning values when I am trying multiple commands...I need some help in selecting a strategy for this issue resolution and some guidance....Any help would be highly appreciated....

My version is 11.5.8.826. First of all I need to make it clear that I have 6 set of sub reports and each set has 5 sub reports. So if I can resolve the issue for one set, I resolve it for all. The sub reports are doing nothing but fetching a column value using a simple SQL SELECT query and appending to the right of a box in main report. The issue is that all these queries embedded into the sub reports are using same SQL except for one parameter in the "where" clause and they are fetching same column value from the database and fortunately all of them are returning same number of results. So at the end these results create a table when run. The only way I can stop using sub reports is by creating a table in the main report and use some object(formula/command/SQL expression or whatever) to fetch that column value using the same filter conditions. But please take a note that I need to use and append the same column value from a database table and use different filter conditions and append them to the right so that at the end they create a table...as long as I get the table in the output with a decent performance , anyone will be least bothered about what I used inside the report.....please ask me as many questions to get more lights on the issue....

Similar Messages

  • How to pull only column names from a SELECT query without running it

    How to pull only column names from a SELECT statement without executing it? It seems there is getMetaData() in Java to pull the column names while sql is being prepared and before it gets executed. I need to get the columns whether we run the sql or not.

    Maybe something like this is what you are looking for or at least will give you some ideas.
            public static DataSet MaterializeDataSet(string _connectionString, string _sqlSelect, bool _returnProviderSpecificTypes, bool _includeSchema, bool _fillTable)
                DataSet ds = null;
                using (OracleConnection _oraconn = new OracleConnection(_connectionString))
                    try
                        _oraconn.Open();
                        using (OracleCommand cmd = new OracleCommand(_sqlSelect, _oraconn))
                            cmd.CommandType = CommandType.Text;
                            using (OracleDataAdapter da = new OracleDataAdapter(cmd))
                                da.ReturnProviderSpecificTypes = _returnProviderSpecificTypes;
                                //da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
                                if (_includeSchema == true)
                                    ds = new DataSet("SCHEMASUPPLIED");
                                    da.FillSchema(ds, SchemaType.Source);
                                    if (_fillTable == true)
                                        da.Fill(ds.Tables[0]);
                                else
                                    ds = new DataSet("SCHEMANOTSUPPLIED");
                                    if (_fillTable == true)
                                        da.Fill(ds);
                                ds.Tables[0].TableName = "Table";
                            }//using da
                        } //using cmd
                    catch (OracleException _oraEx)
                        throw (_oraEx); // Actually rethrow
                    catch (System.Exception _sysEx)
                        throw (_sysEx); // Actually rethrow
                    finally
                        if (_oraconn.State == ConnectionState.Broken || _oraconn.State == ConnectionState.Open)
                            _oraconn.Close();
                }//using oraconn
                if (ds != null)
                    if (ds.Tables != null && ds.Tables[0] != null)
                        return ds;
                    else
                        return null;
                else
                    return null;
            }r,
    dennis

  • How can I replace column value with a particular value in SQL

    Hi All,
    Can anyone please tell me how can I format my output with replacing a column value with a specific value which actually depends on the present value of the column
    I am executing the following SQL statement
    select state,count(id) from <table_name> where composite_dn= <composite_dn_name> group by state;
    My Present output is:
    State No.Of Instance
    1 3
    3 28
    I want to replace the value in the column state as follows
    State No.OfInstances
    Completed 3
    Faulted 28
    I want "1" to be reppaced by "Completed" and "3" to be replaced by "Faulted"
    Is is possible with SQL or PL/SQL , if it is then how can I achieve this required result. Please help!!
    Thanks in Advance!!
    Edited by: Roshni Shankar on Oct 27, 2012 12:38 AM

    Hi Roshni,
    I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
    Refer -- http://www.techonthenet.com/oracle/functions/decode.php
    select decode(t1.state,t2.state_id,t2.state_name), t1.count_id
    from <table_2> t2, (select state,count(id) count_id
    from <table_name>
    where composite_dn= <composite_dn_name>
    group by state) t1
    where t1.state = t2.state_id;HTH
    Ranit B.
    Edited by: ranit B on Oct 27, 2012 2:02 PM
    -- link added
    Edited by: ranit B on Oct 27, 2012 2:19 PM
    -- sample code added

  • How to Use Same Asset Number with Different Sub-number

    Hi
    We want to sell some assets and buy them back on lease. We want to use same Asset number with different sub-number under the same company code. This new asset will be under different Depreciation Area (Statistical).
    We use external numbes for assets . And same asset number range is used by all compnay codes.
    Please suggest whether this is possible & how.
    With Regards,
    Nitin

    Hi,
    Go to field status for asset master data section and change the field status to optional for field Deactivation date, then follow the below steps.
    You can create an sub asset number to an asset, which is already deactivated by retirement as like normal sub asset creation with AS11.(While creating sub number, you need to remove cap date and deactivate dcate field manually from asset master)
    With this you can get new asset number as same as your old retired asset main number and but sub number will be different.
    To post to diff dep area, other than 01, then you first create an acq transaction type, which will post only to specific areas and then use the new asset number in ABSO to post acq with your custom TTY.
    I have tested and found working well in my system............Try now in your test client
    Thanks,
    Srinu

  • How to color single column cells with different colors in classic report based different conditions

    Hi ,
      Am working on Oracle Apex 4.2 version. Am trying to generate a  classic report with different cell colors based on the conditions.
      I tried the solution provided in the below link.
      https://forums.oracle.com/message/9518723#9518723.
      I tried the same query given in that link.
       SELECT e.*,
      CASE
        WHEN sal < 1000
        THEN 'red'
        WHEN sal BETWEEN 1000 AND 2000
        THEN 'yellow'
        WHEN sal > 2000
        THEN 'green'
      END the_color
    FROM emp e
      And, I hidded the column 'the_color' in Report Attributes,
              the Column Template1 has the code , <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#">#COLUMN_VALUE#</td>.
    After this, what are the steps did I miss here. Because am not getting the report which I need.
    Kindly do provide solution.
    Thanks,
    yashu.

    SAL column values should visible with different color based on the conditions. Same way i did in my report it was working for me. Please refer the below links for more information,
    https://forums.oracle.com/thread/1047891
    http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:351800346145832
    Thanks
    Lakshmi

  • Mapping different same column value into different column based on conditio

    Hi experts,
    We have source as Oracle tables and target also Oracel tables.
    Source
    Column1|Column2|Column3
    Target
    trg1|trg2
    I need to
    insert the value of Column1 into trg1 where column2='xxx'
    insert the value of column1 into trg2 where column3='yyy'
    After giving the conditions on the mapping, the where conditions are getting clubed with and and I am getting different value than what is excepted. Like the similar way I have the same scenario for most of the columns in my target table. Suggest me how to do it.
    Thanks in advance.

    Hi,
    I tried the mapping but getting duplicate records.
    case1: Only AND condtion is getting applied automatically as per the joins between tables..i m not able to change the AND to OR condition since there are three table joins.
    case2: when i try to execute the separate query for the column, i getting the values once put in case statement only NULL values are getting fetched.
    As all my target mapping are like this...lot of issues are getting raised while fetching records...
    I have given my scenario once again below.
    src1
    col1
    src2
    col1
    col2
    col3
    col4
    src3
    col1
    tar1
    col1
    col2
    mapping given are
    tar1.col1 = select src2.col3 where src2.col1='xxx' and src2.col2='yyy' and src2.col4=src1.col1
    tar1.col2 = select src2.col3 where src2.col1='aaa' and src2.col2='bbb' and src2.col4=scr2.col1
    Kindly suggest how to do the mapping in details...I am stuck bcoz of this mapping......thanks in advance.
    Edited by: siva on Nov 23, 2011 12:34 PM

  • How to add one column value with grand total

    hi,
    this is my perform.i am just here multipling  menge and gpres value and stores into G_total variable and displing into output.
    this is my output in main window.
    ex:mat. 1           77.00(g_total value)
        mat  2             55.00(g_total value)
    now the requirement is to add the column and display the output as grand total ex: 77.00 +55.00 = 132.00
    how to do the syntax please help me......???
    FORM get_total  TABLES   in_tab STRUCTURE itcsy
                              out_tab STRUCTURE itcsy.
      DATA: lv_menge(20),
            lv_gpreis(20),
            g_total(20),
            g_total1(20).
      DATA:lc1 TYPE string,
           lc2 TYPE string,
          ls_tab      TYPE itcsy,
         l_tabix        TYPE sy-tabix.
      READ TABLE in_tab WITH KEY name = 'RESBD-MENGE'.
      IF sy-subrc EQ 0.
        lv_menge = in_tab-value.
      ENDIF.
      READ TABLE in_tab WITH KEY name = 'RESBD-GPREIS'.
      IF sy-subrc EQ 0.
        lv_gpreis = in_tab-value.
      ENDIF.
      REPLACE  ',' INTO  lv_gpreis WITH ''.
      CONDENSE lv_gpreis NO-GAPS.
      READ TABLE out_tab WITH KEY name = 'G_TOTAL'.
      IF sy-subrc EQ 0.
        g_total = lv_menge * lv_gpreis.
        out_tab-value = g_total.
        CONDENSE g_total.
        lc1 = g_total+0(2).
        lc2 = g_total+2(3).
        CONCATENATE lc1  lc2  INTO g_total SEPARATED BY ','.
        out_tab-value = g_total.
    CLEAR ls_tab.
        LOOP AT out_tab INTO ls_tab.
          l_tabix = sy-tabix.
          CASE ls_tab-name.
            WHEN 'G_TOTAL'.
              ls_tab-value = G_TOTAL.
          MODIFY out_tab FROM ls_tab INDEX l_tabix.
    ENDCASE.
        ENDLOOP.

    >
    asissahu wrote:
    > hi.
    >
    > nobody is replying my question???
    >
    > please help me
    Hi, Asissahu
    Because may be some one have problem to read your code
    Please have a look at the following link and past code this way.
    [How to post code in SCN|How to post code in SCN, and some things NOT to do...;
    @Naga Please you too
    Regards,
    Faisal

  • How to display a column value with in string?

    Hai all,
    Select name from TAB1;
    output:  JAGAN
                RAMU
                SIVA
                Sanjay
    So my requirement is to display these data in string(With in single Quotes) like below.
               ' JAGAN'
                'RAMU'
               ' SIVA'
                'Sanjay'
    Let me know if it is possible.......
    Thanks in Advance.....
    Jagadekara Reddy

    Like this ,
    SELECT ''''||ENAME||'''' FROM TAB1;
    Cheers!

  • Column values with invalid characters

    How to find the column values with invalid chararcters
    meaning value upper(col) not in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
    For ex.
    1. CDAssyKit,DragonNaturallySpeaking�Preferred7.0,USEnglish
    2. CDAssyKit,DragonNaturallySpeaking Preferred7.0,USEnglish
    Query should retrieve only the first row, since it has extra � character in the column value.
    Thanks for your help.

    Convert all letters and numbers to an arbitrary letter and then remove that letter. If there are any characters left, they are invalid according to your rules.
    select *
      from t
    where replace(translate(lower(column_name), 'abcdefghijklmnopqrstuvwxyz0123456789', 'a'), 'a') is not null;

  • Crystal reports 2011 failure to pull the master data for AP Items

    I am using businessobjects 4.0 and i am also running crystal report 2011.I am connecting to a sap erp ecc 6.0 ehp4 without any issue.The challenge comes when trying to input or pick the master data for example company code .The crystal report does not populate the company code field with master data.Any suggestions?

    Hi Venkateswaran,
    FIrst of all thanks for offering help...
    uploding screen shots, below mentioned screens are captured when I was creating a new report on CR2011, usning SAP standard table "T001", there is no parameters, it is simple report but I didnot get data, if i browse the field through Cystal report is says Data Size is 0.
    I also would like to inform you that If i use crystal report 2008 SP3 for same ERP, Same table and same fields, then i get proper data/report.

  • 2 same surrogate keys with different filter conditions in one report

    how do we put 2 same sr keys with different filter conditions in one single report??
    for example, we have to get the 'count' for tm_sr_key:
    1. count(tm_sr_key) where past_due_flag = Y
    2. count(tm_sr_key) where past_due_flag = Y and N
    to be displayed in one single report.
    it happens that both sr_keys will display the same measure (which is the 1st filter conditions)
    and the filter under criteria tab in anwer will show as :
    tm_sr_key where {filter condition 1}
    AND
    tm_sr_key where {filter condition 2}
    instead of :
    tm_sr_key where {filter condition 1} for 1st measure
    tm_sr_key where {filter condition 2} for 2nd measure
    d only option i could think right now is to duplicate the tm_sr_key data in the same table but with different name say, tm_sr_key_2..
    kindly pls help.
    thanx

    i'm sorry, not really understand.
    could you pls explain a bit more about the filter column? how do we do it? coz i'm really new in this tool.
    r u talking about editing the filter located under the column on the right side of the OBIEE answers?
    or is it by editing the 'edit column formula' for required column; that is by replacing the 'column formula' expression with this:
    FILTER(EXPS_FACT.FAC_SR_KEY USING EXPS_FACT.PAST_DUE_FLAG = 'Y') <----if it is like this, i tried it already & its giving me an error message..
    thanx.
    Edited by: rezza.nasha on May 28, 2009 1:26 AM

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How to refer a column value of a single row in conditional column display?

    Hello,
    does anybody have an idea, how i can refer a column value of a single row in conditional display of a column?
    So my idea is, that a report has a column, which value is only displayed, when another column value of this row has a specific value.
    I want to solve this problem with condition type: PL/SQL Function Body returning a boolean.
    But I do not know how to refer the column value of each single row!
    Thank you,
    Tim

    Here's a solution that, to me, seems easier to implement but, that's, of course, in the eye of the implementer.
    Rather than using APEX to generate a link column for you, actually create the link as part of your SQL.
    select '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>' CONTACT_LINK, ...
    etc.
    Test this out. You'll see that it works just like making a column a link using the column attributes.
    Next, we'll change the SQL to use a DECODE statement to either display the link or nothing depending on what your criteria is. For example, let's assume you only want a link for active contacts.
    select Decode( CONTACT_STATUS, 'A', '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>', NULL ) CONTACT_LINK, ...
    etc.
    This will not display the link in any rows in which the CONTACT_STATUS is not active, i.e. "A"
    -Joe

  • Launch a Crystal Report Based on a Bus. Objects Universe with code

    Post Author: BobM
    CA Forum: .NET
    Launch a Crystal Report Based on a Bus. Objects Universe with code
    We have purchased Business Objects Enterprise XI R2 and have designed a universe.  We have hundreds of scheduled reports that have been configured through the InfoView.  The problem is that we run these reports on a very odd date schedule and it is extremely cumbersome to go into these report definitions and change the dates in InfoView.
    We would like to be able to store all the report parameters in a table (outside of the BO universe) along with the date and time we would like it to run.  All of this would need to be tagged with the report name so we know what report we are referring to.  Then we would like to sweep this table periodically (or use some other triggering mechanism) and launch the reports as specified (hopefully) using an API/SDK (like the one that used to be available with Crystal) to launch the .RPT file and pass all of the appropriate parameters, and possibly the credentials if need be.
    In short we want to roll our own report scheduler due to some limitations we have found in the InfoView scheduler.
    My main question is, does an API/SDK exist that can launch a crystal report that is based on a Business Objects Universe?  As I had stated, it needs to be able to pass parameters in the report call.  Based on my previous projects using Crystal connected directly to a SQL Server DB, I beleive this is possible, but I would like to hear from others that may be doing something similar with a Business Objects Universe back end.
    We are using Crystal Reports XI R2.  Just to be clear, all of the functionality I specified up to the point where the report needs to be called is not an issue, we know how to do all of that.
    Thanks in advance,Bob
    Code; API; Business Objects; Universe; Crystal; BO Enterprise X11; Crystal Reports XI

    With the code, you've presumably logged on to the database. To insert objects on to a new report you'd want to use code along the following lines:
    private void AddTableFromDataSet(ref CrystalDecisions.CrystalReports.Engine.ReportDocument rpt, System.Data.DataSet ds)
    ISCDReportClientDocument rasReport = rpt.ReportClientDocument;
    // Convert the DataSet to an ISCRDataset object (something the ISCDReportClientDocument can understand)
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRDataSet rasDS;
    rasDS = CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.Convert(ds);
    // Add the dataset as a data source to the report
    rasReport.DatabaseController.AddDataSource((object)rasDS);
    // Add a field to the report canvas
    // Note: This is quick and dirty. No positioning, resizing, formatting, etc.
    CrystalDecisions.ReportAppServer.Controllers.ISCRResultFieldController rfc;
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable crTable;
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRField crField;
    rfc = rasReport.DataDefController.ResultFieldController;
    crTable = rasReport.Database.Tables[0];
    crField = crTable.DataFields[2]; // Hardcoded field "Customer Name" in the Customer table from Xtreme Sample Database
    rfc.Add(-1, crField);
    // Save the report template to disk (without data)
    //object path = @"c:\documents and settings\administrator\desktop\";
    //rasReport.SaveAs("test.rpt", ref path, 0);
    //MessageBox.Show("Done!");
    For more info, see sample apps on the following link:
    http://wiki.sdn.sap.com/wiki/x/IgBmBQ
    Also, consult your 'Report Application Server .NET SDK Developer Guide" and  "Report Application Server .NET API Guide". I'd provide the appropriate links, but you do not mention the version of CR you are using...
    Thread moved to the '.NET - SAP Crystal Reports" forum.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Error updating Process Form: Same Column exist with a different variant

    Hi All,
    I have a process form of a resource with following fields :
    Name VariantType Length FieldLabel FieldType Order
    UD_EDIR_BWUSER   boolean       1          BWUser    Checkbox      25
    UD_EDIR_ISUUser    boolean       1          ISUUser    Checkbox      26
    Now, I have to changes these field from boolean to string. For that, I created a new process form version and update like this:
    1. Delete these fields first.
    2. Add two new fields:
    UD_EDIR_BWUSER String 4 BWUser Textfield 25
    UD_EDIR_ISUUser String 4 ISUUser Textfield 26
    Now, when I tried saving the form, I got following error
    Same Column exist with a different variant in current or previous form.
    I also tried creating again a new version of process form and tried updating these field instead of re-creating them but I was able to update the FieldType only ( not able to update the Variant type and length).
    If anyone know how to resolve this issue, please reply.
    Cheers,
    Sunny

    Hi Rajiv,
    Thanks for the reply. I re-created these field in a new version but gave a different name this time like this:
    UD_EDIR_SAP_BW_USER String 4 SAPBWUser TextField 25
    UD_EDIR_SAP_ISU_USER String 4 SAPISUUser TextField 26
    and it worked for me.
    Cheers,
    Sunny

Maybe you are looking for

  • How to use iPhoto on Mac and iOS in conjunction

    I'm using iPhoto on both my Mac, iPhone and iPad. After the new Photo Stream and the new iPhoto iOS app has been released I think it is all started to get a little confusing. Here is some of my thoughts. 1) When I delete a photo from my Photo Stream

  • What is a "Plus" member and how do I become one?

    I recently opened a project in Premier Elements 10. It is a project I have used and reused over the last three years. When I opened it, I found out that the theme I used, Picture Cube, is now considered only for Plus Members and it will not load. I c

  • Data Source Lookup fails

    The problem is that I get an class cast exception when doing a data source lookup. I need to know why this is happening and what can be done to avoid the exception. I have provided the following sections to document the run time environment: 1.     T

  • I just need to get my licenses again, adobe was taken off of laptop

    Laptop, due to freaking Windows 8, had to do a refresh and Adobe was uninstalled, need to get my license again so I can use the program I paid for again. Thanks

  • My apps won't work correctly

    Since the update my iPad doesn't want to open Simpsons tapped out. Not sure if it is a problem with the app or the update