Click here to Skip to main content
Sign Up to vote bad
good
See more: VBJava.NETPHP
I am doing a project to show graph from excel file. the excel file is generated from the database.the input file in .csv format. and output file in .xls format.How can i do this by using PHP or .net or java , vb?
Posted 28-Dec-12 16:09pm
Edited 28-Dec-12 20:41pm


1 solution

this mite help you....
 
public static void ExportXls(GridView gridName, string filename)
    {
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + filename + ".xls");
        HttpContext.Current.Response.Charset = "";
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.ContentType = "application/Excel";
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        gridName.RenderControl(htmlWrite);
        HttpContext.Current.Response.Write(stringWrite.ToString());
        HttpContext.Current.Response.End();
    }
The foll method is required in the page on which you want to export to excel...
public override void VerifyRenderingInServerForm(Control control)
    {
 
    }
i dunno about the graph...sorry
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Prasad_Kulkarni 407
1 Christian Graus 363
2 Sergey Alexandrovich Kryukov 325
3 _Amy 288
4 OriginalGriff 285
0 Sergey Alexandrovich Kryukov 6,649
1 Prasad_Kulkarni 3,281
2 _Amy 3,065
3 OriginalGriff 2,989
4 CPallini 2,696


Advertise | Privacy | Mobile
Web01 | 2.6.130617.1 | Last Updated 29 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid