Sign In  Sign Up Live-Chat

Storing the grid values into excell file

Last post 08-07-2008, 5:27 AM by Amjad Sahi. 3 replies.
Sort Posts: Previous Next
  •  08-06-2008, 1:49 AM 138488

    Storing the grid values into excell file

    Hi,

    This is seshadri.I want to store my grid values in to some "xls" file. i used the below code.

    GridWeb5.WebWorksheets.SaveCSVFile(Server.MapPath("~/ExcelCS/temp.xls"));

    could you please help me soon.I am using visual studio 2005,.net 2.0.

     

    thanks and regards,

    seshadri

     
  •  08-06-2008, 3:12 AM 138502 in reply to 138488

    Re: Storing the grid values into excell file

    Hi,

    Please try:

    GridWeb5.WebWorksheets.SaveToExcelFile(Server.MapPath("~/ExcelCS/temp.xls"));

    Thank you


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  08-07-2008, 4:39 AM 138702 in reply to 138502

    Re: Storing the grid values into excell file

    Hi,

    I have three grids.i want to export the three grids in to three excell files for one button click.can you please send me the solution.

    thanks and regards

    seshadri.

     
  •  08-07-2008, 5:27 AM 138711 in reply to 138702

    Re: Storing the grid values into excell file

    Hi Seshadri,

    May the  following example help you for your requirement.

    In the example I have a webform, I place two gridweb controls on it (so you may paste three for your need). I place an Asp.NET button on it. On its click I will save the two gridweb's data to save two excel files.

    .CS Source

    protected void Page_Load(object sender, EventArgs e)

    {

    //if first visit this page clear GridWeb1

    if (!IsPostBack)

    {

    //First you have to make the Button1's click event to extract gidweb's data.

    Button1.Attributes["onclick"] = "GridWeb1.updateData(); GridWeb1.validateAll(); GridWeb2.updateData(); return GridWeb2.validateAll();";

    }

    }

    protected void Button1_Click(object sender, EventArgs e)

    {

    // Gets the web application's path.

    string path = Server.MapPath("~");

    // Upper level.

    path = path.Substring(0, path.LastIndexOf("\\"));

    string fileName1 = path + "\\File\\first.xls";

    string fileName2 = path + \\File\\second.xls;

    //I save the two excel file on the server.

    GridWeb1.WebWorksheets.SaveToExcelFile(fileName1);

    GridWeb2.WebWorksheets.SaveToExcelFile(fileName2);

     

    }

     

    Hope, it will help you.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
View as RSS news feed in XML