473,698 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ 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">Ove rall 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.Conten tType = "applicatio n/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charse t = ""
' Turn off the view state.
Me.EnableViewSt ate = False
Dim tw As New System.IO.Strin gWriter
Dim hw As New System.Web.UI.H tmlTextWriter(t w)
' Get the HTML for the control.
dgJobs.RenderCo ntrol(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 2925

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

Similar topics

6
5888
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 tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) gridList.Columns(0).Visible = False
7
3268
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. In the excel sheet only Master grid content shows up and NOT the detail grid??
2
395
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 = "application/vnd.ms-excel";
2
2469
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 to datagrid and it is giving an alert that following stylesheets are missing when i export it. can anyone help me about this problem. I have seen the sites and articles regarding the datagrid export to excel. but still i am getting the same...
3
4351
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 export only the contents of the Datagrid to excel. i don't need all other stuff which is present on the page. is there any way to achieve it. Thanks in Advance
3
1667
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 EventArgs ) Response.Clear() Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
0
1473
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
2733
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 the event handler for a form button. Is there other ways to accomplish this? I looked at some on the web and usergroups, but was confused as to the functioning. BTW my datagrid is enclosed in a <div></divfor ease of scrolling if that would...
1
1209
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. Nomen NIIN Qty Key 000234567 2 Ring 002818181 3 The problem is that I loose the leading zero's. How can I update the dataset to concatenate an apostrophe to the beginning of each NIIN...
0
8678
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9166
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7737
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.