Skip to main content

Posts

Showing posts from May, 2009

How to get output in a file or browser using cfdump in coldfusion

cfdump - get output in a file or browser cfdumpOutput.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdump tag: how to get output in a file or browser</title> </head> <body> <h2 style="color:OrangeRed; font-style:italic">cfdump tag example: how to get output in a file or browser</h2> <hr width="575" align="left" color="CadetBlue" /> <br /> <cfquery name="qCenters" datasource="cfdocexamples" maxrows="3"> Select Center_ID, Name From Centers </cfquery> <cfdump var="#qCenters#" label="Centers [file output]" output="c:\Centers.txt"> <br /><br /> <cfdump var="#qCenters#" label="Centers [browser output]" output="browser"...

How to use cfdump format (html, text) in ColdFusion

Introduction In Adobe ColdFusion, the <cfdump> tag is a handy tool that developers often use to debug their code by displaying the contents of variables. This tag can present data in different formats, making it easier to visualize and understand complex structures like arrays, queries, and objects. One of the key attributes of the <cfdump> tag is the format attribute, which allows developers to choose between HTML and plain text output for displaying the variable data. This tutorial demonstrates how to use the format attribute in the <cfdump> tag with a simple example involving a ColdFusion structure. The example shows how to switch between HTML and text formats for dumping variable content, which can be particularly useful in different development environments or when rendering output in specific formats for different devices. Understanding the Structure In the provided example, a structure called Color is created using ColdFusion's StructNew() function. ...

How to display bookmark in a PDF document in ColdFusion

CFdocument - Show bookmark in PDF document cfdocumentBookmark.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdocument tag: how to use and show bookmark in pdf document in coldfusion</title> </head> <body> <cfquery name="qCenters" datasource="cfdocexamples" maxrows="11"> SELECT Center_ID, Name, City FROM CENTERS </cfquery> <cfquery name="qParks" datasource="cfdocexamples" maxrows="11"> SELECT ParkName, City FROM Parks </cfquery> <cfdocument format="pdf" bookmark="true"> <cfoutput> <cfdocumentitem type="header"> Current Page Number: #cfdocument.currentpagenumber# </cfdocumentitem> <cfdocumentsection name="Center Detai...

How to show footer in a printable PDF document in ColdFusion

CFdocument - Show footer in printable document cfdocumentFooter.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdocument tag: how to show footer in printable document as cfdocumentitem type footer</title> </head> <body> <cfquery name="qCenters" datasource="cfdocexamples" maxrows="11"> SELECT Center_ID, Name, City FROM CENTERS </cfquery> <cfdocument format="pdf"> <cfoutput> <cfdocumentitem type="footer"> Page Footer <br />Current Page Number: #cfdocument.currentpagenumber# </cfdocumentitem> <cfdocumentsection> <h4 style="color:DarkCyan; font-style:italic"> cfdocument example: display document footer </h4> ...

How to display web pages in a printable PDF document in ColdFusion

cfdocument and cfhttp - display web pages in printable document cfdocumentDispalyWebPages.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdocument and cfhttp tag: how to display web pages in printable document</title> </head> <body> <cfhttp url="http://www.gmail.com/" resolveurl="yes"> <cfdocument format="pdf"> <cfoutput> #cfhttp.FileContent# </cfoutput> </cfdocument> </body> </html> More ColdFusion examples cflayout - collapsible layout area in a border type layout cflayout - splitter in a border type layout cfchart - 3d chart cfdocument - create printable pdf format document

How to create a PDF document in ColdFusion

cfdocument - create printable pdf format document cfdocumentPDF.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdocument tag: how to create printable pdf format document in coldfusion</title> </head> <body> <cfquery name="qCourses" datasource="cfdocexamples" maxrows="10"> SELECT Course_ID, Number, Descript from COURSES </cfquery> <cfdocument format="pdf"> <h3 style="color:OrangeRed; font-style:italic"> cfdocument example: Printable pdf document </h3> <cftable query="qCourses" colheaders="yes" htmltable="no" border="no"> <cfcol header="Course ID" text="#Course_ID#" align="left"> <cfcol header="Number" ...

