Select expert - 'A string is required here'

Post Author: greg_zen
CA Forum: Formula
Hi All,
in select expert I put code like below:
1)
'{sp.ContractNo} like {?ContractNo}' 
          where ?contractNo is a parameter declared as a 'string'
It worked fine with Crystal Enterprise 10 SP3
After coping all reports and stored procedures to another server and installing SP6  for Crystal Enterprise 10 it stopped working.No idea why.
So I tried to replace select formula like this:
2)
if cstr({?ContractNo})="" or cstr({?ContractNo})="*" or IsNull({?ContractNo}) then True
first I used it without cstr function but after running there was always 'A string is required here' error message. Adding cstr didn't helped. Still the same.
Original select was based on 'like' keyword to make it possible to enter starting character or just a part of string.
As because users in most cases want to select data for all Contracts, select 2) was acceptable or at least I wanted to see anything. No way,
still the same error 'A string is required here' during the runtime.   
Any idea what's going on ?
I'd appreciate any suggestions and comments.
Regards,
greg_zen 

Post Author: SKodidine
CA Forum: Formula
For your first formula, why not try with wildcards and see if it works, since you mentioned that the intent was for the user to enter a part of a string?
Try one of these:
{sp.ContractNo} like {?ContractNo} & '*'     // for any number of characters
{sp.ContractNo} like {?ContractNo} & '?'    // for a single character
For the second (re-write) formula, make sure that the NULL condition is always checked first.
if IsNull({?ContractNo}) or cstr({?ContractNo})="" or cstr({?ContractNo})="*" then True

