Is it possible to do something like this with ADC

Last post 04-01-2009 8:42 AM by Sonu. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-31-2009 1:51 AM

    • sanusp
    • Top 75 Contributor
    • Joined on 03-12-2009
    • Wannabe Slacker
    • Points 110

    Is it possible to do something like this with ADC

     

    i  would like to implement the following feature using ADC.

    http://www.aspdotnetcodes.com/Example_Export_GridView_To_Excel.aspx

    any tips where to start and end!!!!

    Regards

    Sanu

  •  Advertisement

    Featured Advertisement

     
  • 03-31-2009 7:47 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Is it possible to do something like this with ADC

    I would use aspose to send the data from the webservice to excel.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 03-31-2009 10:52 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 19,057

    Re: Is it possible to do something like this with ADC

     I do not have the time to really test out, but just wondering the regular code behind web function, used it as either web service or page function, can deliver the data directly to excel.

      Something like the following:


                string attachment = "attachment; filename=" + tablename + ".xls";

                Response.ClearHeaders();
                Response.ClearContent();

                Response.AddHeader("content-disposition", attachment);

                Response.ContentType = "application/vnd.ms-excel";

                StringWriter sw = new StringWriter();

                DataView dv = dt.DefaultView;
                string filter;

                if (userid.Text == "")
                    filter = "userid <> ''";
                else
                    filter = "userid = '" + userid.Text + "'";

                DataRow[ rows =dt.Select(filter);


    //            Response.Write("<html>");
                            Response.Write("<HTML><head></head><body><table>");

                            Response.Write("<tr>");

                for (int j = 0; j < dt.Columns.Count; j++)
                    Response.Write("<td>" + dt.Columns[j].ColumnName + "</td>");

                Response.Write("</tr>");

                for (int i = 0; i < rows.Length; i++)
                {
                    Response.Write("<tr>");
                    for (int j = 0; j < dt.Columns.Count; j++)
                        Response.Write("<td>" + rowsIdea[j].ToString() + "</td>");
                }
                Response.Write("</tr>");
                Response.Write("</table>" );

                Response.Write("</body></html>");
                //HtmlTextWriter htw = new HtmlTextWriter(sw);

                //gvwSurvey.RenderControl(htw);


                Response.End();

  • 03-31-2009 1:47 PM In reply to

    • sanusp
    • Top 75 Contributor
    • Joined on 03-12-2009
    • Wannabe Slacker
    • Points 110

    Re: Is it possible to do something like this with ADC

    will try it out...for sure when is the expected release of version 2.0

  • 04-01-2009 8:42 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Is it possible to do something like this with ADC

    There is no date set yet.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
Page 1 of 1 (5 items)