How to add page break in a PDF document in ColdFusion

Introduction In web development, generating dynamic PDF documents can be a common requirement, especially for creating reports, invoices, or printable pages directly from a web application. Adobe ColdFusion provides a powerful way to generate PDFs with the <cfdocument> tag, which makes it easy to convert HTML content into a PDF format. One of the key features often required in PDF creation is the ability to control page breaks, ensuring that content is properly structured and separated into different pages. This tutorial demonstrates how to implement page breaks using ColdFusion’s <cfdocumentitem> tag within a PDF document. In this example, we retrieve data from a database and display it in a PDF document with a page break separating different sections of the content. Understanding how to use the <cfdocumentitem> tag for page breaks is crucial for developers looking to control the layout of their ColdFusion-generated PDF documents. Database Query and Data Retrieval...

How to change Chart series color in ColdFusion

cfchart - chart series color cfchartSeriescolor.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to set change chart series color (seriescolor)</title> </head> <body> <h2 style="color:PaleVioletRed; font-style:italic">cfchart example: how to change chart series color</h2> <hr width="675" align="left" color="PaleVioletRed" /> <br /> <cfchart format="jpg" xaxistitle="Employee" chartheight="375" yaxistitle="Monthly Salary" databackgroundcolor="FF4500" chartwidth="675" fontbold="yes" fontsize="13" backgroundcolor="BC8F8F" foregroundcolor="FFF5EE" showxgridlines="yes" gr...

How to create a Chart in ColdFusion

Introduction ColdFusion, an Adobe-owned scripting language, offers a wide range of powerful features, including the ability to create dynamic charts and graphs. This tutorial focuses on one such feature—the <cfchart> and <cfchartseries> tags—which allow developers to easily generate graphical representations of data retrieved from a database. Understanding how to use these tags can help enhance the visual presentation of data in web applications, making complex information easier to interpret. This article explains how to use ColdFusion to create a bar chart that displays employee salaries. The chart pulls data from a database query and renders it as a dynamic image, which is displayed directly on a web page. In the following sections, we’ll break down each part of the code and explain its role in generating the chart. Setting Up the Data Query Before creating the chart, the data needs to be pulled from a data source. The <cfquery> tag is used here to retrieve empl...

Pie Chart pie slice style in ColdFusion

cfchart - pieslicestyle property in pie chart cfchartpieSliceStyle.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use pieslicestyle property in pie chart in coldfusion</title> </head> <body> <h2 style="color:DarkSeaGreen; font-style:italic">cfchart example: how to use pieslicestyle property in pie chart</h2> <hr width="700" align="left" color="DarkSeaGreen" /> <br /> <cfquery name="qEmployee" datasource="cfdocexamples" maxrows="4"> SELECT FirstName, LastName, Salary FROM EMPLOYEE </cfquery> <cfchart format="png" xaxistitle="First Name" yaxistitle="Salary" chartheight="400" chartwidth="700" showlegend...

How to set Pie chart color list in ColdFusion

cfchart - colorlist in pie chart cfchartPie.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use colorlist in pie chart in coldfusion</title> </head> <body> <h2 style="color:DarkOliveGreen; font-style:italic">cfchart example: how to use colorlist in pie chart</h2> <hr width="700" align="left" color="LightPink" /> <br /> <cfquery name="qEmployee" datasource="cfdocexamples" maxrows="5"> SELECT FirstName, LastName, Salary FROM EMPLOYEE </cfquery> <cfchart format="png" xaxistitle="First Name" yaxistitle="Salary" chartheight="400" chartwidth="700" showlegend="yes" fontbold="yes" ...

CFchart - Chart series paint style in ColdFusion

cfchart - paintstyle property in cfchartseries cfchartpaintstyle.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use paintstyle property in cfchartseries in coldfusion</title> </head> <body> <h2 style="color:Tan; font-style:italic">cfchart example: how to use paintstyle property in cfchartseries</h2> <hr width="700" align="left" color="Tan" /> <br /> <cfquery name="qEmployee" datasource="cfdocexamples" maxrows="4"> SELECT FirstName, LastName, Salary FROM EMPLOYEE </cfquery> <cfchart format="png" xaxistitle="First Name" yaxistitle="Salary" chartheight="400" chartwidth="700" showlegend="no" ...

