Is it possible to import XML with master-detail data into Excel 2003?

B

Boris Glazyrin

Hello!

Our application generates Excel report with lot of master-detail
information. Something like this:



Department1 info

Employer1 of dept 1

Employer2 of dept 1

Employer3 of dept 1



Department2 info

Employer1 of dept 2

Employer2 of dept 2

Employer3 of dept 2

:

Previously we did it using VBA. Now we are thinking about using new XML
features of Excel 2003. I read many articles on MSDN, but now I understand
how to import simple list using XML. But I have no idea, how to import
repeating Master-Detail list. I am new to XML so may be don't understand
something simple.



Is it possible to such things?



Thank You in advance

Boris
 
F

Francesco Sblendorio

Yes, it's possible: the master-detail structure is flattened.
Example: this XML ...

<people>
<department>
<id>FooBar001</id>
<employee>
<name>Charles</name>
<age>27</age>
</employee>
<employee>
<name>John</name>
<age>21</age>
</employee>
</department>
<department>
<id>HeyFoo002</id>
<employee>
<name>Michel</name>
<age>29</age>
</employee>
<employee>
<name>Herbert</name>
<age>32</age>
</employee>
</department>

is rendered like this:
ID NAME AGE
--------- -------- ---
FooBar001 Charles 27
FooBar001 John 21
HeyFoo002 Michael 29
HeyFoo002 Herbert 32
 
B

Boris Glazyrin

Hello!

Thank You for Your answer.

Is it possible to customize it? Our report is quite complex.

Here is simple example

----

FooBar001 name

FooBar001 address

Charles name, Charles tel

Charles comment

John name, John tel

john comment

HeyFoo name

HeyFoo address

----

Our main target is to give user ability to customize Excel template and load
structural data into it.

Now we use our own vba program, that load data into template. But may be we
can simplify our program (or even throw away :) ) using new XML capabilities
of Excel? We are using Excel 2000 features currently. May be even 97.



Thank You in advance

Boris
 
B

Bob Phillips

XSLT?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Boris Glazyrin

Hello!
We thinked about it. May it is our target.
But still have no idea, how to allow user to modify template without calling
a programmer.
Boris


--------------
 
B

Bob Phillips

Boris,

Either way I think you have some complex programming here, You either will
need to use VBA to do the formatting, or you could XSLT. XSLT is n ot
simple, and it is a language in its own right, so I think you might be best
to commission a programmer.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top