Excel Export

by lokointhehouse2

HTML

<cfmodule template="/library/common/xmlExcel.cfm"
        filename="StatusGlance"
        sheets="2"
        query1="#variables.getStatusGlance#"
        sheetname1="Strike"
        collist1="medium_type_desc,region_name,market_name,company_dealer_code,company_dba,medium_desc,medium_pub_date,letter_occurance_strike,letter_occurance_date,infraction_list,reset_date"
        colwidths1="70,70,100,70,250,250,70,70,70,250,70"
        headerlist1="#pageValue.mediumTypeLabel#,#pageValue.regionLabel#,#pageValue.marketLabel#,#pageValue.dealerCodeLabel#,#pageValue.dealerNameLabel#,#pageValue.publicationLabel#,#pageValue.adDateLabel#,#pageValue.noticesLabel#,#pageValue.letterDateLabel#,#pageValue.InfractionCodeLabel#,#pageValue.resetLabel#"
        stringFlds1="medium_type_desc,region_name,market_name,company_dealer_code,company_dba,medium_desc,infraction_list"
        dateFlds1="medium_pub_date,letter_occurance_date,reset_date"
        numFlds1="letter_occurance_strike"

        query2="#variables.getStatusGlanceMinor#"
        sheetname2="Minor"
        collist2="medium_type_desc,region_name,market_name,company_dealer_code,company_dba,medium_desc,medium_pub_date,letter_occurance_strike,letter_occurance_date,infraction_list,reset_date"
        colwidths2="70,70,100,70,250,250,70,70,70,250,70"
        headerlist2="#pageValue.mediumTypeLabel#,#pageValue.regionLabel#,#pageValue.marketLabel#,#pageValue.dealerCodeLabel#,#pageValue.dealerNameLabel#,#pageValue.publicationLabel#,#pageValue.adDateLabel#,#pageValue.noticesLabel#,#pageValue.letterDateLabel#,#pageValue.InfractionCodeLabel#,#pageValue.resetLabel#"
        stringFlds2="medium_type_desc,region_name,market_name,company_dealer_code,company_dba,medium_desc,infraction_list"
        dateFlds2="medium_pub_date,letter_occurance_date,reset_date"
        numFlds2="letter_occurance_strike"
        debug="no" />

JavaScript

<cfparam name="attributes.debug" default="false">
<cfparam name="attributes.executeAbort" default="true">
<cfparam name="attributes.title" default="">
<cfparam name="attributes.filters" default="">
<cfparam name="attributes.gridlines" default="false">

<cfif attributes.debug EQ "false">
	<cfsetting showdebugoutput="no">
<cfelse>
	<cfsetting showdebugoutput="yes">
</cfif>

<!--- Usage & Definitions ---
**************************************
Usage
**************************************

Example:	<cf_excel_xml 
				filename="testing"
				sheets="2" 

				query1="#test1#" 
				collist1="userid,login,browser,logincount" 
				colwidths1="50,100,150,50" 
				headerlist1="Userid,Last Login,Browser,Login Count" 

				query2="#test2#" 
				stringflds2="emplid"
				dateflds2="login">
	
	The only required field is query1 which is a query result. Note that it is passed as the name of the query inside the # signs.
	
	The following are the attributes that apply to the entire entire workbook.
	
	filename		The name of the Excel file you want to generate. It is used in the CFHEADER tag. Default is "export".
	author			The name of the person creating the file. Default is "CF_Excel_XML".
	sheets			The number of spreadsheets. Default is 1.
	headerbgcolor	The background color of the header row. Default is "#C0C0C0", a light grey.
	headerboldtext	Yes/No. Determines whether the header text is in bold text or not. Default is "Yes".
	row1bgcolor		The background color of the odd rows in the query results. Default is "#FFFFFF", white.
	row2bgcolor		The background color of the even rows in the query results. Default is "#FFFFCC", a light yellow.
	debug			Yes/No. Setting to Yes turns off the Excel conversion so you can view the output and any errors you are getting. Default is "No".

	The following are the attributes that apply to a particular spreadsheet. As in the example above, for each spreadsheet you
	increment the attributes's numeric suffix by one. 

	query1			The query to display. it...