How to query this nested XML in Snowflake - snowflake-cloud-data-platform

New to XML and Snowflake. Can someone please give me an example of how I would query this nested XML data in Snowflake? Sample of the data is attached. Specifically, I'd like to flatten this whole document (so I can see all columns) and I can put this data into Snowflake.
If someone can give me al example of this query in Snowflake I would appreciated it. When I try to query this data I just get nulls except for the vehicle_number. How would I query this XML to see all columns?
<pnet_get_performx_data_packet>
<packet_id>4</packet_id>
<more_data></more_data>
<pxreport>
<vehicle_number>5454</vehicle_number>
<px_params>
<long_idle_thresh>0</long_idle_thresh>
<rpm_thresh>14</rpm_thresh>
<over_speed>72</over_speed>
<excess_speed>75</excess_speed>
</px_params>
<reportdata>
<sd>05/19/2022 13:47:16</sd>
<ed>05/19/2022 14:06:08</ed>
<so>8074162</so>
<eo>8074162</eo>
<et>0</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26651500</sf>
<ef>26651500</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>0</els>
<elm>0</elm>
<fl1>59</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 14:06:08</sd>
<ed>05/19/2022 14:16:08</ed>
<so>8074162</so>
<eo>8074162</eo>
<et>96</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>96</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26651500</sf>
<ef>26651500</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>8.5</els>
<elm>61.5</elm>
<fl1>61</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 14:16:08</sd>
<ed>05/19/2022 14:17:54</ed>
<so>8074162</so>
<eo>8074162</eo>
<et>107</et>
<mt>13</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>94</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26651500</sf>
<ef>26651500</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>7</els>
<elm>14</elm>
<fl1>62</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 14:17:54</sd>
<ed>05/19/2022 15:06:08</ed>
<so>8074162</so>
<eo>8074489</eo>
<et>2894</et>
<mt>2715</mt>
<or>1609</or>
<os>0</os>
<es>0</es>
<lit>179</lit>
<lic>10</lic>
<sit>0</sit>
<sic>0</sic>
<gof>4125</gof>
<vin></vin>
<lif>125</lif>
<sif>0</sif>
<sf>26651500</sf>
<ef>26655625</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>38</ba>
<els>8</els>
<elm>30.5</elm>
<fl1>58</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>109</orlt>
<orht>1500</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:06:08</sd>
<ed>05/19/2022 15:11:26</ed>
<so>8074489</so>
<eo>8074491</eo>
<et>318</et>
<mt>108</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>210</lit>
<lic>4</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26655625</sf>
<ef>26655625</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>2</ba>
<els>7</els>
<elm>10</elm>
<fl1>60</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:11:26</sd>
<ed>05/19/2022 15:12:42</ed>
<so>8074491</so>
<eo>8074491</eo>
<et>76</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>76</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26655625</sf>
<ef>26655625</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>6.5</els>
<elm>0</elm>
<fl1>60</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:12:42</sd>
<ed>05/19/2022 15:31:40</ed>
<so>8074491</so>
<eo>8074491</eo>
<et>1137</et>
<mt>3</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>1134</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>125</gof>
<vin></vin>
<lif>125</lif>
<sif>0</sif>
<sf>26655625</sf>
<ef>26655750</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>7</els>
<elm>20.5</elm>
<fl1>61</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:31:40</sd>
<ed>05/19/2022 15:38:02</ed>
<so>8074491</so>
<eo>8074491</eo>
<et>21</et>
<mt>18</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>3</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26655750</sf>
<ef>26655750</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>7</els>
<elm>8</elm>
<fl1>60</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:38:02</sd>
<ed>05/19/2022 15:46:06</ed>
<so>8074491</so>
<eo>8074491</eo>
<et>36</et>
<mt>15</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>21</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26655750</sf>
<ef>26655750</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>13</els>
<elm>13.5</elm>
<fl1>58</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:46:06</sd>
<ed>05/19/2022 15:51:18</ed>
<so>8074491</so>
<eo>8074499</eo>
<et>312</et>
<mt>175</mt>
<or>72</or>
<os>0</os>
<es>0</es>
<lit>137</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>250</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26655750</sf>
<ef>26656000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>2</ba>
<els>4</els>
<elm>29</elm>
<fl1>60</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>1</orlt>
<orht>71</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 15:51:18</sd>
<ed>05/19/2022 16:06:08</ed>
<so>8074499</so>
<eo>8074616</eo>
<et>891</et>
<mt>860</mt>
<or>731</or>
<os>0</os>
<es>0</es>
<lit>31</lit>
<lic>2</lic>
<sit>0</sit>
<sic>0</sic>
<gof>2625</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26656000</sf>
<ef>26658625</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>8</ba>
<els>11</els>
<elm>60</elm>
<fl1>58</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>80</orlt>
<orht>651</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 16:06:08</sd>
<ed>05/19/2022 16:22:08</ed>
<so>8074616</so>
<eo>8074727</eo>
<et>958</et>
<mt>872</mt>
<or>623</or>
<os>0</os>
<es>0</es>
<lit>86</lit>
<lic>3</lic>
<sit>0</sit>
<sic>1</sic>
<gof>2250</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26658625</sf>
<ef>26660875</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>13</ba>
<els>9</els>
<elm>52.5</elm>
<fl1>56</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>29</orlt>
<orht>594</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 16:22:08</sd>
<ed>05/19/2022 16:29:18</ed>
<so>8074727</so>
<eo>8074727</eo>
<et>0</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26660875</sf>
<ef>26660875</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>0</els>
<elm>0</elm>
<fl1>56</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 16:29:18</sd>
<ed>05/19/2022 16:55:48</ed>
<so>8074727</so>
<eo>8074727</eo>
<et>127</et>
<mt>6</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>121</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26660875</sf>
<ef>26660875</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>6.5</els>
<elm>19</elm>
<fl1>56</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 16:55:48</sd>
<ed>05/19/2022 17:06:08</ed>
<so>8074727</so>
<eo>8074813</eo>
<et>621</et>
<mt>596</mt>
<or>495</or>
<os>0</os>
<es>0</es>
<lit>25</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>1250</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26660875</sf>
<ef>26662125</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>2</ba>
<els>8</els>
<elm>35</elm>
<fl1>57</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>25</orlt>
<orht>470</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 17:06:08</sd>
<ed>05/19/2022 17:22:40</ed>
<so>8074813</so>
<eo>8074907</eo>
<et>951</et>
<mt>809</mt>
<or>526</or>
<os>0</os>
<es>0</es>
<lit>142</lit>
<lic>6</lic>
<sit>0</sit>
<sic>0</sic>
<gof>875</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26662125</sf>
<ef>26663000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>14</ba>
<els>9</els>
<elm>24.5</elm>
<fl1>56</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>34</orlt>
<orht>492</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 17:22:40</sd>
<ed>05/19/2022 17:28:00</ed>
<so>8074907</so>
<eo>8074907</eo>
<et>0</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26663000</sf>
<ef>26663000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>0</els>
<elm>0</elm>
<fl1>56</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 17:28:00</sd>
<ed>05/19/2022 17:41:26</ed>
<so>8074907</so>
<eo>8074908</eo>
<et>101</et>
<mt>22</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>79</lit>
<lic>2</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26663000</sf>
<ef>26663000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>9</els>
<elm>15</elm>
<fl1>57</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 17:41:26</sd>
<ed>05/19/2022 18:06:08</ed>
<so>8074908</so>
<eo>8075098</eo>
<et>1483</et>
<mt>1343</mt>
<or>1124</or>
<os>0</os>
<es>0</es>
<lit>140</lit>
<lic>2</lic>
<sit>0</sit>
<sic>0</sic>
<gof>3000</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26663000</sf>
<ef>26666000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>9</ba>
<els>7</els>
<elm>41.5</elm>
<fl1>55</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>49</orlt>
<orht>1075</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 18:06:08</sd>
<ed>05/19/2022 18:12:34</ed>
<so>8075098</so>
<eo>8075131</eo>
<et>383</et>
<mt>349</mt>
<or>163</or>
<os>0</os>
<es>0</es>
<lit>34</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>375</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26666000</sf>
<ef>26666375</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>4</ba>
<els>9.5</els>
<elm>27</elm>
<fl1>55</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>9</orlt>
<orht>154</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 18:12:36</sd>
<ed>05/19/2022 18:18:04</ed>
<so>8075131</so>
<eo>8075131</eo>
<et>0</et>
<mt>0</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26666375</sf>
<ef>26666375</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>0</els>
<elm>0</elm>
<fl1>55</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 18:18:04</sd>
<ed>05/19/2022 18:43:20</ed>
<so>8075131</so>
<eo>8075131</eo>
<et>215</et>
<mt>4</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>211</lit>
<lic>1</lic>
<sit>0</sit>
<sic>0</sic>
<gof>0</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26666375</sf>
<ef>26666375</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>0</ba>
<els>5.5</els>
<elm>16.5</elm>
<fl1>57</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 18:43:20</sd>
<ed>05/19/2022 18:46:54</ed>
<so>8075131</so>
<eo>8075142</eo>
<et>213</et>
<mt>213</mt>
<or>64</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>0</sit>
<sic>0</sic>
<gof>375</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26666375</sf>
<ef>26666750</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>7</ba>
<els>0</els>
<elm>21</elm>
<fl1>58</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>7</orlt>
<orht>57</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 18:46:54</sd>
<ed>05/19/2022 19:06:08</ed>
<so>8075142</so>
<eo>8075239</eo>
<et>1155</et>
<mt>987</mt>
<or>645</or>
<os>0</os>
<es>0</es>
<lit>168</lit>
<lic>9</lic>
<sit>0</sit>
<sic>0</sic>
<gof>1250</gof>
<vin></vin>
<lif>0</lif>
<sif>0</sif>
<sf>26666750</sf>
<ef>26668000</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>16</ba>
<els>7.5</els>
<elm>29</elm>
<fl1>54</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>45</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>20</orlt>
<orht>625</orht>
</reportdata>
</pxreport>
<pxreport>
<vehicle_number>6460</vehicle_number>
<px_params>
<long_idle_thresh>420</long_idle_thresh>
<rpm_thresh>16</rpm_thresh>
<over_speed>73</over_speed>
<excess_speed>80</excess_speed>
</px_params>
<reportdata>
<sd>05/19/2022 13:50:22</sd>
<ed>05/19/2022 13:58:28</ed>
<so>4185526</so>
<eo>4185526</eo>
<et>33</et>
<mt>6</mt>
<or>0</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>27</sit>
<sic>2</sic>
<gof>0</gof>
<vin>00000000000000000</vin>
<lif>0</lif>
<sif>0</sif>
<sf>13375750</sf>
<ef>13375750</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>12.5</els>
<elm>22.5</elm>
<fl1>81</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>60</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>0</orht>
</reportdata>
<reportdata>
<sd>05/19/2022 13:58:28</sd>
<ed>05/19/2022 13:59:56</ed>
<so>4185526</so>
<eo>4185528</eo>
<et>87</et>
<mt>81</mt>
<or>1</or>
<os>0</os>
<es>0</es>
<lit>0</lit>
<lic>0</lic>
<sit>6</sit>
<sic>1</sic>
<gof>125</gof>
<vin>00000000000000000</vin>
<lif>0</lif>
<sif>0</sif>
<sf>13375750</sf>
<ef>13375875</ef>
<nce>0</nce>
<ct>0</ct>
<cf>0</cf>
<cd>0</cd>
<tgv>0</tgv>
<tgt>0</tgt>
<tgf>0</tgf>
<tgd>0</tgd>
<sbt>0</sbt>
<ba>1</ba>
<els>13</els>
<elm>29</elm>
<fl1>80</fl1>
<fl2>0</fl2>
<ht>0</ht>
<sg>60</sg>
<pfs>0</pfs>
<efl>0</efl>
<oslt>0</oslt>
<osht>0</osht>
<orlt>0</orlt>
<orht>1</orht>
</reportdata>
</pxreport>
</pnet_get_performx_data_packet>```

Related

Google maps Api SVG is not displayed in icons

SVG is not displayed in icons
Referenced sites
Add a background image (.png) to a SVG circle shape
https://codesandbox.io/s/react-google-maps-api-forked-pcup77?file=/src/index.js
source code
<LoadScript googleMapsApiKey="">
<GoogleMap
mapContainerStyle={containerStyle}
center={position}
zoom={17}
>
<Marker
position={position}
icon={{
url:
"data:image/svg+xml;utf-8, " +
'<svg width="100" height="100">' +
"<defs>" +
'<pattern id="image" patternUnits="userSpaceOnUse" height="100" width="100">' +
'<image x="0" y="0" height="100" width="100" xlink:href="http://i.imgur.com/7Nlcay7.jpg"></image>' +
"</pattern>" +
"</defs>" +
'<circle id="top" cx="50" cy="50" r="50" fill="url(#image)"/>' +
"</svg>",
}}
/>
</GoogleMap>
</LoadScript>
Is there a problem with SVG?
How to solve this problem?
I want to be able to display what I have created in SVG.

Tailwind Transition Backdrop Blur

Im using Tailwind, along with their HeadlessUI for Transitions on a modal
https://www.npmjs.com/package/#headlessui/react#transition
<Transition
show={show}
enter="transition ease-out duration-300"
enterFrom="opacity-0 "
enterTo="opacity-100"
leave="transition ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-gray-900 bg-opacity-75 backdrop-filter backdrop-blur-sm" aria-hidden="true" />
</Transition>
The above works, however the backdrop filter only applies once the Transition component has completed.
Does anyone know how I can get this to work so that the transition also applies to the backdrop filter?
Add an as={Fragment} attribute to Transition
import { Fragment } from "react";
<Transition
as={Fragment}
show={show}
enter="transition ease-out duration-300"
enterFrom="opacity-0 "
enterTo="opacity-100"
leave="transition ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>

How to set Material-UI icon for a form field ReactJS

I need to know how can I set an icon in front of the select field. I have already done this for TextField as below
<TextField
id="input-with-icon-textfield"
label="Env.Satisfaction"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<SentimentSatisfied />
</InputAdornment>
),
}}
/>
But I tried this with select and it didn't work:
<Select
labelId="demo-simple-select-label"
id="demo-simple-select"
value={age}
onChange={handleChange}
InputProps={{
startAdornment: (
<InputAdornment position="start">
<SupervisedUserCircle />
</InputAdornment>
),
}}
>
<MenuItem value={10}>Ten</MenuItem>
<MenuItem value={20}>Twenty</MenuItem>
<MenuItem value={30}>Thirty</MenuItem>
</Select>
Can someone please help me?
This is how it looks in a TextField, I want to do this for Select as well.
TextField
You can use two approaches,
First one is using the Select component
<Select
labelId="demo-simple-select-label"
id="demo-simple-select"
value={currency}
onChange={handleChange}
startAdornment={
<InputAdornment position="start">
<AccountCircle />
</InputAdornment>
}
>
{currencies.map(option => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</Select>
the second approach is using the Text field,
<TextField
id="standard-select-currency"
select
label="Select"
value={currency}
onChange={handleChange}
helperText="Please select your currency"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<AccountCircle />
</InputAdornment>
)
}}
>
{currencies.map(option => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
find a working example I created here: https://codesandbox.io/s/material-demo-8qxtv

Load XML file into MS SQL Server table

I asked this previously around 6 weeks ago but I wasn't particularly clear in terms of what I posted, what I expected and how it could be achieved. Despite the patience of some users, I was unable to solve my issue. I've gone back and tried to learn a bit more and hopefully I can now post something that makes more sense.
A customer sends his delivery schedules in the format of an XML file. It's not the most eloquent of files but I think I've made sense of it. What I need to get from it is a table like this, that tells me what quantity the customer wants of any given part on any given week. There's 50+ parts and 12 weeks but I've reduced it to 5 in the hope it can be posted here ok.
Schedule Date PartNumber Week Number Quantity
20/02/2020 Part0 0 0
20/02/2020 Part0 1 50
20/02/2020 Part0 2 0
20/02/2020 Part0 3 0
20/02/2020 Part0 4 50
20/02/2020 Part0 5 0
20/02/2020 Part1 0 0
20/02/2020 Part1 1 40
What I'll be doing is appending this information to a table every week and the schedule date is the date of the schedule. This date is taken from this line (line 11):
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
The part number, Week Number & Quantity are slightly more complicated. The part number comes from a list of numbers
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">PART0</RowTotal>
<RowTotal RowNumber="1">PART1</RowTotal>
<RowTotal RowNumber="2">PART2</RowTotal>
<RowTotal RowNumber="3">PART3</RowTotal>
<RowTotal RowNumber="4">PART4</RowTotal>
<RowTotal RowNumber="5">PART5</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
and the week number & quantity from this section;
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
where the row number is the part number reference and the column number the week. The value is the value (and formatted value).
What I was thinking was creating two tables, a reference table with all the part numbers & row numbers and a second table with the row number, week number and quantity, then join them together on the row field. Either of the tables can hold the Schedule Date.
Could someone please give me some code to help me achieve this.
I've tried this as a starting point to create the first table of part numbers but this just returns 0 records:
DECLARE #xml XML
SELECT #xml =
CONVERT(XML,bulkcolumn,2) FROM OPENROWSET(BULK 'theFile.xml',SINGLE_BLOB) AS X
DECLARE #tempTable TABLE (
partnumber NVARCHAR(50),
rownumber int
)
INSERT INTO #tempTable
SELECT Tbl.Col.value('#RowNumber', 'INT'),
Tbl.Col.value('#RowTotal','NVARCHAR(50)')
FROM #xml.nodes('//RowGroup') Tbl(Col)
SELECT * FROM #tempTable
Here is the XML:
<?xml version="1.0" encoding="UTF-8" ?>
<CrystalReport xmlns="urn:crystal-reports:schemas:report-detail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:crystal-reports:schemas:report-detail http://www.businessobjects.com/products/xml/CR2008Schema.xsd">
<ReportHeader>
</ReportHeader>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>customer details
UK</FormattedValue><Value> customer details2
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">PART0</RowTotal>
<RowTotal RowNumber="1">PART1</RowTotal>
<RowTotal RowNumber="2">PART2</RowTotal>
<RowTotal RowNumber="3">PART3</RowTotal>
<RowTotal RowNumber="4">PART4</RowTotal>
<RowTotal RowNumber="5">PART5</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
<ColumnTotal ColumnNumber="1"></ColumnTotal>
<ColumnTotal ColumnNumber="2"></ColumnTotal>
<ColumnTotal ColumnNumber="3"></ColumnTotal>
<ColumnTotal ColumnNumber="4"></ColumnTotal>
<ColumnTotal ColumnNumber="5"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>customerdetails2
UK</FormattedValue><Value>customer details 2
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">P22031</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>4</FormattedValue><Value>4.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>2nd delivery address
UK</FormattedValue><Value> 2nd delivery address
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">Part12</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
<ColumnTotal ColumnNumber="1"></ColumnTotal>
<ColumnTotal ColumnNumber="2"></ColumnTotal>
<ColumnTotal ColumnNumber="3"></ColumnTotal>
<ColumnTotal ColumnNumber="4"></ColumnTotal>
<ColumnTotal ColumnNumber="5"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>7</FormattedValue><Value>7.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>6</FormattedValue><Value>6.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<ReportFooter>
<Section SectionNumber="0">
</Section>
</ReportFooter>
</CrystalReport>
To make matters a little worse, there are two delivery addresses and the bottom section parts (there is only one part) is listed separately. It looks like these are only differentiated by the delivery addresses and nothing else. I think I'm happy to ignore this for now, unless it is easily worked around.
Thanks in advance.
I saved you XML file as 'e:\Temp\CrystalReport.xml'. Your XML has namespaces, and they need special treatment. WITH XMLNAMESPACES clause takes care of it.
Please see below how to load an XML file into a DB table.
SQL
DECLARE #tempTable TABLE (ID INT IDENTITY PRIMARY KEY, rownumber INT, partnumber NVARCHAR(50));
-- directly from the XML file as a virtual DB table on the file system
;WITH XMLNAMESPACES (DEFAULT 'urn:crystal-reports:schemas:report-detail')
, rs (xmldata) AS
(
SELECT TRY_CAST(BulkColumn AS XML) AS BulkColumn
FROM OPENROWSET(BULK 'e:\Temp\CrystalReport.xml', SINGLE_BLOB) AS x
)
INSERT INTO #tempTable (rownumber, partnumber)
SELECT c.value('(./#RowNumber)[1]', 'INT') AS RowNumber
, c.value('(./text())[1]','NVARCHAR(50)') AS RowTotal
FROM rs AS tbl
CROSS APPLY tbl.xmldata.nodes('/CrystalReport/Group/GroupFooter/Section/CrossTab/RowGroups/RowGroup/RowGroup/RowTotal') AS t(c);
-- test
SELECT * FROM #tempTable;
Output
+----+-----------+------------+
| ID | rownumber | partnumber |
+----+-----------+------------+
| 1 | 0 | PART0 |
| 2 | 1 | PART1 |
| 3 | 2 | PART2 |
| 4 | 3 | PART3 |
| 5 | 4 | PART4 |
| 6 | 5 | PART5 |
| 7 | 0 | P22031 |
| 8 | 0 | Part12 |
+----+-----------+------------+
I won't be going to read the whole and everything out of this XML, but - to show you the principles - I went quite some distance :-)
DECLARE #xml XML =
N'<CrystalReport xmlns="urn:crystal-reports:schemas:report-detail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:crystal-reports:schemas:report-detail http://www.businessobjects.com/products/xml/CR2008Schema.xsd">
<ReportHeader>
</ReportHeader>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>customer details
UK</FormattedValue><Value> customer details2
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">PART0</RowTotal>
<RowTotal RowNumber="1">PART1</RowTotal>
<RowTotal RowNumber="2">PART2</RowTotal>
<RowTotal RowNumber="3">PART3</RowTotal>
<RowTotal RowNumber="4">PART4</RowTotal>
<RowTotal RowNumber="5">PART5</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
<ColumnTotal ColumnNumber="1"></ColumnTotal>
<ColumnTotal ColumnNumber="2"></ColumnTotal>
<ColumnTotal ColumnNumber="3"></ColumnTotal>
<ColumnTotal ColumnNumber="4"></ColumnTotal>
<ColumnTotal ColumnNumber="5"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="1" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="2" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>50</FormattedValue><Value>50.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="3" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="4" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>40</FormattedValue><Value>40.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>20</FormattedValue><Value>20.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
<Cell RowNumber="5" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>10</FormattedValue><Value>10.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>customerdetails2
UK</FormattedValue><Value>customer details 2
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">P22031</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>4</FormattedValue><Value>4.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<Group Level="1">
<GroupHeader>
<Section SectionNumber="0">
<Text Name="Text4"><TextValue>DELIVERY SCHEDULE</TextValue>
</Text>
<Field Name="DataTime2" FieldName="DataTime"><FormattedValue>09:00:04</FormattedValue><Value>09:00:04</Value></Field>
<Field Name="DataDate2" FieldName="DataDate"><FormattedValue>10/02/2020</FormattedValue><Value>2020-02-10</Value></Field>
<Picture Name="Picture1" GraphicType="OLE">
</Picture>
<Text Name="Text13"><TextValue>DELIVERY ADDRESS</TextValue>
</Text>
<Text Name="Text8"><TextValue>SUPPLIER ADDRESS</TextValue>
</Text>
</Section>
<Section SectionNumber="1">
<Text Name="Text5"><TextValue>our details
</TextValue>
</Text>
<Field Name="WHS2" FieldName="{#WHS}"><FormattedValue>2nd delivery address
UK</FormattedValue><Value> 2nd delivery address
UK</Value></Field>
</Section>
<Section SectionNumber="2">
<Text Name="Text7"><TextValue>IMPORTANT
EACH ORDER REQUIRES A SEPERATE DELIVERY NOTE PER DELIVERY ADDRESS
</TextValue>
</Text>
</Section>
</GroupHeader>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<Group Level="2">
</Group>
<GroupFooter>
<Section SectionNumber="1">
<CrossTab Name="CrossTab2">
<RowGroups>
<RowGroup>
<RowGroup>
<RowTotal RowNumber="0">Part12</RowTotal>
</RowGroup>
</RowGroup>
</RowGroups>
<ColumnGroups>
<ColumnGroup>
<ColumnGroup>
<ColumnTotal ColumnNumber="0"></ColumnTotal>
<ColumnTotal ColumnNumber="1"></ColumnTotal>
<ColumnTotal ColumnNumber="2"></ColumnTotal>
<ColumnTotal ColumnNumber="3"></ColumnTotal>
<ColumnTotal ColumnNumber="4"></ColumnTotal>
<ColumnTotal ColumnNumber="5"></ColumnTotal>
</ColumnGroup>
</ColumnGroup>
</ColumnGroups>
<Cells>
<Cell RowNumber="0" ColumnNumber="0">
<CellValue Index="0"><FormattedValue>0</FormattedValue><Value>0.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="1">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="2">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="3">
<CellValue Index="0"><FormattedValue>7</FormattedValue><Value>7.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="4">
<CellValue Index="0"><FormattedValue>6</FormattedValue><Value>6.00</Value></CellValue>
</Cell>
<Cell RowNumber="0" ColumnNumber="5">
<CellValue Index="0"><FormattedValue>5</FormattedValue><Value>5.00</Value></CellValue>
</Cell>
</Cells>
</CrossTab>
</Section>
</GroupFooter>
</Group>
<ReportFooter>
<Section SectionNumber="0">
</Section>
</ReportFooter>
</CrystalReport>';
--The query
WITH XMLNAMESPACES(DEFAULT 'urn:crystal-reports:schemas:report-detail')
,Level1Groups AS
(
SELECT ROW_NUMBER() OVER(ORDER BY A.gr) AS GroupCounter
,A.gr.value('#Level','int') AS GroupLevel
,A.gr.query('GroupHeader') AS GroupHeader
,A.gr.query('Group') AS NestedGroups
,A.gr.query('GroupFooter') AS GroupFooter
FROM #xml.nodes('/CrystalReport/Group') A(gr)
)
,NestedData AS
(
SELECT L1gr.*
,A.sec.value('#SectionNumber','int') AS SectionNumber
,B.CrTab.value('#Name','nvarchar(max)') AS CrossTab_Name
,C.rt.value('#RowNumber','int') AS RowNumber
,C.rt.value('text()[1]','nvarchar(max)') AS RowLeadText
--,B.CrTab.query('ColumnGroups/ColumnGroup/ColumnGroup') AS ColumnGroup
,B.CrTab.query('Cells') AS GroupCells
FROm Level1Groups L1gr
OUTER APPLY L1gr.GroupFooter.nodes('GroupFooter/Section') A(sec)
OUTER APPLY A.sec.nodes('CrossTab') B(CrTab)
OUTER APPLY B.CrTab.nodes('RowGroups/RowGroup/RowGroup/RowTotal') C(rt)
)
,ColumnValues AS
(
SELECT *
,nd.GroupCells.query('for $c in distinct-values(Cells/Cell[#RowNumber=sql:column("nd.RowNumber")]/#ColumnNumber)
return <val ColumnNumber="{$c}">{Cells
/Cell[#RowNumber=sql:column("nd.RowNumber")
and #ColumnNumber=$c]
/CellValue
/FormattedValue
/text()}</val>
') AS RowValues
FROM NestedData nd
)
/* to see everything returned use this
SELECT cv.*
,A.vals.value('text()[1]','nvarchar(max)') AS CellValue
FROM ColumnValues cv
OUTER APPLY cv.RowValues.nodes('val') A(vals);
*/
SELECT cv.GroupHeader.value('(//Field[#FieldName="DataDate"]/FormattedValue/text())[1]','nvarchar(max)') As ScheduleDate
,cv.RowLeadText
,cv.RowNumber
,A.vals.value('#ColumnNumber','int') AS ColumnNumber
,A.vals.value('text()[1]','nvarchar(max)') AS CellValue
FROM ColumnValues cv
OUTER APPLY cv.RowValues.nodes('val') A(vals);
The result
+--------------+-------------+-----------+--------------+-----------+
| ScheduleDate | RowLeadText | RowNumber | ColumnNumber | CellValue |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 1 | 50 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 2 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 3 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 4 | 50 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART0 | 0 | 5 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 1 | 40 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 2 | 40 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 3 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 4 | 20 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART1 | 1 | 5 | 40 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 1 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 2 | 50 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 3 | 50 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 4 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART2 | 2 | 5 | 50 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 1 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 2 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 3 | 10 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 4 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART3 | 3 | 5 | 10 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 1 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 2 | 40 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 3 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 4 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART4 | 4 | 5 | 40 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 1 | 20 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 2 | 20 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 3 | 10 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 4 | 10 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | PART5 | 5 | 5 | 10 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | P22031 | 0 | 0 | 4 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 0 | 0 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 1 | 5 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 2 | 5 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 3 | 7 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 4 | 6 |
+--------------+-------------+-----------+--------------+-----------+
| 10/02/2020 | Part12 | 0 | 5 | 5 |
+--------------+-------------+-----------+--------------+-----------+
In order to resolve the CrossTabs I use some XQuery FLWOR returning the values in a re-generated XML.
Hint: Take away the namespace (and the first WITH line) to see the result in a better readable format.
I hope this helps a bit...

Multiple setInterval() using array

I want to animate all three circles using this one script.
But to achieve this, I need to create 3 variables like 'c1' right?
I got the code to work by duplicating everything:
http://jsfiddle.net/JwkYm/339/
It has to be easier then this. Thanks for your help in advance.
(function () {
// math trick 2*pi*57 = 358, must be less than 360 degree
var circleArr = ['orange-halo','orange-halo2','orange-halo3'];
var myTimerArr = ['myTimer','myTimer2','myTimer3'];
var interval = 30;
var angle = [0,0,0];
var angle_increment = 6;
var c1 = setInterval(function () {
var x = 0;
while(x >= 2)
{
document.getElementById(circleArr[x]).setAttribute("stroke-dasharray", angle[x] + ", 20000");
document.getElementById(myTimerArr[x]).innerHTML = parseInt(angle[x]/360*100) + '%';
if (angle[x] >= 270)
{
c1.clearInterval(c1.timer);
}
angle[x] += angle_increment;
x++;
}
}.bind(this), interval);
#myTimer, #myTimer2, #myTimer3 {
fill: #000099;
font-size: 40px;
font-family: Myriad light;
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 300 300" preserveAspectRatio="none" style="width:300; height:300; top:0; left:0;">
<circle cx="100" cy="100" r="73" id="blue-halo" fill="none" stroke="#000099" stroke-width="30" />
<circle cx="100" cy="100" r="73" id="orange-halo" fill="none" stroke="#FD6400" stroke-width="31" stroke-dasharray="0,20000" transform="rotate(-90,100,100)" />
<text id="myTimer" text-anchor="middle" x="100" y="110">0%</text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 300 300" preserveAspectRatio="none" style="width:300; height:300; top:0; left:0;">
<circle cx="100" cy="100" r="73" id="blue-halo2" fill="none" stroke="#000099" stroke-width="30" />
<circle cx="100" cy="100" r="73" id="orange-halo2" fill="none" stroke="#FD6400" stroke-width="31" stroke-dasharray="0,20000" transform="rotate(-90,100,100)" />
<text id="myTimer2" text-anchor="middle" x="100" y="110">0%</text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 300 300" preserveAspectRatio="none" style="width:300; height:300; top:0; left:0;">
<circle cx="100" cy="100" r="73" id="blue-halo2" fill="none" stroke="#000099" stroke-width="30" />
<circle cx="100" cy="100" r="73" id="orange-halo2" fill="none" stroke="#FD6400" stroke-width="31" stroke-dasharray="0,20000" transform="rotate(-90,100,100)" />
<text id="myTimer3" text-anchor="middle" x="100" y="110">0%</text>
</svg>
http://jsfiddle.net/JwkYm/341/

Resources