Page:
<apex:page controller="statement" >
<apex:form >
<apex:outputLabel value="From Date"/>
<apex:inputText value="{!fromDate}"/><br/>
<apex:outputLabel value="TO Date"/>
<apex:inputText value="{!toDate}"/><br/> <br/>
<apex:commandButton value="Download" action="{!show}"/>
</apex:form>
</apex:page>
Code:
public class statement {
list<Account> acc;
public PageReference show() {
acc = new list<Account>();
acc= [select id,name,industry from Account where date =:fromdate]
return acc;
}
public String toDate { get; set; }
public String fromDate { get; set; }
}
im struck here while its asking return
show()
as aPageReference
, however youreturn List<Account>
. It's the problem.