Neurokahuna
New member
- Joined
- Dec 7, 2009
- Messages
- 4
- Programming Experience
- 1-3
Hi Everyone,
I really tried to work this out for myself before posting, but I genuinely need some help from those VB.NET specialists in the know.
Basically, I have this xml file. It is a series of quotes by our suppliers to provide parts on a number of projects for that day.
For each company, they may supply a quote on a project or they may not (i.e. it would be a null value on a 'project', or xmlelement in this case). See Company 7 for an example.
The number of companies that tender to supply parts on these projects (xmlelements) will differ each time a tender is sent out.
Now I can load it into a datagridview via a dataset easily enough, but it splits each element across as a new column.
I basically need to convert this data to a datagridview in the format shown below.
The structure of the DatagridView is: Company ID, Company Name, Quote 1(project V_2), Quote 2(project V_1), etc.....
Each company is on a new datarow (for each loop)
CoID CoName QuoteV_2 QuoteV_1 QuoteN_2 QuoteQ_1 QuoteAB_1 QuoteAT_2
1 Company 1 11 3.2 10.9 10.9 15 16.04
2 Company 2 9 2.6 9.3 9.3 12 10.64
3 Company 3 23.3 5.9 22.8 22.8 17 22.17
4 Company 4 37.7 8.8 36.7 36.7 51 41.54
5 Company 5 18.2 4.4 18.8 18.8 17 25.37
6 Company 6 19.3 4.8 18.8 18.8 21 18.36
7 Company 7
8 Company 8 24.8 6.2 24.6 24.6 17 24.29
9 Company 9 11.5 3.7 11.6 11.6 11 11.74
10 Company 10 2.9 1.8 2.9 2.9 2.9 3.88
11 Company 11 7.8 2.9 7.7 7.7 6.5 9.66
12 Company 12 22.6 5.6 23.2 23.2 19 22.36
13 Company 13 16.3 4 16.7 16.7 19 16.81
14 Company 14 10.1 2.7 10 10 11 10.01
-I apologise if I have formatted this incorrectly.
What I need is some way of delimited this xml file into this format.
Like I said, I have tried, but just don't know how to structure this in VB.NET or even C#.
If someone could please give me a leg up, I will name my first child after you.
I have trawled the web for weeks trying to find something similar to absolutely no avail. In fact, I do not even know if my Subject heading is correct.
Please find enclosed a spreadsheet that shows the xml file content and output sought in a cleaner format.
Thanks for everything.
Neurokahuna
I really tried to work this out for myself before posting, but I genuinely need some help from those VB.NET specialists in the know.
Basically, I have this xml file. It is a series of quotes by our suppliers to provide parts on a number of projects for that day.
For each company, they may supply a quote on a project or they may not (i.e. it would be a null value on a 'project', or xmlelement in this case). See Company 7 for an example.
The number of companies that tender to supply parts on these projects (xmlelements) will differ each time a tender is sent out.
VB.NET:
<?xml version="1.0" encoding="utf-8" ?>
- <Quotes>
- <CoQuote>
<CoID>1,2,3,4,5,6,7,8,9,10,11,12,13,14</CoID>
<CoName>Company 1,Company 2,Company 3,Company 4,Company 5,Company 6,Company 7,Company 8,Company 9,Company 10,Company 11,Company 12,Company 13,Company 14</CoName>
<QuoteV_2>11,9,23.3,37.7,18.2,19.3,,24.8,11.5,2.9,7.8,22.6,16.3,10.1</QuoteV_2>
<QuoteV_1>3.2,2.6,5.9,8.8,4.4,4.8,,6.2,3.7,1.8,2.9,5.6,4,2.7</QuoteV_1>
<QuoteN_2>10.9,9.3,22.8,36.7,18.8,18.8,,24.6,11.6,2.9,7.7,23.2,16.7,10</QuoteN_2>
<QuoteQ_1>10.9,9.3,22.8,36.7,18.8,18.8,,24.6,11.6,2.9,7.7,23.2,16.7,10</QuoteQ_1>
<QuoteAB_3>15,12,17,51,17,21,,17,11,2.9,6.5,19,19,11</QuoteAB_3>
<QuoteAT_2>16.04,10.64,22.17,41.54,25.37,18.36,,24.29,11.74,3.88,9.66,22.36,16.81,10.01</QuoteAT_2>
</CoQuote>
</Quotes>
Now I can load it into a datagridview via a dataset easily enough, but it splits each element across as a new column.
I basically need to convert this data to a datagridview in the format shown below.
The structure of the DatagridView is: Company ID, Company Name, Quote 1(project V_2), Quote 2(project V_1), etc.....
Each company is on a new datarow (for each loop)
CoID CoName QuoteV_2 QuoteV_1 QuoteN_2 QuoteQ_1 QuoteAB_1 QuoteAT_2
1 Company 1 11 3.2 10.9 10.9 15 16.04
2 Company 2 9 2.6 9.3 9.3 12 10.64
3 Company 3 23.3 5.9 22.8 22.8 17 22.17
4 Company 4 37.7 8.8 36.7 36.7 51 41.54
5 Company 5 18.2 4.4 18.8 18.8 17 25.37
6 Company 6 19.3 4.8 18.8 18.8 21 18.36
7 Company 7
8 Company 8 24.8 6.2 24.6 24.6 17 24.29
9 Company 9 11.5 3.7 11.6 11.6 11 11.74
10 Company 10 2.9 1.8 2.9 2.9 2.9 3.88
11 Company 11 7.8 2.9 7.7 7.7 6.5 9.66
12 Company 12 22.6 5.6 23.2 23.2 19 22.36
13 Company 13 16.3 4 16.7 16.7 19 16.81
14 Company 14 10.1 2.7 10 10 11 10.01
-I apologise if I have formatted this incorrectly.
What I need is some way of delimited this xml file into this format.
Like I said, I have tried, but just don't know how to structure this in VB.NET or even C#.
If someone could please give me a leg up, I will name my first child after you.
I have trawled the web for weeks trying to find something similar to absolutely no avail. In fact, I do not even know if my Subject heading is correct.
Please find enclosed a spreadsheet that shows the xml file content and output sought in a cleaner format.
Thanks for everything.
Neurokahuna