1

I would like to show multiple tabs, i.e. multiple sheets, from an xls file in the browser using Coldfusion. I have the logic pretty worked out, but I'm not sure if there is a way to do it. My logic would be as follows:

<cfspreadsheet
action="read"
format="html"
src="test.xls"
name="Spreadsheet"
<cfloop index="i" from="1" to="5"> <!--- or however many tabs there are --->
sheet="#i#"
</cfloop>
>
<table>
<cfoutput>
#Spreadsheet#
</cfoutput>
</table>

Now I know this code doesn't work, so I was looking for a similar solution. Thank you all in advance.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
m4ttr33d
  • 13
  • 2

1 Answers1

2

Try putting cfloop around cfspreadsheet

<cfloop from="1" to="5" index="i">
<cfspreadsheet  
    action="read" 
    format="html"
    src="test.xlsx"
    sheet="#i#"
    name="spreadsheet">
<cfdump var="#spreadsheet#"><br>
</cfloop>
Deepak Yadav
  • 1,724
  • 3
  • 23
  • 38