Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8332

Re: Crystal report - how to split a field into more fields

$
0
0

Hi Petr

Chr(13) is a delimiter that I used. Take a look at Eric's from 28.07 9:52 AM. He says:

In fields Address and Address2, fields are joined using the address Template for the country of the address and the line separator used is (by memory) the ASCII value 13 (0x0D)

That's why I used carriage return as a delimiter.

As for details section - I don't know your exact requirement. My formula was built just as a proof of concept and you need to analyse it and adjust for your purpose. You may want to use similar formula in details section. If you'd like to present parts of address in rows of your report you probably don't need to put anything in header or footer. Instead you need to do split for every row, i.e. in details section. Then you'll have several fields in details: city, street and so on as in data table in a database. In each of these fields you will have a formula for split. Let's assume that your data always have street in a first place. Then when you'd like to show street in a field in row of your report you should use formula similar to this:

stringVar array x := split({OINV.Address2},Chr(13));
x[1]; 

The number in square brackets is a value for index of field in an array that you get as an outcome of split function. In the next formula field in your report, for example for city, you'll copy formula and adjust index. You need to experiment a little to learn if split working ok for every particular address that you can get from database.

That's a pity that you cannot change data from database. As Eric proposed earlier you should be able to create a procedure and prepare your data at the database level.

 

Kind regards,

Radek


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>