Search ConditionFormulas for hardcoded values.

Currently we have about 600 crystal reports in our system.  Over time there has been some poor coding that has hardcoded values in the suppression logic of sections or fields in some of the reports.  I am trying to programmatically look at each report and determine which reports need to be modified.
I query the infostore and have no problem looking into the DataDefinition.FormulaFields and ReportDefinition.Sections collections, but they do not show the suppression formula.  That is apparently in the ConditionFormulas collection.
I have seen some examples, but most of them have this comment,
' crRepDef is type CrystalDecisions.ReportAppServer.ReportDefModel.ISCRReportDefinition,
when I try to cast this object it fails.
Here is an example of what I have already, all reports are being accessed properly.  I just don't know how to get to the proper object (ConditionFormulas):
        Dim boEnterpriseSession As EnterpriseSession
        Dim boReportObjects As InfoObjects
        Dim boSessionMgr As New CrystalDecisions.Enterprise.SessionMgr()
        Dim crReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
        ' Log into BusinessObjects Enterprise
        boEnterpriseSession = boSessionMgr.Logon(txtCEUser.Text, txtCEPassword.Text, dropServer.SelectedValue, "secEnterprise")
        Dim query As String = "SELECT * FROM CI_INFOOBJECTS where si_name = 'my report' and si_instance = 0 And si_recurring = 0 and SI_PROGID='CrystalEnterprise.Report' ORDER BY SI_NAME"
        Dim boEnterpriseService As EnterpriseService
        Dim boInfoStore As InfoStore
        litResults.Text = Nothing
        'Create the Infostore Object
        boEnterpriseService = boEnterpriseSession.GetService("", "InfoStore")
        boInfoStore = New InfoStore(boEnterpriseService)
        boReportObjects = boInfoStore.Query(query)
        test(boReportObjects)
        For Each boReportObject In boReportObjects
            Dim rpt As ReportDocument = New ReportDocument
            rpt.Load(boReportObject, boEnterpriseSession)
            ' search each formula for hardcoded values
            For Each FormulaField As FormulaFieldDefinition In rpt.DataDefinition.FormulaFields
            Next FormulaField
            ' search each section for hardcoded values
            For Each sec As Section In rpt.ReportDefinition.Sections
            Next sec
        Next boReportObject

