0

Hi

I created the web project using Asp.net.In that web site It read from database and show
result in data grid.There is save button using that I can save it into excel file.the problem if I selected data with one month(20010-01-01 to 2010-01-31) ,then there are more data,but in data grid its show only only first date(2010-01-01) data only.So how do u move into next data page in data grid?Second problem is if i click on save button its only save only first date data into excel file.Please help me.Below I mention the coding that I use to export data in excel file.

private void ExportGridView(string str)
    {
        string filename = str;
        string attachment = "attachment; filename="+filename;

        Response.ClearContent();

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

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

        StringWriter sw = new StringWriter();

        HtmlTextWriter htw = new HtmlTextWriter(sw);

        Dataview1.RenderControl(htw);

        Response.Write(sw.ToString());

        Response.End();

    }
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Tank50
0

Hi

There is save button using that I can save it into excel file.the problem if I selected data with one month(20010-01-01 to 2010-01-31) ,then there are more data,but in data grid its show only only first date(2010-01-01) data only.

Are you looking for paging? Please post the query and also check the format of date.

0

HI

Format is okay,because if i filter data between 2010-01-01 to 2010-01-30 there are more than 500 records.but problem is in data grid it only show 2010-01-01 data only,if I export it into excel file,there are only 2010-01-01 data available.After that I select as start date as 2010-01-02 and end data 2010-01-02 so in that case there are data available for 2010-01-02.So why It doesn't appear in first case.

Thanks
Tank50

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.