I have a table on a VF page that allows the users to filter, sort and choose which columns are visible. I accomplish the column visibility by using javascript to change the style to display:none. However, I need to allow the user to render this page as a pdf, meaning no more javascript. The headers are no problem, I just use an apex:repeat to iterate through a list of headers. For the data, I tried setting a boolean for each column and using an if to print tags with content. This didn't work, as it didn't like extraneous code outside of a tag. Instead, now I'm trying to nest 2 apex repeats, one through my roster of data, the other through the header.
If I do this (to test functionality):
<apex:repeat value={!rosters} var="r">
<tr>
<apex:repeat value="{!showFields}" var="s">
<td>{!r.First_Name__c)}</td>
</apex:repeat>
</tr>
...then every cell is filled with the last name. However, if I replace the cell declaration to this:
<td>{!IF(s=="FirstName",r.First_Name__c,s)}</td>
...it just prints a blank cell. It's not the test, as if I change it to s="fName" (false), it displays 'FirstName' in the cell, as it should. I feel like this is just some simple syntax issue, as I'm new to Salesforce. Any ideas?