What is the error you get when the cast fails? I don't see any code trying to access the ConditionFormulas object.
I don't generally code in VB, but here's some C# code that accesses that property. You need to go through the ReportClientDocument object to get to it.
Notes:
- This is hardcoded. Logic is needed to generalize it for your own needs.
- You need CrystalDecisions.ReportAppServer.ReportDefModel to access the ConditionFormulas collection.
- The CD.CR.Engine assembly is aliased because both it and the ReportDefModel assembly contain a definition for the ReportDocument class. You can use the 'As' keyword for aliasing in VB, or fully qualify the assembly name for the variable declaration. (Personally I'd rather type less!)
using CrystalDecisions.ReportAppServer.ReportDefModel;
using CRENG = CrystalDecisions.CrystalReports.Engine;
//(other BOE references here to access InfoStore etc)
//(code here to log on to Enterprise, query for desired InfoObject, etc)
CRENG.ReportDocument crReport = new CRENG.ReportDocument();
crReport.Load(boeInfoObject, boeSession);
Response.Write("<br>Formula text: " +
    crReport.ReportClientDocument.ReportDefinition.DetailArea.Sections[0].Format.ConditionFormulas[CrSectionAreaFormatConditionFormulaTypeEnum.crSectionAreaConditionFormulaTypeEnableSuppress].Text.ToString());

Similar Messages

  • Enhancing standard (single select)search help for Multiple value selection

    Hi,
    Standard search help for Business Partner (in cProjects) allows only single value selection for input fields. I want to make this multiple selection.
    Is there a way to do it.
    I used an OVS and built a similar search but its difficult to get the standard options like saving to personal value list etc in it.
    It would be good if there is a way to modify the standard search help to allow multiple selection. Any ideas??
    Appreciate your help,
    Thanks,
    Sri
    Edited by: Sri on Sep 9, 2010 8:50 PM
    Edited by: Sri on Sep 9, 2010 8:52 PM

    As far as I know you can't make a standard ABAP dictionary search help return multiple entries - where you get this sort of functionality the searches don't use the standard Elementary search help framework (e.g. organisational structure searches)
    Given that the WDA search help relies on these dictionary based searches, I'd think very much that you couldn't enhance it to return multiple. how you could even return multiple entries into a single UI element input field is also confusing to me.
    I'd suggest creating a freely programmed value help, it would certainly take quite some effort to recreate those personal value lists etc, but it could be done - I don't like OVS, but that just me.

  • Issue in custom search help for Suggest Value

    Hi,
    I have a requirement to have the suggest values pick up the records form any par of the string. Basically, using pattern. I have written the code in search help exit and it work in some cases and doesnt work for others.Eg. The result shows up for 123 but doesnt show for 1234, even though 1234 exists and it had showed up when i keyed in 123.
    My select quest works fine and i can see the values in record tab but on the screen. What could be going wrong.
    Thanks in advance for your help.
    Pris.
    PS: the code:
    IF callcontrol-step = 'SELECT'.
        DATA:lwa_selopt TYPE  ddshselopt,
             lit_selopt_id TYPE RANGE OF yselxyz-builder_id,
             lwa_selopt_id LIKE LINE OF lit_selopt_id ,
             lit_selopt_desc TYPE RANGE OF yselxyz-builder_name,
             lwa_selopt_desc LIKE LINE OF lit_selopt_desc,
             lwa_header TYPE yselabc,
             lit_header TYPE STANDARD TABLE OF yselabc,
             lv_sel_val TYPE ddshselopt-low.
        READ TABLE shlp-selopt INTO lwa_selopt WITH KEY shlpfield = 'BUILDER_ID'."'DKEY'.
        IF sy-subrc EQ 0.
          lwa_selopt-option = 'CP'.
          CONCATENATE '*' lwa_selopt-low INTO lwa_selopt-low.
          MOVE-CORRESPONDING  lwa_selopt TO lwa_selopt_id.
          APPEND  lwa_selopt_id TO lit_selopt_id.
          MOVE-CORRESPONDING  lwa_selopt TO lwa_selopt_desc.
          APPEND  lwa_selopt_desc TO lit_selopt_desc.
          CLEAR:lit_header[],record_tab[].
          SELECT builder_id builder_name FROM yselxyz INTO TABLE lit_header
            WHERE ( builder_id IN lit_selopt_id )
           OR ( builder_name IN lit_selopt_desc ).
          SORT lit_header BY builder_id.
          DELETE ADJACENT DUPLICATES FROM lit_header COMPARING builder_id.
          CALL FUNCTION 'F4UT_RESULTS_MAP'
            EXPORTING
              source_structure  = 'YSELABC'
            TABLES
              shlp_tab          = shlp_tab
              record_tab        = record_tab
              source_tab        = lit_header
            CHANGING
              shlp              = shlp
              callcontrol       = callcontrol
            EXCEPTIONS
              illegal_structure = 1
              OTHERS            = 2.
          callcontrol-step = 'DISP'.
          EXIT.
        ENDIF.
      ENDIF.

    Issue Resolved. For less than 50 records, client side filtering takes over. In that case the search help exit will not come into picture. Issue resolved by avoiding client side rendering.
    callcontrol-maxexceed = 'X'.
    Thanks,
    Pris.

  • Search help for default value

    Hi all..
    I doing a dialog program. I need to have a search help in my input field. How can i do it?
    I want to have 3 default value in the search help.
    example: apple, orange, pear.
    How to retrieve it?

    hi,
    u can make drop down list
    declare that field as list box... ( in attribute )
    then write this after PAI in screen flow logic...
    PROCESS ON VALUE-REQUEST.
      FIELD ifmtp-form_type MODULE fm_drop.
    MODULE fm_drop INPUT.
      CLEAR ifmtp.
      REFRESH ifmtp.
      ifmtp-form_type = 'C'.
      APPEND ifmtp.
      ifmtp-form_type = 'F'.
      APPEND ifmtp.
      ifmtp-form_type = 'H'.
      APPEND ifmtp.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield  = 'FORM_TYPE'
          value_org = 'S'
        TABLES
          value_tab = ifmtp.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " fm_drop  INPUT
    here ifmtp-form_type is my field of screen which i have declared as list box...
    and u have to declare one internal table with this field in TOP Module...
    DATA : BEGIN OF ifmtp OCCURS 0,
              form_type LIKE zform_track_mast-form_type,
           END OF ifmtp.
    reward if usefull....
    Edited by: Dhwani shah on Jan 22, 2008 11:58 AM

  • Search Array with multiple values

    Hello,
    I've been helped with the prototype below by blemmo (thanks).
    It allows me to search my array using one property == a
    value.
    Now, I'd like to use it to:
    if ((prop1 == val1) &&(prop2 == val2) &&
    (prop3 == val3) {
    // search array for all values in array with the values of
    val1, val2 and val3
    Also, a way to search if one of the prop and val's are blank,
    ie...
    ((prop1 == val1) &&(prop2 == val2) && (prop3
    == val3)
    where prop2 and val2 are "undefined"
    so the search will only search for the prop and val that are
    not "undefined"
    make since? Don't know where to start.
    help and thanks in advance.

    it is an array like this.. but with more properties... also,
    is it better to use XML to load large arrays or is it ok to use
    actionscript in the file.
    which is faster to load? say if I had an array of 150
    elements?
    myArray = [{myname:"bob", county:"skagit", city:"Sedro
    Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"},
    {myname:"bob", county:"skagit", city:"Sedro Woolley", id:1,
    pic:"1.jpg",pic1:"2.jpg",pic2:"3.jpg",pic3:"4.jpg"

  • Variable vs hardcoded value in SQL query

    Hi Gurus,
    I have a SQL query inside a function that looks similar (i'm showing the "where" clause here only) to the below:
    WHERE ID = variable_id (by the way this two have exactly the same type, number(20))
    and
    WHERE ID = 100
    In the first option that uses variable it takes 4 secs to complete the query, while the second one that uses hardcoded value completes in milliseonds. Im new to oracle but been to other dbms and havent seen such behaviour. Anyone encountered or know what maybe the cause? I thought of not pasting here the explain plan since its just a question of variable vs hardcoded value.
    rgds.

    Just want to add something, here is the stats for the two queries:
    Statistics for variable_id (15 secs)
    29 recursive calls
    0 db block gets
    24324 consistent gets
    21556 physical reads
    0 redo size
    20676 bytes sent via SQL*Net to client
    613 bytes received via SQL*Net from client
    25 SQL*Net roundtrips to/from client
    17 sorts (memory)
    0 sorts (disk)
    358 rows processed
    Statistics for hardcoded value (5 secs)
    4 recursive calls
    0 db block gets
    2631 consistent gets
    0 physical reads
    0 redo size
    20469 bytes sent via SQL*Net to client
    613 bytes received via SQL*Net from client
    25 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    358 rows processed
    There are differences consistent gets and physical reads. What coul dbe the problem here?
    tnx!

  • Search Hardcoded values in Prg

    Hi All,
    I need to search for some Hard coded values inside the all Z PRograms.
    IS there any way to do it other than manaully use Find on each of Inclueds and main prg?
    I have 11 Company codes and respective VAT # for each.
    I have more than 1000 Prgrams with minimum 5-6 includes in each.
    Please suggest a way out.
    Regards
    Ramesh

    go to transaction SLIN, type the program name for which you ned to remove the hard cocded values , uncheck all the checkboxes and check only the
    " Character strings " check box... it will list all the hardcoded values in program...

  • How to get search help for 2nd  parameter based on the 1st parameter value

    Hi all!
       I have 2 parameters (material no, revision level). I have created a search help for revision level. It has an importing parameter :material no. and one exporting parameter : revision level.When I checked it, it's giving the revision values only for the specified.
    In my report , I have kept these 2 materials in my selection screen.For revision level , I have added the matchcode object which I have created. When I  pressed F4 for revision level, it's giving all the values irrespective of the material no. in the first parameter. How to solve it? Please suggest.

    Hi,
    Try this code filling internal table fields,
    DATA: BEGIN OF values,
            OID TYPE ZCL_OBJECT-OBJECTID,
            ODEC TYPE ZCL_OBJECT-OBJECT_DESC,
           END OF values,
           W_FIELD(10).
    DATA: ZCL_PROJECT-PROJECTID type zcl_project-projectid,
          ZCL_OBJECT-OBJECTID(5).
    DATA: progname TYPE sy-repid,
          dynnum   TYPE sy-dynnr,
          dynpro_values TYPE TABLE OF dynpread,
          field_value LIKE LINE OF dynpro_values,
          values_tab LIKE TABLE OF values.
    CALL SCREEN 100.
    *&      Module  VALUE_PROJECTID  INPUT
          text
    *MODULE VALUE_PROJECTID INPUT.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
          EXPORTING
               tabname     = 'ZCL_PROJECT'
               fieldname   = 'PROJECTID'
               dynpprog    = progname
               dynpnr      = dynnum
               dynprofield = 'ZCL_PROJECT-PROJECTID'.
    *ENDMODULE.                 " VALUE_PROJECTID  INPUT
    *&      Module  VALUE_OBJECTID  INPUT
          text
    MODULE VALUE_OBJECTID INPUT.
       CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname             = progname
                dynumb             = dynnum
                translate_to_upper = 'X'
           TABLES
                dynpfields         = dynpro_values.
      READ TABLE dynpro_values INDEX 1 INTO field_value.
    W_FIELD = FIELD_VALUE-FIELDVALUE.
      SELECT  OBJECTID
              OBJECT_DESC
        FROM  ZCL_OBJECT
        INTO  (VALUES-OID,
               VALUES-ODEC)
    WHERE PROJECTID = FIELD_VALUE-FIELDVALUE.
       APPEND VALUES TO VALUES_TAB.
    ENDSELECT.
       CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'OID'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'ZCL_OBJECT-OBJECTID'
                value_org   = 'S'
           TABLES
                value_tab   = values_tab.
    ENDMODULE.                 " VALUE_OBJECTID  INPUT
    *&      Module  INIT  OUTPUT
          text
    MODULE INIT OUTPUT.
      progname = sy-repid.
      dynnum   = sy-dynnr.
      CLEAR: field_value, dynpro_values.
      field_value-fieldname = 'ZCL_PROJECT-PROJECTID'.
      APPEND field_value TO dynpro_values.
      IF SY-UCOMM = 'BACK'.
        LEAVE program.
    ENDIF.
    IF SY-UCOMM = 'ANS'.
       LEAVE  TO SCREEN  '0'.
    ENDIF.
    ENDMODULE.                 " INIT  OUTPUT
    START-OF-SELECTION.
    WRITE: / field_value-fieldvalue,
             W_FIELD.
      LOOP AT VALUES_TAB INTO VALUES.
        WRITE / VALUES.
      ENDLOOP.
      if sy-subrc <> 0.
        WRITE / field_value-fieldvalue.
      endif.
    Plzz reward points if it helps

  • Search help for a field in table control based on another field value

    Hi,
    I want to attach the Search help for a field in table control based on another field value.
    Please help me asap.
    Will be highly rewarded

    HI,..
      Check these links
    search help in table control
    Re: How to create Search Help for a field in Table control !!
    How to create Search Help for a field in Table control !!
    F4 Help In Table Control
    Control table F4 help
    Problem in F4 help in screen field
    check this code
    DATA: BEGIN OF it_value4 OCCURS 0,
             TEXTCODE  LIKE  ZXX-TEXTCODE,
             TEXTDESC  LIKE  ZXX-TEXTDESC,
           END OF it_value4.
      progname = sy-repid.
      dynnum   = sy-dynnr.
             SELECT TEXTCODE TEXTDESC
               FROM  xxxx
               INTO CORRESPONDING FIELDS OF TABLE<b> it_value4</b>
              WHERE  LOSS_CODE =<b> IT_VALUE1 .</b>
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'TEXTCODE'
          dynpprog    = progname
          dynpnr      = dynnum
          dynprofield = 'ITVALUE-TEXTCODE'  "-->UR  4 th filed value in screen
          value_org   = 'S'
        TABLES
          value_tab   = it_value4.
    endmodule.
    Message was edited by:
            veereshbabu ponnada

  • Search Help for input field2 based on value entered in input field 1

    Hi All,
    I have a requirement where in my view, i have two fields.
    1. PO
    2. PO Item
    For PO i could get the standard search help from DDIC, but i need to provide search help for PO Item based on PO selected.
    How can i do that. Any help is highly appreciated.
    Thanks,
    Ajay

    Hi Ajay ,
    following steps cn help u :
    1 Declare the WDR_OVS Component in the used component list in your WD component .
    2  Now go to the View, in the Properties Tab click the Create Controller Usage Button.
    3 It will open a screen with Component Use Entries. There select the Component Use OVS with Interface Controller . Press Enter.
    4 Go to the Context Tab, Right Click the Context and select Create à Attribute , for PO item in ur case .
    5 In the Input Help Mode Field, Select u2018Object Value Selectoru2019 from the dropdown. Then press F4 in the Field OVS Component Usage.
    6 Declare one event handler method with Name ON_OVS in the Method tab of the view. Then Press F4 in the Column Event. 
    Select the Event OVS as shown below and Press Enter. 
    for more info and illustration , also refer :
    http://help.sap.com/saphelp_erp2005/helpdata/EN/30/d7fa41c915da6fe10000000a1550b0/content.htm
    https://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://wiki.sdn.sap.com/wiki/display/Snippets/OVSSearchHelpinWebDynproAbap
    regrds,
    amit

  • How to search for a value in an iterator in Jdev 10.1.2?

    Hi!
    I need to search an iterator named "PermitYrIterator1" for a year value (e.g. 2009) that is stored in bindings.Yr in my jsp. How do I do this in my jsp's DataForwardAction Code) in Jdev 10.1.2?
    I need this in my "Create page." I need to search for this value because I want to check if I should re-execute the "PermitYrIterator1" so that it shows the newly added year in bindings.Yr or not. If bindings.Yr is found in the iterator then I do not need to re-execute the iterator. But if the newly entered year cannot be found then I need to re-execute the iterator.
    I hope you can help me immediately! Thanks!

    Hi,
    Anyone can help me on this please?

  • How to search for a value within a tolerance in an array?

    I am trying to search in an array for a value of say 10 plus or minus 2. In other words, I want a value of true if there is any value in the array between 8 and 12.

    canadian;
    LabVIEW includes with a VI called In Range and Coerce. You can test the value using that VI.
    I also created a VI for exactly that. You can download it from here:
    http://www.jyestudio.com/lview.shtml
    It is called Search 1D array using conditions. Let me know if it is useful. Even more efficient, you can look at the code of that VI and then extract the functionality you want for your application.
    Regards;
    Enrique
    www.vartortech.com

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • How to assign search help for an input field by fetchign values from an int

    i have an input field ,
    i want to assign search help for the same by fetching values from a table.
    how to achieve this ?

    Using the below ways you can assign search help to a field.
    1) [OVS Search Help|http://wiki.sdn.sap.com/wiki/display/Snippets/OVSsearchhelp]
    2) [Freely Programmed Search Help|http://wiki.sdn.sap.com/wiki/display/WDABAP/Freelyprogrammedinput+help]
    3) Dictonary Help - Use the Data element for that purpose.

  • Creating search help for AFNAM, and display the hit list with values only

    Hi guys,
    I have created a search help for AFNAM, but the hit list displays all even if it is blank.
    I want to display in the hit list the AFNAM with values and do not diplay the blank values...
    Is it possible? How am i going to do it?
    Thanks!
    Mark

    Hi Mark,
    After selecting data use this statement.
    DELETE it_table WHERE AFNAM is initial.
    Regards,
    Suneel G

Maybe you are looking for

  • Error while querying plsql table.

    create table emp(eno number, ename varchar2(20), sal number(10,2), dno number); create table dept(dno number, dname varchar2(10)); DECLARE TYPE EmpTabTyp1 IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER; emp_tab1 EmpTabTyp1; l_str_name varchar2(20);

  • Can I connect a modern LCD to an early G4?

    I have an early G4 with an AGP Rage 128 Pro graphics card with 16 Mb VRAM. My CRT monitor is dying and I would like to replace it with an LCD monitor. When I look at the monitor settings I have available in System Prefs, the highest is 1600 x 1200. I

  • Inputs From Hi-End Analog Audio -- A/D Conversion

    I would like to transfer rich, warm analog sound from vintage McIntosh equipment, Ortofon MC, from records, 78s, and cassettes to digital form. I know that in the music industry, stand-alone analog to digital converters are used. How do I find an "au

  • Regarding error in my program

    In the program, when i extend z class i got an error.so when i put an z(){} its working.But the same program when i dont extend class z im not getting the error.why is it so? kindly help me class z int x; z(int a) { System.out.println("parentconstruc

  • Last record entered

    hi all, In the detail block i have 5 records to be entered.Now i want retieve the last recordentered wherever primary key in the detail is codes only,(i mean no serial). Best Regards, Hany