Similar Messages

  • A string array is required here

    i have a numberic parameter which allows multiple selection
    i want to join the parameters in the report header to display the values selected
    i use this
    if ({?Salesperson})='ALL' then 'ALL' else 
    join ({cust.CTTX40},', ')
    i get a stringarray is required here.
    ({?Salesperson}) is a string
    cust.CTTX40 is a string
    how do i get it to work

    Hi Sharon, 
    I tried this a couple of different ways including looping with Basic syntax and none will work if  you do not already have an array. 
    Join only works with string arrays and CTTX40 isn't an array. 
    Dim MyArray
    Dim i
    i = 1
    MyArray = ""
    Do While i <= 14
        myArray = myArray & ToText ({CC_CLTBL.TBCMSC}, 0, "", "") & ", "
        i = i + 1
    Loop
    formula = myArray
    I tried creating a looping formula and it looped fine but because it was in the Report Header, I got the same value in each element.  This is because the Report Header can only see the first record in the recordset. 
    If I dropped this into my Detail section it would work fine because it's getting each record and appending it. 
    Really, the only way to do what you want would be with a subreport, link the parameter to it and create a running total like: 
    WhilePrintingRecords;
    Shared StringVar myArray;
    If {?pm-Salesperson} = "ALL" Then myArray := "ALL"
    Else myArray := myArray & ", " & {cust.CTTX40};
    Drop this into the Detail section of the subreport and then you can use the myArray in your main report or just display it. 
    Good luck,
    Brian

  • Crystal Rpt XI - Select Expert record limits

    Newbie here - please be gentle
    There appears to be @ a 500 record limit that can be used in the formula editor. Is there a way to work around this limit or is it greater in later versions?
    Example;
    {Mrpa99.Pat_Ext_ID} in ["0001400126", "0001401652", "0001402718", "0001402742",......... , "0001665341"]
    would return 'TOO MANY RECORDS' if I had all my desired record sets (@ 700), but if I removed half it would work fine.
    If there is no way to get all values in a single report is there a way to merge the results into a single report.
    Thanks in advance,
    Cj

    First try to push down this filter to DB level if possible, this will improve your report performance.
    Try creating 2 or more formulas that contain those long string separately.
    and write below codes in your select expert: {Mrpa99.Pat_Ext_ID} in formula1 or in formula2 or in ...formulaN.
    Thx, Hao

  • Crystal 2008 problem with Record Select Expert

    I had a Crystal 10 report that worked fine where the Record Select Expert had a database table ID equal to a parameter... it was only supposed to report on 1 record.  After using Crystal 2008 on the same report it completely ignores this Select Record Expert setting.  I have tried deleting and re-adding the parameter.  It acts like there is no record select setting.
    Here is the formula that it shows me it is using:    {Components.ID} = {?@ID}
    If I go to the application opening the same record on a different machine using the old crystal, it works fine.
    This used to only show me the 1 record, now it shows me the report on every record in the table.  I tried upgrading the report to a 2008 report and it still does the same thing.  The report filter no longer works.   Do I need to do something different to select only 1 record in 2008 ?
    After installing Crystal 2008 on my computer none of my reports work correctly anymore - all of them are ignoring my Record Select ...they worked fine before I installed 2008.  The reports are older reports... they worked fine when I had Crystal XI R2 installed.  This all started after installing Crystal 2008
    Thanks,
    Jeff
    Edited by: Jeff Dressing on Aug 27, 2008 12:06 PM

    Hello, Jeff;
    I noticed the Record Selection Formula uses a Stored Procedure parameter:
    {Components.ID} = {?@ID}
    A parameter created in the report (not by a stored procedure) would be:
    {Components.ID} = {?ID}
    A report based on a Stored Procedure does not need a Selection formula for the Stored Procedure parameter. Connecting to the Stored Procedure automatically creates the parameter in the report and the value is passed automatically when the report is run.
    Does the report work in the Crystal Reports 2008 designer?
    Open the report in the designer. Go to Database Set Datasource location. Are the properties of the database at runtime still the same as what is saved in the report.
    If the database is different at runtime, just as a test, change to the new database in a copy of your original report. Do a Database|Verify Database. Does it come back the "Database is uptodate" or are there changes?
    Elaine

  • Crystal Report - Title from Select Expert.

    Hi Experts !
    I need some help here. Recently I have build a new crystal on the production analysis. Part of the select expert for record is between posting date A and posting date B.
    Below is the code I uesd for the select expert whereby Posting Date 1 is a parameter with range that I have defined.
    {ODLN.DocDate} = {?Posting Date1}
    I am interested to have this 2 date from the parameter to appear on my report. For example :
    Date: A date till B date.
    I have tried picking up this data from the parameter, but failed to get what I want. Anyone have syntax for this ??
    Best Regards,
    Alex

    Hi Gordon,
    Yeah, I know the syntax to do this. The real problem lies as I have stated on my first post - I want the date that I have entered on the parameter during the filtering process, to appear on the report itself. I have tried it before, but all that appears is only True value, not date.
    So If, I am about to use two parameter date instead of parameter range with selection expert, will I be able to pull the two parameter date into the report, so that I can print it out with the date on the report itself. It's important for the report to have date because not everyone knows the report is from when to when.
    Best Regards,
    Alex

  • Crystal Reports XI:  Using Wilcards with the Select Expert

    I have a field with 10 numbers.  There are several of them that start with three numbers and end in all zeros.  I want to make sure these are not in my report.  I have been successfully able to do this using the select expert, but it requires a lot of manual entry:
    {@Phone Number} <> "4090000000" and
    {@Phone Number} <> "2810000000" and
    {@Phone Number} <> "8320000000" and
    {@Phone Number} <> "5120000000" and
    {@Phone Number} <> "9999999999" and
    {@Phone Number} <> "9760000000" and
    {@Phone Number} <> "9360000000" and
    {@Phone Number} <> "6010000000" and
    {@Phone Number} <> "8150000000" and
    {@Phone Number} <> "7130000000"
    I need to find a way to do this without having to enter each code by itself.  I tried using a wilcard, but it appears that I am not using it correctly.
    {@Phone Number} <> "***0000000"
    Please help.  Thanks!

    Nevermind   Just needed a simple: 
    not ({@Phone Number} like "*0000000")

  • SELECT EXPERT formula howto?

    <p>Hi All! I write a program under VS 2005 C# and Crystal Report. So I have a problem with the formula (and with the sql expression formula). My problem is this:</p><p> How can I do create a group with the selection expert? My task is the next: </p><p> I have called numbers (in a table) and the prefixes (36) with the description (Hungary) (in other table). I would like to see ( in a report ) the description before the called number. For example: <br /><br />Hungary 36201234567 (The prefix is the 3620 and the location is Hungary). How can I do make this? I don&#39;t to know the selection expert so good, and this is the another problem.</p><p> Please Guy! Help Me!</p><p>Thanks!!!</p>

    If so... In the Change Group dialog, go to the second tab (Options) and choose  "Customize Group Name" and then select the formula button (x+2)
    In the formula just get the string you want.
    {table.description} + " " + cStr({table.prefix},'########') + cStr({table.number}'########')
    I only add the CStr() function in just in case your numbers are stored as numbers. If they are stored in strings, then the formula would be even easier.
         - Kathryn Webster (Report Design Consultant)Â
               Kat&#39;s News: http://diamond.businessobjects.com/blog/279

  • Select Expert Record. Last 6 months and week start date on Monday

    Hello,
    i am trying to use the select expert record to grab the last 6 months worth of data. I require the week start day to be a monday and end on a sunday.
    Can someone please provide some advice the best way to do this
    kind regards
    david

    Hello Abhilash,
    Once again thanks for your reply.
    Yes this is correct, when it goes back 6 months i need it to skip the days prior and begin on a monday as we are reporting on a mon-sunday basis.
    I have tried your formula Date field >= dateadd('m',-6,currentdate) and it seems to grab 6 months of data, but the group weeks are not grouping from Monday to Sunday...
    kind regards
    david
    Edited by: davitali on Dec 2, 2011 9:35 AM

  • CRViewer XI R2 Select Expert error when using dates

    I am using RDC.  CR XI R2 w/ SP2/3.  When I open any report with dates in the output and then use Select Expert and choose a date from the browse or dropdown list I get an error.
    "Error - the ) is missing"
    -Thanking you in advance.... Brent
    Edited by: Brent Lawrence on Jun 11, 2008 2:15 PM
    Edited by: Brent Lawrence on Jun 11, 2008 2:18 PM

    Hello Brent,
    I'm sorry the RDC viewer and the Select Expert do not meet your expectations.  The RDC was deprecated with the release of Crystal Reports 10.  Once the RDC was deprecated it stopped receiving development focus for issues like this.  The RDC remained available for two more versions (XI / XI R2) but it has now been retired with the release of CR 2008 a few months ago.
    I'm surprised to hear that the Select Expert wasn't showing this issue in CR XI (v11.0), unfortunately I won't be able confirm this.
    If you want to roll back to the viewer for CR XI (v11.0) you have to roll back entirely to work with CR XI (v11.0).  You should not mix versions of DLLs (e.g crviewer.dll v11.0 and craxdrt.dll v11.5).  This may work, but it would not be supported for any issues you might encounter.  You indicated in your post that you moved to CR XI R2 (v11.5) to get past another issue that was resolved in CR XI R2, so rolling back entirely won't be a solution.
    With the retirement of the RDC the recommended upgrade path for Windows application development is to move to the Crystal Reports .NET SDK.  The Crystal Reports .NET SDK is available in CR XI R2 so if you want to explore this SDK as well you can visit the online developer library for additional information.  Here's the link:
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    Sincerely,
    Dan

  • CRXI R2 and VS 2005 select expert

    Hello Every One,
    For our Project we use CR XI 2 and VS2005. We use ODBC connection to run the reports. At the time of designing the report i have added the paramter and filler to select expert. In our windows application I asses the parameter and assign the values to report by using
    CrystalDecisions.Shared.ParameterValues
    CrystalDecisions.Shared.ParameterDiscreteValue
    If I use peview method show the report. Selection formula will be disappers and data does not fillter properly.
    If any one has any better idea let me know.
    Thanks in advance

    Hi, Lakshmi;
    You may be running into the issue documented here:
    [SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303331333533353335%7D.do]
    Regards,
    Jonathan

  • *help*  Select Expert (filters) in crystal

    problem with crystal....
    i need help in the following situation.   when i go to create a report i go to select expert,  then click on category and select say copper fittings.  boom i get a list of all my copper fittings.  my design sheet is set up so that it shows the item number, description, quantity on hand, and quantity sold.  now when i go to select expert again and choose say date transfer of an item...put in my dates( 1/1/2009-1/3/2009)... boom the list refreshes and this list is now shorter than my original list and it shows me the items that have transfered during that period of time as well as the quantity...  well my question is what happened to all the other items that were in the list before???  i understand that they are no longer there because they did not transfer during that period of time, so it doesnt show them... well i still want those items to show up with the rest that did transfer... so that way i can see what transferred and what dint all in one list... i keep trying different things but keep running into the same problem... does anyone know of a solution for this???
    thanks...appreciate any help

    thank you very much for your advice,
    unfortunately my problem has not really been resolved.
    when i did as you said..  in crystal, all i wanted was my copper list... but when i put the "or" in, it included all the other pieces in my inventory not "just"  my copper.
    heres what i had before:
    {VIEWITEMMOVEMENT.DATETRANSFERRED} in Date (2009, 01, 01) to Date (2009, 06, 11) and
    {Category.Name} = "COPPER FITTINGS"
    now if i were to take out the: {VIEWITEMMOVEMENT.DATETRANSFERRED} in Date (2009, 01, 01) to Date (2009, 06, 11) and
    then all i get are my copper fittings and that ends up being like say 10 pages long... but then i put in my the date transferred... to view the items that moved and see how much of each was sold during that time.  the list then gets smaller to about 5 pages and shows me the items that moved and the quantities that were sold but at the same time i still want it to show the other items that did not move on the same list... i dont want them to be taken out...like its doing it now.
    hope this explains my situation a lil better... i appreciate your help, thanks

  • Conditional Select Expert

    Hi,
       I am trying to write a formula in the select expert based on a condition. For certain departments, I want to include specific employee hours, but, for other departments, I want to exclude them.
    Department is based on a number: 010 or 020 etc...
    Employee Job: 0020, 1020, 0430, etc...
    Here is what I am trying to accomplish:
       Ex: If (Department = 010) then DO NOT count employee job 0020   Else count employee job 0020
    Department and employee job are two separate fields in the database.

    I tried the above code and wasn't able to get it to work properly. It only worked when the department was 010. For the other departments, I got no records. I used the formula below, and it works great.
    (if({VP_TIMESHEETITEM.LABORLEVELNAME2} = '010') then {VP_TIMESHEETITEM.LABORLEVELNAME3} <> '0020'
    else {VP_TIMESHEETITEM.LABORLEVELNAME3} <> '' )

  • Using Select Expert Inserts Blank Section

    I'm using Crystal Reports XI Developer Edition and it recently started to display some strange behavior. Every time I use the Select Expert to add a parameter, Crystal adds in an empty ghost section. I refer to it as a ghost section because you can see it in preview mode as an unlabeled, blank section between the report footer and the page footer, but when I go into design view it's not there. How can I make this section not appear?

    Hello Mary,
    I can't explain why it would do that but here are some things to try;
    1) Ensure you are patched up with the latest service pack, SP4
    2) Try lowering the screen resolution
    3) Try lowering the hardware acceleration
    4) If you are using dual monitors only use Crystal Reports on the primary
    5) Have someone else try logging onto your machine and see if they receove the same behaviour
    Some questions if the above does not resolve the issue;
    1) Is this happening on other machines?
    2) What Operating System is CR installed on
    3) Could you please detail the exact workflowif the following statement is incorrect > go into the Select Expert, select a field to filter on, select a parameter from the drop down list of values.
    4) What happens if you manually create the record selection formula where field = parameter?
    5) Does this happen with any field type or is limited to a specific type?

  • How Display Additional Field of a Select Expert Wizard Result

    I have a group of records by customer.  I have performed a Select Expert to pull the latest dated record for the customer.  But I also need to display the subtotal value associated with the selected record of latest date.  How do I do this?

    In the field explorer use Running Totals and place them in the required section.
    Thanks,
    Rakesh

  • CR12 - Formula editor, why do I get message "A field is required here"?

    In both cases below, I get the error "A field is required here".  How do I sum a text column that has numbers in it?
    Sum(ToNumber({data.TextColumn}))
    ToNumber(iif(isNumeric({data.TextColumn}),{outbound_bol_detail.weight},"0"))

    Hi John,
    Your if statement is a bit off.  Try doing it this way instead:
    If NumericText ({data.TextColumn}) Then
        ToNumber ({outbound_bol_detail.weight})
    Else 0;
    Also, have a look in File | Report Options and turn on Convert NULL Values to Default.  It's possible you may have NULLs in the data that Crystal is having problems with. 
    Good luck,
    Brian

Maybe you are looking for