473,779 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export to Excel and firewalls

Hi,

One of my clients has a strange problem with my webapplication which I think may be related to some firewall setting on his computer.

On several screens in the application, it is possible to click on an icon to start an export of data to Excel.
The click on the icon triggers a form submit (a post, not a get) to a blank page, thereby passing the SQL select statement to use for the Excel export.

I've never had any problem reports about this Excel export feature, but now one of my clients claims that the export doesn't work for him on his computer.
He gets an error that indicates that the SQL query is somehow not passed to the blank page.

He has tried the same thing on another computer as well, and then there is no problem whatsoever.

Can this issue indeed be related to some firewall setting on his own computer?
And if so, what would he have to do to prevent this problem?
And if not, what else could be the cause of this Excel export problem?

Regards,
--
Marja Ribbers-de Vroed

Nov 22 '05 #1
3 2018

Marja Ribbers-de Vroed wrote:
Hi,

One of my clients has a strange problem with my webapplication which I think may be related to some firewall setting on his computer.

On several screens in the application, it is possible to click on an icon to start an export of data to Excel.
The click on the icon triggers a form submit (a post, not a get) to a blank page, thereby passing the SQL select statement to use for the Excel export.

I've never had any problem reports about this Excel export feature, but now one of my clients claims that the export doesn't work for him on his computer.
He gets an error that indicates that the SQL query is somehow not passed to the blank page.


Since ASP is all server side, whatever you're outputting back to the
client is on port 80. Since you have port 80 open (by the fact that
the client can get to your webpage) I don't see how this could be a
firewall issue at all.

You need to post the code along with the SQL error to get any more
help.

Nov 22 '05 #2
> Since ASP is all server side, whatever you're outputting back to the
client is on port 80. Since you have port 80 open (by the fact that
the client can get to your webpage) I don't see how this could be a
firewall issue at all.
Sound reasonable, so I guess this isn't a firewall issue.
You need to post the code along with the SQL error to get any more
help.


I use Response.Conten tType = "applicatio n/vnd.ms-excel" to output to Excel.

The full SQL query is in a hidden field of the form that is being posted to the page that outputs to Excel.
The receiving ASP page uses a custom datagrid control to create the datatable to export:

Function wsShowGrid()
Dim l_oDataGrid, l_sSql, l_sPattern, l_oRegExp, l_aMatch, l_sTable
l_sSql = Request("hidden GridSql")
If (l_sSql = "") Then
l_sSql = Request("sql")
End If
l_sTable = Request("hidden GridTable")
If (l_sTable = "") Then
l_sTable = Request("table" )
End If
Set l_oDataGrid = New wsDataGrid
With l_oDataGrid
.wsCommand = l_sSql
.wsTableName = l_sTable
.wsPrimaryKeyCo lumn = "ID"
.wsPageResults = False
.wsAllowView = False
.wsAllowFilter = False
.wsAllowSort = False
Call .wsSetTableOpti ons(null,null,n ull,1)
wsShowGrid = .wsBind()
End With
Set l_oDataGrid = Nothing
End Function

As you can probably see the SQL select query should be passed through Request("hidden GridSql"), which is successful in all cases except for this one user.

The error this one user receives has to do with the wsBind() call.
The webapplication complains that the SQL command has not been set yet.
Very, very strange!

Any insights would be grately appreciated.

Regards, Marja
Nov 22 '05 #3
Marja Ribbers-de Vroed wrote:
Since ASP is all server side, whatever you're outputting back to the
client is on port 80. Since you have port 80 open (by the fact that
the client can get to your webpage) I don't see how this could be a
firewall issue at all.
Sound reasonable, so I guess this isn't a firewall issue.
You need to post the code along with the SQL error to get any more
help.


I use Response.Conten tType = "applicatio n/vnd.ms-excel" to output to
Excel.

The full SQL query is in a hidden field of the form that is being
posted to the page that outputs to Excel.

<gasp> Never put SQL where it is visible to users! Oh! You think that
because the field is "hidden" that hackers won't be able to see it? Load
your page in a browser and View Source to disabuse yourself of that notion.
Once you give a hacker some knowledge of your database structure, as well
as the knowledge that all he has to do is post some sql to your asp page to
have it run, your server is "owned"! Using your current code, think of the
consequesnces if a hacker loads this url:

yourpage.asp?sq l=truncate%20so me_important_ta ble

Best Security Practice:
Pass values via form fields, never executable statements! Either use the
values passed via the form fields to construct sql statements (not
recommended), or better yet, pass the values as parameters to stored
procedures (http://tinyurl.com/jyy0) or strings containing parameter markers
(http://groups-beta.google.com/group/...er.asp.db/msg/
72e36562fee7804 e).
The receiving ASP page uses a custom datagrid control to create the
datatable to export:
Datagrid? Is this classic ASP or ASP.Net?
Function wsShowGrid()
Dim l_oDataGrid, l_sSql, l_sPattern, l_oRegExp, l_aMatch, l_sTable
l_sSql = Request("hidden GridSql")
http://www.aspfaq.com/show.asp?id=2111

As you can probably see the SQL select query should be passed through
Request("hidden GridSql"), which is successful in all cases except for
this one user.

Are all the other form values passed? You should verify this.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 22 '05 #4

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

Similar topics

1
5036
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table. Before I iterate through the recordset I instruct the browser that the content type is Excel using the following line: (Response.ContentType = "application/vnd.ms-excel") This works fine with Excel 2003 but with older versions (I tested Excel...
5
3792
by: Maria L. | last post by:
Hi, I need to export the content of a DataGrid (in Windows application in C#), into an Excel spreadsheet. Anyone knows how to do this? Any code snippets would help! thanks a lot, Maria
2
3998
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; this.EnableViewState = false;
6
4067
by: Elena | last post by:
I'm trying to export data to an Excel worksheet. I can export the data in the cell values perfectly. I need the code to change a header and footer for the worksheet, not for the columns. Is this possible? If so, I really need the code immediately. Thank you, Elena
13
13241
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel" HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=ABC.xls") HttpContext.Current.Response.Write(strHTML) HttpContext.Current.Response.End() However when the user tries to save it the Default File Type is Web Page(*.htm; *.html)
5
31924
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
1
9778
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm having I'd be most appreciative. The database is already constructed, I'm just wanting to export the data to an excel file. In short, I'm hoping to export two Tables (or queries...not sure which to use - they both seem to have the same data) in...
1
10506
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am trying to export to Excel using a command in an Access Form. RowID strFY AccountID CostElementWBS 1 2008 1 7 2 2008 1 7 I want to...
2
6415
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.