473,472 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid 'colspan' export to Excel problem

Hi,

I have an 'export to excel' button on my Datagrid. All works well
except that on my Datagrid, I have sub total rows. The subtotal rows
use colspan so that the subtotals are given above certain columns

When I export to excel, I do not have the colspan. As a result, the
subtotals appear over the wrong columns in Excel.
This is how the export looks -

<td >Overall
Total</td><td>0</td><td>-2024.430</td><td>-2024.430</td><td>0</td><td>2024.430</td><td></td><td></td><td></td><td></td>

This is how the datagrid looks -

<td colspan="5">Overall Total</td><td
align="Center">0</td><td>-2024.430</td><td
align="Center">-2024.430</td><td align="Center">0</td><td>2024.430</td>

Here is the export function -

Public Sub ExcelExport()
Response.ContentType = "application/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charset = ""
' Turn off the view state.
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
' Get the HTML for the control.
dgJobs.RenderControl(hw)
' Write the HTML back to the browser.
Response.Write(tw.ToString())
' End the response.
Response.End()
End Sub

How do i get around this.

Thanks for any help.

Nov 21 '05 #1
0 2901

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric | last post by:
Dear All, I want to export datagrid content to a Excel file, the code just like below: Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Me.EnableViewState = False Dim...
7
by: vinay | last post by:
I have created a Master-Detail DataGrid The detail grid is embedded inside the Mastergrid with each row. Adding the detail grid in ItemDatabound event. I am exporting the Grid to a Excel....
2
by: C | last post by:
Hi, I have a dataset which I bind to a datagrid on my ASPX. I then export the datagrid to Excel and stream the file to the user by setting the MIME Type etc etc. Response.ContentType =...
2
by: Bidarkota | last post by:
Hi, I have a DataGrid in which there are some images and Data are displayed and in the webform.asp page i am using some stylesheets. when i export the datagrid all the images are also exported...
3
by: Bidarkota | last post by:
When i export DataGrid to Excel all the HTML contents are also exporting to excel. i am using stylesheets in the ASPX Page and i am getting an alert message that stylesheets are missing. i need to...
3
by: mattdaddym | last post by:
Hi all, I have been using the following code to export my datagrids to excel for quite some time. Very simple and very effective. <code> Sub btnExcelExport_Click ( s As Object, e As...
0
by: madhavit | last post by:
hi, i am able to export datagrid data to excel sheet but the problem is i am not able to export datagrid within datagrid data to excel. can anybody help me. thanx.
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
1
by: Reggie | last post by:
Hi and TIA! I have a datagrid inside a panel control. I have a procedure that exports the panel control and thus the datagrid to excel. The datagrid has the following sample fields/data. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.