How to display legend on a Chart in ColdFusion

cfchart - legend in chart cfchartLegend.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use legend in chart in coldfusion</title> </head> <body> <h2 style="color:DarkOliveGreen; font-style:italic">cfchart example: how to use legend</h2> <hr width="700" align="left" color="LightPink" /> <br /> <cfquery name="qEmployee" datasource="cfdocexamples" maxrows="10"> SELECT FirstName, LastName, Salary FROM EMPLOYEE </cfquery> <cfchart format="png" xaxistitle="First Name" yaxistitle="Salary" chartheight="400" chartwidth="700" showlegend="yes" backgroundcolor="2F4F4F" foregroundcolor=...

Chart label format (currency, date, number, percent) in ColdFusion

cfchart - label format (currency, date, number, percent) in chart cfchartLabelFormat.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use label format (currency, date, number, percent) in chart</title> </head> <body> <h2 style="color:RosyBrown; font-style:italic">cfchart example: how to use label format in chart</h2> <hr width="700" align="left" color="RosyBrown" /> <br /> <cfchart format="png" xaxistitle="First Name" yaxistitle="Salary" chartheight="400" chartwidth="700" foregroundcolor="FFFAFA" backgroundcolor="BC8F8F" fontbold="yes" show3d="yes" databackgroundcolor="DDA0DD" ...

How to create a 3D Chart in ColdFusion

cfchart - 3d chart cfchart3D.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfchart tag: how to use 3d chart in coldfusion</title> </head> <body> <h2 style="color:Crimson; font-style:italic">cfchart example: how to use 3d chart</h2> <hr width="700" align="left" color="LightPink" /> <br /> <cfquery name="qEmployee" datasource="cfdocexamples" maxrows="10"> SELECT FirstName, LastName, Salary FROM EMPLOYEE </cfquery> <cfchart format="png" xaxistitle="First Name" chartheight="400" chartwidth="700" yaxistitle="Salary" showlegend="no" backgroundcolor="E9967A" labelformat="currency" fo...

How to use splitter in a border type layout in ColdFusion

Introduction In ColdFusion, the <cflayout> tag provides a way to create dynamic, interactive, and responsive layouts for web applications. One useful feature in this context is the splitter , which allows users to resize different layout sections, improving usability and giving more control over how information is displayed on the screen. This tutorial explains how to implement a border-type layout in ColdFusion with splitters in each area using the <cflayout> and <cflayoutarea> tags. We'll examine how each section of the code contributes to building a flexible, resizable interface suitable for many types of applications. The example code provided shows how to create a border-type layout with resizable panels on each side. By the end of this breakdown, you’ll understand how to apply this layout and enhance user interactions by enabling splitters in different areas of the interface. Setting Up the Border Layout The <cflayout> tag is used here to create th...

How to create collapsible layout area in a border layout in ColdFusion

cflayout - collapsible layout area in a border layout cflayoutCollapsible.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cflayout tag: how to create collapsible layout area in a border type layout</title> </head> <body> <h2 style="color:SaddleBrown; font-style:italic">cflayout example: collapsible layoutarea</h2> <hr width="550" align="left" color="LightPink" /> <br /> <cflayout name="BorderLayout" type="border" style="height:450px; width:575px; text-align:center"> <cflayoutarea name="TopBar" position="top"> Top </cflayoutarea> <cflayoutarea name="LeftBar" position="left" closable="true" style="width:75px" collapsible=...

How to create a border type layout in ColdFusion

Introduction In Adobe ColdFusion, building dynamic web applications involves various tools that allow developers to create intuitive and user-friendly layouts. One such tool is the <cflayout> tag, which offers a way to structure content in different predefined layouts. Among these is the "border" layout, which organizes the page into distinct regions, commonly used in dashboard interfaces or web applications that require a consistent and well-organized structure. This article focuses on creating a border-type layout using ColdFusion’s <cflayout> tag, explaining how to define different regions like the top, left, center, and right sections within a flexible and responsive web page. A border layout allows developers to divide the webpage into multiple sections, each with a specific purpose, while ensuring a clean and structured presentation. This layout is useful for applications where navigation, main content, and auxiliary content need to be organized into diffe...

