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();
<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>
<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>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)