XML : how to convert xlm file below to excel with nodes as column names and its values as rows in c#

  <ENVELOPE>      <HEADER>          <TALLYREQUEST>Import Data</TALLYREQUEST>      </HEADER>      <BODY>          <IMPORTDATA>              <REQUESTDESC><REPORTNAME>All Masters</REPORTNAME><STATICVARIABLES><SVCURRENTCOMPANY>MSIT</SVCURRENTCOMPANY></STATICVARIABLES></REQUESTDESC>              <REQUESTDATA>                  <TALLYMESSAGE>      <Entry_x0020_NO.>125</Entry_x0020_NO.>      <DATE>12</DATE>      <GUID>1258</GUID>      <NARRATION>1542</NARRATION>      <VOTURETYPENAME>456</VOTURETYPENAME>      <NAME>achuth</NAME>      <AMOUNT>250</AMOUNT>    </TALLYMESSAGE>              </REQUESTDATA>          </IMPORTDATA>      </BODY>  </ENVELOPE>    

the above XML is taken as input and convert to excel as below

  Entry No.   date  guid   narration   voucher   name   amount    125         12     1258     1542      456      achuth  250    

the code for me throws error null reference as belowenter image description here

No comments:

Post a Comment