You can dump the contents of a data set to  word/Excel sheet and dispaly it in the browser.

1. Create a new web form and add a DataGrid control onto the form.Right-click on the grid and choose Auto Format from the context menu.

2. In the code behind just add this code in Page Render or Page Load event
 
Dim dataTbl As DataTable = _
CType(Application.Item("MyGridSet"), DataTable) 
Response.ContentType = "application/ms-word"
Response.AddHeader("Content-Disposition", _
      "inline;filename=Porttest.doc")
DataGrid1.DataSource = dt
DataGrid1.DataBind()
DataGrid1.RenderControl(writer)
On the current page provide a  button to navigate to the new page and pass the dataset/datatable to that page.
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish