Skip to main content
Inspiring
August 26, 2014
Answered

Report Type for pdf and Excel

  • August 26, 2014
  • 1 reply
  • 509 views

I have following code to generate the report for pdf format.

I would like to let users to choose report type 'pdf' or 'excel'

I need pass the user select from user interface to <cfreport format= "PDF" or "Excel".

Can you please advise how I can pass the user select Report Type from lsReportType to my cfReport?

Your help and information is great appreciated,

Regards,

Iccsi

<cfstoredproc procedure="spGetReportType">

   <cfprocresult name="rsReportType" resultset="1">

</cfstoredproc>

<cfreport format = "PDF" template= "MyReport.cfr" query="#myQuery#">

   </cfreport>

<td><select width="50" name="lstReportType" id="lstReportType">

      <cfoutput query="rsReportType">

         <option value="#rsReportType.ReportTypeID#" <cfif (isDefined("form.ReportTypeID") AND form.ReportTypeID EQ rsReportType.ReportTypeID)>selected="selected"</cfif>>#rsReportType.ReportType#</option>

       </cfoutput>

     </select></td>

This topic has been closed for replies.
Correct answer EddieLotter

Change format="PDF" to format="#VariableName#" where VariableName contains the text "PDF" or "Excel".

1 reply

EddieLotter
EddieLotterCorrect answer
Inspiring
September 2, 2014

Change format="PDF" to format="#VariableName#" where VariableName contains the text "PDF" or "Excel".