473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Downloading Dynamic Excel

MRW
Hello!

I've been on this for hours with little progress, so any help would be
appreciated.

I'm trying to use ASP.NET (VB) to send two variables to a server (not
mine), which uses those variables to create an Excel file and sends it
back (in binary format).

Using WebClient, I've been able to send the information and receive a
reply. However, I can't seem to encode the "response" into proper
format to save it properly without corruption.

Here's the code I've used so far:

Dim myWebClient = New System.Net.WebClient
myWebClient.Headers.Add("Content-Type", "application/x-www-
form-urlencoded")
Dim toEF As String = "sort=1&clientID=845"
Dim bytes() As Byte = myWebClient.UploadData("https://
blah, blah, blah.php", "POST",
System.Text.Encoding.ASCII.GetBytes(toEF))
myWebClient = Nothing

x = System.Text.Encoding.ASCII.GetString(bytes)

Dim fp As StreamWriter

Try
fp = File.CreateText(Server.MapPath("\test\") &
"test.xls")
fp.WriteLine(x)
fp.Close()
Jun 27 '08 #1
0 647

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

Similar topics

0
by: Sathya | last post by:
Hi Am using an ASP.NET website. i have an excel template stored in a folder in the server. the excel template already has some data inside. i need to add some more data to the excel sheet...
0
by: Sathya | last post by:
Hi Am using an ASP.NET website. i have an excel template stored in a folder in the server. the excel template already has some data inside. i need to add some more data to the excel sheet...
2
by: Radha Raman | last post by:
hi I am facing problem in downloading excel sheet with macros. So i decide to create a EXE for that. But how to create that EXE for downloading excel file, i don't know. Plz help me
1
by: Muddasir | last post by:
Hello everyone. I am facing problem in downloading .xls file. I generate report and save data in excel sheet on server. and once user click the 'save data in excel format', an excel sheet is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.