How to use ColdFusion.Layout.createTab Ajax JavaScript Function

Ajax JavaScript Function - ColdFusion.Layout.createTab ColdFusionLayoutcreateTab.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ajax JavaScript Function: how to use ColdFusion.Layout.createTab in coldfusion</title> </head> <body> <h2 style="color:DeepPink; font-style:italic">cfwindow tag example: ColdFusion.Layout.createTab</h2> <hr width="575" align="left" color="LightPink" /> <br /> <a href="JavaScript:ColdFusion.Layout.createTab('ImageLayout','Tab2','Tree Image','TabSource.cfm')"> <b>Create New Tab</b> </a> <br /><br /> <cflayout name="ImageLayout" type="tab" style="width:550px"> <cflayoutarea name="ButterflyTab...

How to create a Window with custom header style in ColdFusion

Introduction In Adobe ColdFusion, creating a window with a customized header is a powerful way to enhance the visual appeal and user interface of a web application. The <cfwindow> tag in ColdFusion makes it easy to display a popup window on a web page without needing extensive JavaScript or external libraries. In this example, we’ll walk through how to apply a unique style to the header of a ColdFusion window using the headerstyle attribute of the <cfwindow> tag. This attribute allows developers to modify font size, color, background color, and other CSS properties of the window header. This guide will break down each part of the example code to help you understand the purpose and usage of each attribute in the <cfwindow> tag. We’ll cover configuring the window’s size, position, and appearance, as well as how to display an image within it. By the end of this guide, you’ll know how to implement your own custom-styled ColdFusion window. Setting Up the Window Structu...

How to create a Window with custom body style in ColdFusion

Introduction In ColdFusion, the <cfwindow> tag is an effective tool for creating visually appealing, interactive windows in web applications. It allows developers to easily add custom modals or popup windows with various attributes like position, size, and style, making it possible to create dynamic user experiences. In this tutorial, we’ll explore how to create a window with a custom body style using the ColdFusion <cfwindow> tag, highlighting key features such as custom background colors, font styles, and other window properties that enhance the overall aesthetic and functionality of the application. This guide is aimed at ColdFusion developers who want to add more flexibility to their user interfaces. We’ll break down how each attribute in the <cfwindow> tag works and how it contributes to customizing the window's appearance and behavior. Understanding the <cfwindow> Tag The <cfwindow> tag in ColdFusion is a powerful tool for creating interacti...

How to create a Window programmatically with custom settings in ColdFusion

Ajax JavaScript Function - create window programmatically with custom settings ColdFusionWindowcreateCustom.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ajax JavaScript Function: how to create window programmatically with custom settings</title> </head> <body> <h2 style="color:Crimson; font-style:italic">Ajax JavaScript Function example: ColdFusion.Window.create</h2> <hr width="600" align="left" color="CadetBlue" /> <br /> <cfajaximport tags="cfwindow"> <a href="JavaScript:ColdFusion.Window.create('ButterflyWindow','Butterfly Image','Butterfly.cfm',{height:375, width:450,x:25,y:150,draggable:false,closable:false})"> <b>Show Butterfly Image Window</b> </a> </b...

How to use ColdFusion.Window.onHide Ajax JavaScript Function

Ajax JavaScript Function - ColdFusion.Window.onHide ColdFusionWindowonHide.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script language="javascript"> function onhide(windowName) { alert(windowName + " window now hide!"); } function linkClick() { ColdFusion.Window.onHide("ButterflyImageWindow", onhide); ColdFusion.Window.hide("ButterflyImageWindow"); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ajax JavaScript Function: how to use ColdFusion.Window.onHide in coldfusion</title> </head> <body> <h2 style="color:DeepPink; font-style:italic">Ajax JavaScript Function example: ColdFusion.Window.onHide</h2> <hr width="600" align="left" color="Beige" /> <br /> <a href="JavaScript:linkClick()"> <b...