Hello,
Trying to export the results of a query into a spreadsheet, which I can do, but not as I like.
Procedure is this:
Form holds 2 date fields - ToDate, FromDate
query_CreateSho wTable.cfm shows the results as a table with all completed records within that date range. On the web page is a button with 'Export to Excel' on it. This exports the results to XLS format using the action query query_ExportToE xcel.cfm
I'm exporting to XLS by running this query, but it doesn't work as the query requires the values of ToDate & FromDate from my form.
How can I pass the values of ToDate & FromDate to the query _ExportToExcel. cfm?
Thanks
Neil
9 2689 acoder 16,027
Recognized Expert Moderator MVP
You can use something like: - exportToExcel.cfm?FromDate=#FromDate#&ToDate=#ToDate#
Hi acoder,
I've tried that, but it doesn't seem to be accepting the value of the ToDate.
Here's the links action: -
<a href="action_CreateExcelReport.cfm?DateFrom=#DateFrom#&DateTo=#DateTo#" title="Export report to Excel .csv format" onMouseOver="window.status='Export report to Excel .csv format';return true;"><img src="assets/excel.png" /></a>
-
and here's the handling script of the action_CreateEx celReport.cfm: -
<cfquery datasource="taskbook" name="JobReport">
-
select ID,
-
CustomerName,
-
Dept,
-
Location,
-
ContactNo,
-
EmailAddress,
-
ChargeCode,
-
RequestDate,
-
TaskTypeFK,
-
TaskDetails,
-
JobStatusFK
-
from tblTaskBooker
-
where ChargeableYN = 1 and JobStatusFK like 'Completed'
-
and ((RequestDate BETWEEN #DateFrom# AND #DateTo#) or (RequestDate Is Null))
-
order by CompletionDate
-
</cfquery>
-
Anything I am doing wrong here?
acoder 16,027
Recognized Expert Moderator MVP
Yes, when passed to the page via the URL, they can be accessed as #url.DateFrom# and #url.DateTo#.
Thanks, I have changed that, but now I`m getting this error:
Parameter 1 of function CreateODBCDate which is now "" must be a date/time value
It's not passing the value for some reason.I've tried outputting it at the top of the page but its empty.
acoder 16,027
Recognized Expert Moderator MVP
What's the value in the URL? Are you seeing "action_CreateE xcelReport.cfm? DateFrom=&DateT o=" in the address bar? If so, you need to check the values before they're passed on the CreateShowTable .cfm page.
Sort of...what I am seeing is this: http://marlin/assetinl/scripts/TaskB...e&DateTo=tdate
I'm creating two variables to hold the dates: -
<cfset fdate = '#form.QuickRpts_DateFrom#'>
-
<cfset tdate = '#form.QuickRpts_DateTo#'>
-
Then passing those variables along the url string: -
<a href="action_CreateExcelReport.cfm?DateFrom=#fdate#&DateTo=#tdate#" title="Export report to Excel .csv format" onMouseOver="window.status='Export report to Excel .csv format';return true;"><img src="assets/excel.png" /></a>
-
and I have outputted the values at the bottom of the page (ie the one with the export to excel button on it) and it is showing the correct date values: -
<cfoutput>
-
#fdate# <br />
-
#tdate#
-
</cfoutput>
-
of
01/09/2010
01/10/2010
so I have no idea where I am going wrong!
Thanks for your help!
Neil
acoder 16,027
Recognized Expert Moderator MVP
Ah right. The URL should of course be in <cfoutput> tags otherwise it'll just be a string #fdate# instead of the actual value of the variable.
Brilliant - got it all to work!
Thanks for all your help.
Cheers
Neil
acoder 16,027
Recognized Expert Moderator MVP Sign in to post your reply or Sign up for a free account.
Similar topics |
by: lawrence |
last post by:
Those of you with backgrounds with the C language will laugh at my
mistake, but those of you, like myself, who deal mostly with PHP
should be warned about passing variables as references - debugging
then requires a whole new mindset. I've a cms written in procedural
style that I've been converting to OOP. It is important to always pass...
|
by: Matthew Robinson |
last post by:
i read a tutorial the other day on passing variables between php pages
using a html form and setting the action to the php page to parse, can
anybody see anything wrong with the code below? the problem is, that the
page always loads the html form, and i cant work out why this is so, even
after i select a catagory from the drop down list and...
|
by: Chieko Kuroda |
last post by:
Hello all,
I would like to learn the syntax for passing variables that I retreived from
a database to a second asp page. Currently, I'm using:
Response.Write "<tr><td> </td><td><Font size= ""-1""><B><a href=
""InterviewerInfo2.asp?timeID=" & rs("Starttime") & " "">"
How do I add more variables to my link: <a href = ...?
ie...
|
by: Consuelo Guenther |
last post by:
Hello,
I am having problems with passing variables between pages. I have the
following:
First asp page has the function:
-----------------------------------------------------------------------
<script language="JavaScript">
function addProcess(addPName,addSProcess,addPIndex)
{
var addProcessWindow =...
|
by: Scott Zabolotzky |
last post by:
I'm trying to pass a custom object back and forth between forms.
This custom object is pulled into the app using an external reference
to an assembly DLL that was given to me by a co-worker. A query-string
flag is used to indicate to the page whether it should instantiate
a new instance of the object or access an existing instance from
the...
| |
by: Khai |
last post by:
First off, yes, I understand the crapload of tutorials out there, (well,
rather, I understand there /are/ a crapload of tutorials out there), the
problem is my comprehension.
I'm trying to pass variables, and can do so just fine with a URL, and $_GET.
What I would like to learn, and be very adept at using is the Form functions
and how you...
|
by: Rotsen |
last post by:
HI people,
I am trying to read a file using "file" and I am passing the following
string
for the input file parameter:
http://maggie.sdcwa.org/eng/list/client_find_project_list.phtml?proj_name=CATHODIC
PROTECTION OF RAMONA PIPELINE PHASE 2&show=1
phpinfo shows:
_GET CATHODIC
|
by: jsdeveloper |
last post by:
Hi,
I just started programming in javascript, and I'm having a problem passing variables between javascript and asp code in .asp page. Can you please help?
I've given the sample code below.
----------------------------------------------------------------------------------
<script src="http://www.aurumtech.com/domain_str.js"
...
|
by: coool |
last post by:
Hi :)
anyone knows how can I send variables from a php page to a form - i need to fill the form with these variables ?
maybe using (the process of passing variables to other pages - through url)
but how can i assign them to form variables ?
|
by: BezerkRogue |
last post by:
This is the most fundamental action I am sure, but I can't seem to make it happen.
I am familiar with passing variables in ASP. But that doesn't seem to be the preferred method in .NET. I have some scripts that run at the server for the form so I can't disable that statement. I followed Microsoft's instructions(I know..not the best thing to...
|
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...
| |
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. ...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |