Click here to Skip to main content
11,710,824 members (88,108 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 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 270
2 Peter Leow 134
3 Abhinav S 130
4 Richard MacCutchan 80
0 Abhinav S 60
1 Member 4653839 40
2 barneyman 35
3 Sergey Alexandrovich Kryukov 35
4 Member 11793820 35


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | 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