Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default XML Writer/Excel question

Hello,


I'm a beginner in XML language and I'm trying to create an XML file from
Access tables (more than 2 tables, lot of computation for values shown in
the following table, values are averages of many other values) that could be
viewed in Excel as a table that has rows and columns like this:

Q1 Q2
Row1 3 5
Row2 4 1
Row3 2 3

I use Visual Studio 2005, and ASP.NET.

But my table ends up like this: When I write to another column, the program
continues writing from the next row instead of returning to Row1.

attribuutit /Q19 /Q20 /Q21
Row1
Row2
Row3
Row4
10
12
14
15
10
12
14
15
10
12
14
15




----------------
The code I use is like this:

Dim enc As Encoding
Dim objXMLTW As New XmlTextWriter("c:\officet\testi2.xml", enc)

Dim r1 As DataRow, r2 As DataRow, r0 As DataRow

---- the first column -----
objXMLTW.WriteStartElement("attribuutit")

For Each r0 In datasetAttribuutti.Tables("ATTRIBUUTTI").Rows

objXMLTW.WriteElementString("attribuutit", r0.Item("NIMI"))

Next

objXMLTW.WriteEndElement()


---- columns after that, using loops ----

For Each r1 In datasetOsaalueet.Tables("OSAALUEET").Rows

For Each r2 In datasetKysymykset.Tables("KYSYMYKSET").Rows

If r1.Item("OSAALUENUMERO") = r2.Item("OSAALUENUMERO") Then

objXMLTW.WriteStartElement("Q" & r2.Item("KYSYMYSNUMERO"))

For Each r0 In dsAttribuutti.Tables("ATTRIBUUTTI").Rows

value = .....

objXMLTW.WriteElementString("Q" & r2.Item("KYSYMYSNUMERO"),
value)

Next

objXMLTW.WriteEndElement()

End If

Next

Next

This is probably a very amateurish question, but I hope someone could help
me with this, anyway. Thanks in advance.

Jarkko


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cutepdf Writer and Excel 2003 umpire_43 Excel Discussion (Misc queries) 0 April 17th 08 04:47 PM
Excel 2003 Report Writer Add-In Tosa Excel Discussion (Misc queries) 1 October 31st 07 04:08 PM
Print Excel to MODI Writer? David Nelson Excel Discussion (Misc queries) 0 April 1st 05 03:37 PM
Control powerpoint and pdf writer from excel..? Zippy Excel Programming 0 June 27th 04 09:20 PM
Cheque Writer in Excel Praveen Excel Programming 1 October 28th 03 03:06 PM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"