We help IT Professionals succeed at work.
Get Started

Export Query to Flat File/ASCII

sukimaster
sukimaster asked
on
330 Views
Last Modified: 2013-12-24
Hello,

I'm wanting to export the same result page to a flat file with out recreating the query to accomodate to ASCII formating.

First, some history on what I am doing:

I have a report that has an option to allow the individual to export the results to a flat file. What happens on the back end is that the same query is run BUT if the is_download is 1 executes the following two lines:

<cfheader name="content-disposition" value="Inline; filename=AddressLabels.txt">
<cfcontent type="application/unknown" reset="Yes">

I use the 'application/unknown' so that it brings up the 'save as' option instead of displaying the results on the page. Everything works fine.


Here is my dilemma:
I have now been given the task to repeat the process accross ALL our reports (over 50). This can take a long time in that I will now need to create an entire sepatate query in order to get the output to diplay in straight ASCII text. I'm wondering if there is an easier way to accomplish this rather than having me create a whole new query/format layout if the is_download option is selected.

Ideally, if I could just have the above two lines selected and then output the format with all backend html/cf logic code stripped/removed that would accomplish my task.

Otherwise, I'll be quite busy for the next few weeks tweaking this <cfoutput> to work !

If anyone could provide any examples, assistance or any other reference points that would help me I'd GREATLY appreciate it!!

TIA.
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE