Crystal report - how to split a field into more fields

Hello,
I`m new to Crystal reports and I`ve got a trouble. I have field which contains an address - street, city, zip code. The example is:
STEHLIKOVA 977 165 00 PRAHA 620 - SUCHDOL 165 00.
What I need to achieve is to split this string into three separated fields. I`ve trouhg a couple of forums but haven`t been able to find a proper answer. The problem is that the addresses differ so I can`t use an absolute defining of a start position. Looking at the DB (HEXA code) the parts in the string are divided by two dots:
STEHLIKOVA 977..165 00 PRAHA 620 - SUCHDOL..165 00
I`ve been able to work out this solution:
stringVar array x := split({cparty.STREET_ADD},"..");
Local numberVar i;
Local stringVar outputString := "";
For i:=1 to Count(x) do
outputString := outputString + x[i] + Chr(10)
outputString;
It splits the string into three rows:
STEHLIKOVA 977
165 00 PRAHA 620 - SUCHDOL
165 00
And I don`t know how to find the end of each row so to be able to separate the strings and report them as three different fields.
Would be anyone so kind and help me out with this?
Thank you.
Petr

Hi
Actually using a for loop is not necessary here. All you need to do is to add several formula fields: one for street, one for city and one for zipcode. In @street field you add formula:
stringVar array x := split({cparty.STREET_ADD},Chr(13));
x[1];
Then you drag such formula field to details section of your report and watch preview to check if everything looks alright. Repeat for every formula field that you'd like see in your report.
In @city you add almost identical formula but you change index, i. e. instead of x[1] you need to use x[2]. Then for @zip x[3].
You may need to check if your address has all three parts - for example if you want to use formula in the second part of your address field you may need check first if there are at least two parts after split:
stringVar array := split({cparty.STREET_ADD},Chr(13));
numbervar c; 
c := count(x); 
if 2 <= c then 
x[c]; 
Var 'c' is used to store the number of elements in array after split. Then I'd like to check if the part (second) actually exists. So I try to check if number of part that I want to refer to is not bigger than the number of elements in array after split (here stored in var 'c').
Actually the code presented above is not enough since you have no guarantee that you'll always get address structured in the very same way. For example in demo PL database I have zip code and city in the same row after split with Chr(13) as delimiter.
You'll need to experiment or ask someone to prepare correctly structured data coming from B1 to your report.
Kind regards,
Radek

Similar Messages

  • How to split invoice/document  into two venders?

    Can anyone please tell me how to split invoice/document into two vendors.  Like if I get an invoice for $1000 and it needs to be splitted between father and son, $500 to each.  How would I set that up in SAP?  I am not sure if this will be an invoice split or a document split.
    Thanks
    Monika

    If you are using an FI  entry F-43 to generate invoice this can be done by giving the same invoice ref. in the Inv. Ref. field  for two vendors. This is manual
    Document Split will split the document between two profit center and not between vendors.

  • Hyperlink on Crystal Report: how to popup a window without menubar?

    Hyperlink on Crystal Report: how to popup a window without menubar?
    Hello Experts!
    I'm using VS2003 with Crystal Reports for VS2003.
    I need to show a popup window clicking a hyperlink text object on my crystal report.
    On the CrystalReportViewer I have set up HyperlinkTarget=_blank, and it's working fine.
    But when I click on the hyperlink and shows the popup window, how can I show the popup window without menubar, toolbar, directories, etc.
    Something like:
    window.open('../MyPage.html?id=id001" + Cad + "',null,'menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,status=yes')

    Adam is correct. The closest you can get is setting the CrystalReportViewers HyperlinkTarget to _blank. It was seen as a potential security vulnerability to allow you to run scripts from a Crystal Reports. In our Enterprise product you can use a reg key called EncodeHTMLForSingleLineFieldObjects to control whether this can be turned on or off.
    Unfortunately this was never ported over to our .NET CrystalReportViewer.
    This is referenced in notes 1202803, 1219298, and 1219301.
    https://www.sdn.sap.com/irj/sdn/businessobjects-notes
    Edited by: David Hilton on Jul 16, 2008 4:17 PM

  • How to insert a value into a field of binary type?

    I've been using Oracle for a while now but never dealt with BLOB
    or long raw type before. Does anyone here know how to insert a
    record into a field of either blob or long raw type?
    Any suggestions would be very appreicated.
    Thanks.

    pls used the loadfromfile procedure which is in the DBMS_LOB
    package to insert the data from external os file into blob data
    type column.
    Kunjan

  • How to split one page into different frames in ADF?

    Hi,
    Can any one please guide me how to split a jspx into different frames.
    i.e., left frame contains <af:panelSideBar> which contains multiple <af:commandMenuItem> s. And whenver we click on the one <af:commandMenuItem>, it has to show the corresponing page inside center frame in this page itself. Is it possible in ADF? Which component we need to use?
    Can anyone guide me on this?
    Thanks in advance,
    Regards,
    Suresh Kethireddy

    You can use a combination of the ADF Faces 10.1.3 components like:
    af:panelPage
    af:panelSideBar
    af:panelHorizontal
    af:panelGroup
    to organize the screen layout, but it is not the interactive splitter that the 11g product provides.
    You can all all the 10.1.3 ADF Faces Components here:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/imageIndex.html

  • How to convert the text field into currency field

    Hi,
    I have an requirement to converting the text field into currency.
    If I convert directly it gives dump.
    If I convert this to Numeric means it takes the decimals also as whole value.
    Is there any FM to convert the text field into Currency field.
    Please advice me.
    Thanks in advance.

    Hi,
    I am on an SRM sytem, which unfortunately does not have th FM: PSSV_TEXT_INTO_FIELD_CURRENCY.
    But I also need to transfer a string value like '12,99' to a field with type curr.
    Can i Do that manually, or is there another FM?
    I have already checked code with write to or pack/unpack.
    But without success yet.
    Something like this:
    DATA: g_str(11) type c.
    DATA: g_p type p.
    WRITE '12,99' TO g_str CURRENCY 'EUR'.
    is no use for me. Finally I need to move g_str to my curr-field, which causes st22.
    also: PACK g_str to <curr-field or g_p> dumps.
    Help appreciated.
    regards, matthias

  • Converting Normal field into amount field

    Hello Gurus,
    I need urgent help.
    I want to conver the Normal field into Amount filed.
    DATA : AMOUNT(13),
    DATA : WRBTR LIKE BSEG-WRBTR.
    So I want TO Convert Normal field into amount field.
    This is urgent. please help me.
    Thanks in advance.
    Best Regards,
    zubera

    Hi,
    Use FM HRCM_STRING_TO_AMOUNT_CONVERT
    pass the char(amount) and decimal separator, thousand separator.
    you get the char converted to amount/currency
    Regards,
    Satish

  • How to Split field  into multiple fields in  Import Manager without  delem

    Hi
      Is there any method to Split a record in MDM without using delimitter?
    I dont want to use any delemitter  My field content in Source is  PRODLABELPACK and I want to split it into 3 fields in destination  Field1= PROD
    Field2=LABEL   Field3=PACK
    I know how to split it if the content is PROD_LABEL_PACK .But we dont want to use delimiter in the firld and want to use some substring function
    Regards
    Prashant

    You Can use below FM  SWA_STRING_SPLIT -
    First Use READ_TEXT FM.
    then loop into
    loop at tline.
    Here use 'SWA_STRING_SPLIT' -> Pass tdline and append the text into other internal table.
    endloop
    Thank you
    Seshu

  • Crystal report: How to concatenate the string whilereadingrecords?

    I have description field in the database and I need to concatenate the value of the filed into one line. How to do that? I tried as below
    Stringvar strtitle="";
    whilereadingrecords;
    if Mid({OrderDtl.PartNum},1,2)="T3" Then
    strtitle & "T3- Background Music,"
    Else if Mid({OrderDtl.PartNum},1,2)="T6" then
    strtitle & "T6- Dance"
    This is not working and showing only last value instead of concatenated string. I am very new to Crystal report and i am using Crystal report 2008
    Thanks,
    Raj

    Hi Raj,
    I guess you're trying to concatenate the descriptions so that they appear on a single line, perhaps, on the report footer?
    Try this formula:
    whilereadingrecords;
    stringvar strtitle;
    strtitle := strtitle + ">" + {description_field_from_database}
    The ">" sign is to separate the records from each other; you may choose to remove this from the formula or use another separator.
    Place the above formula in the details section and suppress the section.
    Create this formula to display the result and place it in the Report Footer section:
    evaluateafter(@Name_of_the_above_formula);
    stringvar strtitle;
    Let me know how this goes!
    -Abhilash

  • Crystal report -How to display multiple lines in line chart?

    Hi,
    M struggling to display multiple lines in line chart. All the values m fetching it from database into data table in below format & data type
    Category(String).....year(Int).....graph_values(Int).....table_value(String)
    Test.........................2006.......... -100............................(100)
    Avg..........................2006..........20................................20
    Median......................2006...........5................................5
    Test..........................2007...........500.............................500
    Avg...........................2007............90..............................90
    Median.......................2007............45..............................45
    M using cross tab to display data and chart to plot line. Following fields I used in Cross tab Expert & Chart expert
    Cross tab expert-
    Rows u2013 category
    Columns u2013 year
    Summarized fields u2013 Min of table_value
    In Chart Expert u2013
    On Change of - Year
    Show values - graph values
    In cross tab m able to see the data properly but not in graph.I have three categories. Hence it should plot three lines in line chart but m able to see only one line for test category.
    FYI u2013 using VS 2008 and crystal report assembly version 10.5
    Urgent. Please reply soon.
    Thanks
    ThakurS

    I got the solution.
    In Chart Expert - I should use
    On Change of -- Year, Category
    Show values -- graph values
    Thanks,
    ThakurS

  • How to split  the records into two parts

    Hi experts,
    I have a field with 75 char length, this field have records also, Now i want to split the field into two differnt fields. That means upto first 40 char goes to one field, from 41st char to 70 char goes to another field, for that how to split record into two parts.
    Plz advice this,
    Mohana

    Hi,
    Do the following:
    f1 = fsource(40).
    f2 = fsource+40(30).
    where fsource is the 70 character original string and target strings are f1 (length 40) and f2 (length 30).
    Cheers,
    Aditya
    Edited by: Aditya Laud on Feb 22, 2008 2:10 AM

  • Crystal Reports: How to change Oracle OLE DB server at runtime

    Post Author: dvlasman
    CA Forum: Data Connectivity and SQL
    I'm using a rpt made with Crystal Reports 8.0.1 and VB 6. The report was made using the Microsoft OLE DB provider for Oracle. What I want to do is change to Oracle server / database the report is connecting to at run time before the report is displayed. I am using the Crystal Report Engine 8 Object Library (cpeaut32.dll), not the ocx.After creating the report object:Dim CrystalReport As CRPEAuto.ReportI open my report and discard saved data:'Open The ReportSet CrystalReport = CrystalApplication.OpenReport(msReportSource)CrystalReport.DiscardSavedDataConst sDBServer = "ORCL.SERVER" 'My TNS name for the Oracle ServerConst sDatabase = "ORCL.SERVER" 'I'm not sure what this value should beConst sUID = "system"Const sPwd = "manager"I was then going to change the database connection one of two ways:1:Dim objDatabaseTable As CRPEAuto.DatabaseTableFor Each objDatabaseTable In CrystalReport.Database.Tables    Call objDatabaseTable.SetLogOnInfo(sDBServer, sDATABASE, sUID, sPWD)    If (Not objDatabaseTable.TestConnectivity) Then        Debug.Print "Database failed connection: " & objDatabaseTable.Name    End IfNextSet objDatabaseTable = Nothing2:call crystalapplication.LogOnServer("pdsoledb.dll","MSDAORA.1",sDATABASE,sUID,sPWD)Neither of these two way gets me a successful connection. What am I doing wrong, and which is the preferred method to use?ThanksDean

    Did you get a resolution to your problem? I cannot dynamically change the datasource location in .NET using CR XI via OLE DB for Oracle. I get "This field name is not known." messages and when I try using the set datasource location in the designer tool, the mapping dialog box comes up with no fields in the right box. Thanks, Brian

  • Crystal Report: How to make the fixed height box in all pages.

    Post Author: WTech
    CA Forum: Crystal Reports
    I want to make the height of box fixed size in all pages. The box in outside the detail section. Currently the size of the box changes according to the content of the detail section. Could anyone suggest me how should i achieve it ?  

    Hi srinivasan,
    If you want to keep "Save" and "Stop" common, Why do you want to keep them on Tab control? Is your tab control taking entire space on Front panel? If so, you can have SAVE and STOP on other vi, and you can call this vi (MODAL).
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Using Crystal Reports XI, Version 11.0.0.1994, "This field cannot be summarized." Message

    Post Author: Caroline Richards
    CA Forum: Crystal Reports
    I am currently working on a revenue report that has details with groupings for account, rate codes, and categories of rate codes. 
    Revenue for each account can be adjusted, and the adjustment is linked to the original revenue amount by an Accounts Receivable Transaction Number.  The correct summary for higher groupings are affected when an adjustment is made to the same revenue amount (same AR Transaction Number) more than once.  I have been able to calculate the correct revenue amount in a formula, leaving out the duplicated revenue when there's more than one adjustment on the revenue; however, when I try to summarize the calculated revenue amount in any way, I get a message stating:  "This field cannot be summarized." 
    Is there a way around this so that I can use the calculated amount?  Will an array work?

    Post Author: SKodidine
    CA Forum: Formula
    In CR, you cannot summarize on a summary field.  Since the formula already has a summary function in it, you will not be able to summarize on the formula field.
    Workaround would be to calculate summaries using a running total or another formula and thus avoid the summary using summary situation.

  • Form Letter Report - How To Format Date and Number Hidden Fields

    Hi
    Is it possible to format date and number fields in a form letter report. This case were Paper Design shows fields as $<hire_date>. The examples in reference book only print character values which do not require formatting. I cannot determine how to achieve this. Cannot select fields from Paper Design view as per other report styles where can apply formatting. Do I have to perform formatting in the query to return date as string in format I wish for? This is not case for other report styles.
    Thanks

    you could add a field, set the source of the field to hire_date (assuming hire_date is a column in the data model), and put a format mask of whatever format you want. then set visible to No.
    then instead of &<hire_date> you can instead type &<name of your new field>.

Maybe you are looking for

  • I have two versions of Lightroom installed on my computer, can I uninstall the older version?

    While looking at the "Programs and Features" folder on my Windows 7 computer I discovered that I have two versions of Adobe Lightroom installed on my system. One is Lightroom 5.2, installed on 9/19/2013, and the other is Adobe Photoshop Lightroom 5.5

  • Size of portrait-orientation images in Flash gallery

    I've created a website using Lightroom. It uses the Flash engine with the "Paginate" option. I specified "large" for both thumbnails and images. With the monitor resolution set at 1280 by 1024, there are 200 pictures in the gallery, and these are dis

  • Very Quiet Audio During Playback

    Hi, Just trying out my iPod 5G and an Apple AV cable. Video is fine but audio is very very quiet. Have to have the iPod set to virtually full volume and TV up to about 50 (normal volume on TV is 12-15) to get anything like listenable audio. The video

  • Create additional Notes

    Hi, I want to add new additional notes to Activities - Appointments - Overview section similar to existing Notes. I have created Appointment XBO and added following code. [Label("Sales Call Objective")] element SalesCallObj : LANGUAGEINDEPENDENT_EXTE

  • If artist has one album jumps str8 to it.....cant view songs not part of it

    Hi I don't know if this is an issue with my iPod or with this generation in general, but when trying to view an artists songs if the artist has one album and a few songs that are not part of that album it jumps straight to that album, therefore no lo