-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: lemravec
Message 4 in Discussion
______________________________________________________________
> Od: "cool" <[EMAIL PROTECTED]>
> Komu: "MumbaiUserGroup" <[EMAIL PROTECTED]>
> CC:
> D�tum: Wed, 28 Jan 2004 22:10:51 -0800
> Predmet: Problem with Excel format when genarating through
ASP.NET
>
> -----------------------------------------------------------
>
> New Message on MumbaiUserGroup
>
> -----------------------------------------------------------
> From: cool
> Message 1 in Discussion
>
> Please help! I am opening a new window that contains an Excel
spreadsheet. The first column is a 13 digit identification
number. This number can start with a zero. My problem is that
when the data is displayed in the Excel window will display as
89615670000 when it should display as 0089615670000. I can get
the data to display correctly if I append a ' (upporstroph)
before the number. However the ' displays in the data
('0089615670000) , here i want the data to be without (') e.g
(0089615670000). How can I fix this? For this i am folowing
these steps: 1- I am making a dataset from the dataset which
contains string type data. 2- i have a class file contains
function, which generates the excel file through my dataset. For
generating the excel file i am using this function which has a
datagrid.
> Public Shared Sub Convert(ByVal ds As System.Data.DataSet,
ByVal TableIndex As Integer, ByVal response As
System.Web.HttpResponse)
> If TableIndex > ds.Tables.Count - 1 Then
> Convert(ds, response)
> End If
> response.Clear()
> response.Charset = ""
> response.Charset = "Text"
> response.ContentType = "application/vnd.ms-Excel"
> Dim stringWrite As New System.IO.StringWriter()
> Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)
> 'instantiate a datagrid
> Dim dg As New System.Web.UI.WebControls.DataGrid()
> 'set the datagrid datasource to the dataset passed in
> dg.ItemStyle.ToString()
> dg.DataSource = ds.Tables(TableIndex)
> 'bind the datagrid
> dg.ItemStyle.CssClass = "myformattednumber"
> dg.DataBind()
> dg.ShowHeader = False
> 'tell the datagrid to render itself to our htmltextwriter
> dg.RenderControl(htmlWrite)
> 'all that's left is to output the html
> response.Write(stringWrite.ToString)
> response.End()
> End Sub Can any one tell me what do i do here to print the
(0089615670000) as its is without using (') Thanks vijay dubey
>
> -----------------------------------------------------------
>
> To stop getting this e-mail, or change how often it arrives, go
to your E-mail Settings.
> http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
>
> Need help? If you've forgotten your password, please go to
Passport Member Services.
> http://groups.msn.com/_passportredir.msnw?ppmprop=help
>
> For other questions or feedback, go to our Contact Us page.
> http://groups.msn.com/contact
>
> If you do not want to receive future e-mail from this MSN
group, or if you received this message by mistake, please click
the "Remove" link below. On the pre-addressed e-mail message that
opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
> mailto:[EMAIL PROTECTED]
>
--->Just try to change the format of the collumn (i think you
have not defined an yet and therefor converts excel to a number
001-> 1 and '001' to text 001 ) or try to specify a custom
format. It shoud work.
---------------------------------------------------------
http://mail.centrum.sk/ - Chce? nov� e-mail, zriad si ho!
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]