Click here to Skip to main content
11,647,828 members (55,432 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Here this is my Code



LoginDetails objLogin = (LoginDetails)Session["LoginDetils"];
                int _BranchID = Convert.ToInt32(objLogin.BranchID.ToString());
                int _FinancialyearID = Convert.ToInt32(objLogin.FinancialyearID.ToString());
                int _WarehouseID = Convert.ToInt32(objLogin.WarehouseID.ToString());
                DateTime Date = Convert.ToDateTime(txtDate.SelectedDate);
                Dashboard objInvSalesDashboard = new Dashboard();
                DataSet Ds = new DataSet();
 
                Ds = objInvSalesDashboard.DailyPurchaseReport(_FinancialyearID, _BranchID, _WarehouseID, Date);
                StreamWriter xmlDoc = new StreamWriter(Server.MapPath("~/images/Testdo.xml"), false);
                Ds.WriteXml(xmlDoc);
                xmlDoc.Close();
 

                string strFullPath = Server.MapPath("~/images/Testdo.xml");
                string strContents = null;
                System.IO.StreamReader objReader = default(System.IO.StreamReader);
                objReader = new System.IO.StreamReader(strFullPath);
                strContents = objReader.ReadToEnd();
                objReader.Close();
 
                string attachment = "attachment; filename=test.xml";
                Response.ClearContent();
                Response.ContentType = "application/xml";
                Response.AddHeader("content-disposition", attachment);
                Response.Write(strContents);
                Response.End();

Here Iam getting the Out Put Like This


<NewDataSet>
 <Table>
  <Date>07/01/2012</Date> 
  <Billno>27</Billno> 
  <PatientName>v1</PatientName> 
  <ItemName>PB32 POWERBOR MACHINE - 240V</ItemName> 
  <BillAmount>1000.000000</BillAmount> 
  </Table>
 <Table>
  <Date>07/01/2012</Date> 
  <Billno>27</Billno> 
  <PatientName>v1</PatientName> 
  <ItemName>PB32 POWERBOR MACHINE - 240V</ItemName> 
  <BillAmount>600.000000</BillAmount> 
  </Table>
  </NewDataSet>


so here for BillNo 27 its Repeating

i need the output to be like this


<NewDataSet>
 <Table>
  <Billno=27  Date=07/01/2012  PatientName=v1> 
 
  <ItemName>PB32 POWERBOR MACHINE - 240V</ItemName> 
  <BillAmount>1000.000000</BillAmount> 
  <ItemName>PB32 POWERBOR MACHINE - 240V</ItemName> 
  <BillAmount>600.000000</BillAmount> 
 </Billno>
 
</NewDataSet>
 </Table>
Posted 28-Mar-13 19:40pm
Edited 28-Mar-13 20:11pm
(no name)16.7K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 jyo.net 500
1 F-ES Sitecore 370
2 DamithSL 290
3 CPallini 290
4 OriginalGriff 277
0 OriginalGriff 1,342
1 jyo.net 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 845


Advertise | Privacy | Mobile
Web02 | 2.8.150804.4 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100