Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2009, 05:38 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting problem while exporting a web page in ms-excel in asp.net using C#

HiI am using Asp.Net 2.0 and C# 2005. I have created a web page and i am exporting that page in excel,but the problem is that when the page gets displayed in ms excel the format is getting changed.That is receipt number is a column in grid and 234500009890 is a row in that column ( here 234500009890 is the receipt number ) then in the excel page it is showing as 2.34E2 something like this.This is just an example of the error that i am facing.I want the receipt number in the same format as it is.I dont want the format to change.Please help and provide with ur valuable suggestions.Thanks and RegardsPraveen Kumar
 
Old April 5th, 2009, 08:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can either change the formatting of the cell to simple Text in Excel, or you can prefix the exported value with a tick (') so Excel treats it as a simple string, rather than as a large number.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
export asp.net page to ms word and embed images Itech ASP.NET 2.0 Professional 2 March 6th, 2014 03:39 AM
Calling WMI from ASP.Net Web Page vikingsunil ASP.NET 1.0 and 1.1 Professional 0 June 7th, 2007 05:19 AM
ASP to Excel - excel output formatting issue mat41 Classic ASP Professional 0 August 13th, 2006 06:41 AM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM
Exporting to Excel from .NET jbenson001 ASP.NET 1.x and 2.0 Application Design 4 February 6th, 2004 04:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.