|
Rank: Member
Joined: 6/29/2018 Posts: 11
|
I'm going to make a case that demonstrates what I want to achieve.
I have three people James, Carl and George. Each of these people have pets.
James => cat, mouse Carl => goldfish George => Kangaroo, Chimpanze, Iguana
I want to make a three page PDF that display the person and the pets that he owns on each page.
Page 1:
Name: James
Pets: Cat, mouse
Page 2:
Name: Carl
... and so on
Suppose that the XML look something like this:
<?xml version="1.0" encoding="UTF-8"?> <DOCUMENT> <DATA> <ROWSET1> <ROWSET1_ROW> <PERSON_ID>1</PERSON_ID> <PERSON_NAME>James</PERSON_NAME> </ROWSET1_ROW> <ROWSET1_ROW> <PERSON_ID>2</PERSON_ID> <PERSON_NAME>Carl</PERSON_NAME> </ROWSET1_ROW> <ROWSET1_ROW> <PERSON_ID>3</PERSON_ID> <PERSON_NAME>George</PERSON_NAME> </ROWSET1_ROW> </ROWSET1> <ROWSET2> <ROWSET2_ROW> <PET_ID>1</PET_ID> <PERSON_ID>1</PERSON_ID> <ANIMAL>Cat</ANIMAL> </ROWSET2_ROW> <ROWSET2_ROW> <PET_ID>2</PET_ID> <PERSON_ID>1</PERSON_ID> <ANIMAL>Mouse</ANIMAL> </ROWSET2_ROW> <ROWSET2_ROW> <PET_ID>3</PET_ID> <PERSON_ID>2</PERSON_ID> <ANIMAL>Goldfish</ANIMAL> </ROWSET2_ROW> <ROWSET2_ROW> <PET_ID>4</PET_ID> <PERSON_ID>3</PERSON_ID> <ANIMAL>Kangaroo</ANIMAL> </ROWSET2_ROW> <ROWSET2_ROW> <PET_ID>5</PET_ID> <PERSON_ID>2</PERSON_ID> <ANIMAL>Chimpanze</ANIMAL> </ROWSET2_ROW> <ROWSET2_ROW> <PET_ID>6</PET_ID> <PERSON_ID>2</PERSON_ID> <ANIMAL>Iguana</ANIMAL> </ROWSET2_ROW> </ROWSET2> </DATA> </DOCUMENT>
I'm kind of stuck on this problem, so thanks in advance to any one that respond :)
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
That's easy enough using a variable, set on the current ROWSET1_ROW item holding its' PERSON_ID value, to match the records from ROWSET2 against the current record from ROWSET1. See the attached example. File Attachment(s): example.pxf (71kb) downloaded 358 time(s).
|
|
Rank: Member
Joined: 6/29/2018 Posts: 11
|
it worked! thanks :)
|
|
Rank: Member
Joined: 6/29/2018 Posts: 11
|
I got a followup question on this topic. Consider the same case as mentioned above, but now each person want to have a unique image representing the animals attached to their page as well. (ea Carl wants a picture of his goldfish on his page, John want a group picture of the Kagaroo, Chimpanze and Iguana etc... point is only one picture per persona page) How do i implement that? The images are stored locally.
|
|
guest |