473,382 Members | 1,791 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,382 software developers and data experts.

Webclient.downloaddata

Hi

We are creating a web application using .NET which renders some reports. The
reports are created in MS Reporting Services and can be accessed by typing in
a URL with the required parameters in a browser. The reports are getting
rendered fine if I type the URL in the browser. Within the web application,
however, we are using the webclient.downloaddata method to extract the HTML
by specifying the URL and rendering within the .NET application. Here I am
finding that the report is not maintaing its formatting. More specifically,
the webclient.downloaddata method doesnot seem to extract the style element
in the HTML source code which seems to be causing the problem.

Any suggestions. We are fast approaching our deadlines.

Thanks
--
Rags
Nov 18 '05 #1
2 4869
if you are using IE or something this might be helpful.

what html the controls render is determined by the browser and since by
default webclient doesnt not explicity specify any... it goes for browser
neutral styles and html.

try this sort of mechanism (from msdn webclient overview)

' Add a user agent header in case the
' requested URI contains a query.
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.2; .NET CLR 1.0.3705;)")

same syntax for C# and VB.NET

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Rags" <Ra**@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi

We are creating a web application using .NET which renders some reports. The reports are created in MS Reporting Services and can be accessed by typing in a URL with the required parameters in a browser. The reports are getting
rendered fine if I type the URL in the browser. Within the web application, however, we are using the webclient.downloaddata method to extract the HTML by specifying the URL and rendering within the .NET application. Here I am
finding that the report is not maintaing its formatting. More specifically, the webclient.downloaddata method doesnot seem to extract the style element in the HTML source code which seems to be causing the problem.

Any suggestions. We are fast approaching our deadlines.

Thanks
--
Rags

Nov 18 '05 #2
Sorry for the delay in replying. Thanks for the suggestion. That worked

"Hermit Dave" wrote:
if you are using IE or something this might be helpful.

what html the controls render is determined by the browser and since by
default webclient doesnt not explicity specify any... it goes for browser
neutral styles and html.

try this sort of mechanism (from msdn webclient overview)

' Add a user agent header in case the
' requested URI contains a query.
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.2; .NET CLR 1.0.3705;)")

same syntax for C# and VB.NET

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Rags" <Ra**@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi

We are creating a web application using .NET which renders some reports.

The
reports are created in MS Reporting Services and can be accessed by typing

in
a URL with the required parameters in a browser. The reports are getting
rendered fine if I type the URL in the browser. Within the web

application,
however, we are using the webclient.downloaddata method to extract the

HTML
by specifying the URL and rendering within the .NET application. Here I am
finding that the report is not maintaing its formatting. More

specifically,
the webclient.downloaddata method doesnot seem to extract the style

element
in the HTML source code which seems to be causing the problem.

Any suggestions. We are fast approaching our deadlines.

Thanks
--
Rags


Nov 18 '05 #3

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

Similar topics

2
by: Gary Short | last post by:
Hello group, I was wondering if anyone here could help me with an odd WebClient problem. When I run the following code: WebClient aWebClient = new WebClient(); Byte aBA =...
1
by: yyy | last post by:
This problem bothers me for a long time: I use WebClient.DownloadData in order to read text from an HTML document this way: WebClient c = new WebClient(); string html=...
1
by: ATS | last post by:
ERR - WebClient.DownloadData returns "protocol violation" Please help, I'm getting a "protocol violation" from a site that is working perfectly fine when I issue WebClient.DownloadData as...
1
by: YA | last post by:
I am using WebClient to download a text file from the net every 2 minutes. The problem is that I think I am reading the file from cache since when the file is change I still get the old file. Here...
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
4
by: Crirus | last post by:
Hi there! Fisrt the question: there is a ay to make the DownloadData when I want? I have a WebClient class I use myWebClient.DownloadData(remoteUrl) to connect to internet server All this in...
1
by: Scampi | last post by:
Hi, I've been working on an application to do some 'scraping' of web content, using the WebClient class. I'm using code rather like the following.. Dim objWebClient As New WebClient Dim...
0
by: Ron | last post by:
Hi. I have a webserver which executes the following code: m_webclient = New WebClient Dim byteArray As Byte() byteArray = m_webclient.DownloadData(url) This actually retrieves an XML...
1
by: jmk | last post by:
I'm trying to use an external SMS-service through .NET Framework 1.1 and using the webClient.DownloadData(strMessage) method. The strMessage is a string consisting the parameters to send a message,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.