Click here to Skip to main content
16,017,852 members
Home / Discussions / Web Development
   

Web Development

 
General30 day anniversary of this problem (:-() Pin
Asif Rehman22-Sep-04 3:22
Asif Rehman22-Sep-04 3:22 
Generalinsert text at cursor location -- TextArea Pin
devvvy20-Sep-04 21:30
devvvy20-Sep-04 21:30 
GeneralWebBrowser Control -- display string Pin
main@i-c.com.ua20-Sep-04 13:02
main@i-c.com.ua20-Sep-04 13:02 
Generalloading a bitmap in ASP Pin
DMurray20-Sep-04 9:00
DMurray20-Sep-04 9:00 
GeneralCertificates and WebServices Pin
species_84_7220-Sep-04 1:11
species_84_7220-Sep-04 1:11 
Questionhow can i convert from local connection into server conn ? Pin
19-Sep-04 23:01
suss19-Sep-04 23:01 
GeneralFormat file Excel ! Pin
Nguyen Van Vinh17-Sep-04 23:00
Nguyen Van Vinh17-Sep-04 23:00 
GeneralRe: Format file Excel ! Pin
Chris Quick24-Sep-04 11:08
Chris Quick24-Sep-04 11:08 
Have you considered using XML for generating and reading the excel file? You can generate an XML file and transform it using the XSL transformations for excel. I don't know if this will solve your problem, but having an XML version will enable the portability you are describing (also will get rid of the web page view). Also, if you use a dataset you can get to the XML representation of the data fairly quickly.

Here's an example of performing an XSLT transformation of XML data.

Private Sub FormatToExcel(ByVal xmlInfo As XmlDocument)
Dim myXMLDoc As XmlDocument = xmlInfo
Dim myXSLT As New Xsl.XslTransform
Dim myText As New IO.StringWriter
Dim myNav As XPath.XPathNavigator = myXMLDoc.CreateNavigator
Dim myWriter As New XmlTextWriter(myText)

myXSLT.Load(Server.MapPath("xslt/ExcelReport.xslt"))
myXSLT.Transform(myNav, Nothing, myWriter, Nothing)

Response.AddHeader("content-disposition", "attachment; filename=eventregistrants.xls")
Response.ContentType = "text/xml"
Response.Write("<?xml version=""1.0""?>" & myText.ToString)
End Sub

And here's the XSLT file:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<xsl:template match="*">
<ss:Workbook>
<ss:Worksheet ss:Name="Registration Data">
<ss:Table>
<ss:Row>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">First Name</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">Last Name</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">Email Address</ss:Data></ss:Cell>
ss:Type="String">Invoice ID</ss:Data></ss:Cell>
</ss:Row>
<xsl:for-each select="Registrants">
<ss:Row>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="FirstName"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="LastName"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="EmailAddress"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="InvoiceID"/></ss:Data></ss:Cell>
</ss:Row>
</xsl:for-each>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>
</xsl:template>

</xsl:stylesheet>

As for uploading files, you will need to incorporate a regular HTML File input control. Right click on the control and make sure the check "Run as server control". You then have access to methods and properties to save this file.
GeneralHide columns was maked by autoGenerateColums=&quot;true&quot;. Help me ! Pin
Nguyen Van Vinh17-Sep-04 17:59
Nguyen Van Vinh17-Sep-04 17:59 
GeneralRe: Hide columns was maked by autoGenerateColums=&quot;true&quot;. Help me ! Pin
yiyanxiyin19-Sep-04 15:42
yiyanxiyin19-Sep-04 15:42 
Generalto Yiyanxiyin ! Pin
20-Sep-04 23:31
suss20-Sep-04 23:31 
Generalintranet search Pin
khowlett17-Sep-04 14:41
khowlett17-Sep-04 14:41 
QuestionHow do I share an instance of class between multiple calls to a Webservice? Pin
Paul Evans17-Sep-04 7:10
Paul Evans17-Sep-04 7:10 
AnswerRe: How do I share an instance of class between multiple calls to a Webservice? Pin
Paul Evans17-Sep-04 7:12
Paul Evans17-Sep-04 7:12 
Generalreplace [url]whatever[/url] .. Pin
Larry Antram16-Sep-04 21:27
Larry Antram16-Sep-04 21:27 
GeneralRe: replace [url]whatever[/url] .. Pin
Jon Sagara16-Sep-04 23:39
Jon Sagara16-Sep-04 23:39 
GeneralRe: replace [url]whatever[/url] .. Pin
Larry Antram17-Sep-04 0:15
Larry Antram17-Sep-04 0:15 
GeneralRe: replace [url]whatever[/url] .. Pin
Jon Sagara17-Sep-04 0:18
Jon Sagara17-Sep-04 0:18 
GeneralRe: replace [url]whatever[/url] .. Pin
Larry Antram17-Sep-04 0:27
Larry Antram17-Sep-04 0:27 
GeneralRe: replace [url]whatever[/url] .. Pin
Jon Sagara17-Sep-04 0:30
Jon Sagara17-Sep-04 0:30 
QuestionHow to ... in Crystal Report 9? Pin
HyVong16-Sep-04 12:29
HyVong16-Sep-04 12:29 
GeneralExcel loader to asp Pin
steve75916-Sep-04 7:28
steve75916-Sep-04 7:28 
GeneralProblems in user control name after installing .NetFramework 1.0 sp1 Pin
GanesanM16-Sep-04 5:01
GanesanM16-Sep-04 5:01 
GeneralSynchronization between two web pages asp 3 Pin
jackboy7016-Sep-04 4:15
jackboy7016-Sep-04 4:15 
GeneralRe: Synchronization between two web pages asp 3 Pin
jackboy7016-Sep-04 4:18
jackboy7016-Sep-04 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.