Solved

writing cfquery resultset to file

Posted on 2004-04-06
13
407 Views
Last Modified: 2013-12-24
Hello CFML Developers..
Iam using cfml for generating reports for my application.
Some of the reports return huge number of records which I cant display on browser for printing.(above 20k).So, I was trying to write the cfquery resultset to a pdf file..for which I could not find any tool to do so.
Now..Iam thinking if I could send the cfquery resultset to a html file.
so that I could conver to pdf format later..
Could someone please help me in doing this..
thanks in advance..

0
Comment
Question by:sridhar_don
  • 3
  • 3
  • 2
  • +3
13 Comments
 
LVL 17

Expert Comment

by:Tacobell777
ID: 10771895
If your using MS SQL use DTS to export the result to an Excel file or CSV file.

If you want to write the query result to a file you would want to use wddx and convert it to a WDDX package, or you could create an XML file out of it and transform it with XSL.

Do these reports need to be run by the user or just you the developer? if just you, why not run the query in Query Analyzer and from there save the result to a CSV file?

0
 
LVL 17

Accepted Solution

by:
anandkp earned 20 total points
ID: 10772513
u cld use

1. HTML2PDF [http://www.downseek.com/download/24150.asp]
2. CFX_PDF   [http://devscripts.com/viewscript.php?sId=2399]

hth

K'Rgds
Anand
0
 

Author Comment

by:sridhar_don
ID: 10772616
Thanks bell,
the database Iam using is Oracle9i and reports are run by user,
Could u be more clear...plz.


Thanks Mr.Anand but..
The URL for  HTML2PDF is not found
The URL for CFX_PDF says "Script not found go back"
Please help me in this regard..
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10773009
well thats weird ... i had confirmed the links ...

do one thing -

search for the keywords [HTML2PDF + Download] & [CFX_PDF + Download] in google from ur place ... it shld give u the links to download.

let me know ...
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10774478
The links are puting a ] at the end just copy the shortcut into a new window and delete the ] :)
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 35

Expert Comment

by:mrichmon
ID: 10775950
A good idea when posting links is to put a space before and after the link so it is separated from other characters...
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 10778699
if you are still wanting to "write to html"


you can do something like this


template.cfm
<cfinclude template="../qry/qry_MyQuery.cfm">
<CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="Yes">
<cfoutput query="MyQuery">
#MyQuery.Value1#<br>
#MyQuery.value2#<br>
#MyQuery.value3#<br>
<!--- and what ever else html formatting you want --->
</cfoutput>
</CFPROCESSINGDIRECTIVE>

PageGen.cfm

<cfhttp url="http://10.10.10.180/PageGen/template/template.cfm" method="GET" path="C:\Pages\" file="MyReport.html">

<cfdirectory action="LIST" directory="C:\Pages\" name="MynewFiles" filter="*.html">       
<cfoutput query="myNewfiles">
<div align="center"><font size="+1">Processed File:<strong> #mynewfiles.name#....</strong></font></font></div>
</cfoutput>







0
 

Author Comment

by:sridhar_don
ID: 10790803
thanks everyone for the response..
I found a tool called cfx_pdf which does the job for me.
But Iam facing problem with placing headers,footers and page breaks for each printed page.It seems there is no direct tag available in the API given.
Could anybody who have used cfx_pdf  help me in this regard.
Thanks in advance.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10793463
Here is a link to the user guide for CFX_PDF.

Maybe it will help : http://www.easel2.com/CFXPDFUserGuide.pdf
0
 

Author Comment

by:sridhar_don
ID: 10795522
hello rich,
yah..I referred it already.. It seems currently they dont provide any headers/footers and pagebreaks.
Could u suggest any alternatives to do that..
thanks in advance.
regards
sridhar
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 20 total points
ID: 10802053
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now