Click here to Skip to main content
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 20:40pm
Edited 28-Mar-13 21:11pm
(no name)16.6K
v2

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

  Print Answers RSS
0 OriginalGriff 325
1 Sergey Alexandrovich Kryukov 289
2 CPallini 275
3 DamithSL 260
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2014
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