[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

coldfusion error

Posted on 2009-02-23
8
Medium Priority
?
192 Views
Last Modified: 2013-12-16
Hi, I have a program that shows a table with a list of customers and what money they owe and how long from the current date that they owe it. If you want a closer look at a single customer you can click the customer name which is a href and a new window opens giving a closer look at this customer. The current date is passed through the url and is defined as <cfset #todaydate# = todaydate.url>. This works fine until I included a cfform with a submit button which is supposed to export the info to excel. I get an todaydate not defined in url, which it isnt, but how else can I do this?
0
Comment
Question by:xrayroom
  • 5
  • 3
8 Comments
 
LVL 5

Expert Comment

by:nathans
ID: 23710686
In the page where the CFForm is add the cfinput line below.
<cfform>
<cfinput name="todaydate" type"hidden" value="url.todaydate">
</cfform>

Now in the file that is creating the export add the lines below.
<cfif isdefined('url.todaydate')>
   <cfset todaydate = url.todaydate>.
<cfelseif isdefined('form.todaydate')>
   <cfset todaydate = form.todaydate>.
</cfif>

Hope this helps and makes sense to you.
0
 

Author Comment

by:xrayroom
ID: 23711234
Hi, can you check the file, still getting same error, there is a form that posts to another script then when the link is clicked the attached script is called. Perhaps I didnt give a full enough over view before.

Thanks
debtors.txt
0
 
LVL 5

Accepted Solution

by:
nathans earned 1000 total points
ID: 23711490
There are many solutions but....  if you use the code below by adding the todate=#to_date# to the action that should fix it.

<cfform action="aged_debtors_b_1.cfm&todate=#To_Date#" method="POST" enablecab="Yes" target="_blank">
   <cfif form.excel is "on">
      <tr><td><img src="../style/000080_dot.jpg" border="0" alt="" width="102%" height="2"></td></tr>
   <cfelse>
       <P CLASS="Text">Export To Excel
       <cfinput type="Checkbox" name="excel">
       <input type="submit" value="Submit">
   </cfif>
</cfform>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:xrayroom
ID: 23712459
Hi, before I was getting coldfusion error pages, now im just getting page cant be displayed. It seems to be taking the date ok but not opening excel. any other ideas?

Thanks
0
 

Author Comment

by:xrayroom
ID: 23712588
now i seem to get cust not defined in url  too
0
 
LVL 5

Expert Comment

by:nathans
ID: 23712852
I see... one what is your goal to get a pdf of the current page you are on of a pdf of the customer's page?  because if you want the customer page you need to click on that link if not then you need to link to a different page that does the current code as a pdf.  I wish I was there.
0
 

Author Comment

by:xrayroom
ID: 23712887
it is to get an excel file of the current page. I have similar code in the page that posts to this one and it works fine
0
 

Author Closing Comment

by:xrayroom
ID: 31550054
ah, got it, just needed this cust=#get_sales.customer# as well, I didnt send you enough information for this...Thanks for the help!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question