Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reporting on xml files

Status
Not open for further replies.

mikeprestim

Programmer
Mar 1, 2001
21
GB
I have an xml file please see below.

<part_data>
<form>
<sb_circuit_size>
<circuit_dim_type>
2
</circuit_dim_type>
<circuit_width>
219840000
</circuit_width>
<circuit_length>
251430000
</circuit_length>
</sb_circuit_size>
</form>
</part_data>

I need to extract the circuit_width and length tags. When I imort the xml file into crystal all items under the sb_circuit_size entry are grouped together. ie my string is

2 219840000 25143000

Is there any way of reporting on each tag, if not how do I split the above string into 3.

Thanks for any help. I am new to crystal.

Mike McMahon
 
I'll handle the second part, to split it up, use splitin a formula:

whileprintingrecords;
stringvar array TheData := Split({xml.field});
join({xml.field},chr(13) //break them back out

Will return them on 3 different lines.

-k
 
Thanks synapsevampire.

I gave it one last try on reading the xml in before going the formula route and this time it worked.

I had not set up the xml driver correctly in the ODBC Admin.
For ref to get what I needed in the advanced tab the table hint needed to be set as /part_data/form nad the row hint needed to be sb_circuit_size. Also everytime you modify the ODBC admin you have to log the db off from crystal, just removing the db and reading does not seem to work.

Regards

Mike McMahon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top