I need to create a report using input parameters and a date
range. I am calling the report from a form that is using the
following query and gets its input from a previous form:
<cfquery name="getVisitors" datasource="zipcodesearch">
SELECT company.CompanyID, company.CompanyName, company.phone1, visitors.visitorName, visitors.visitorComp, visitors.createDate, visitors.phone, visitors.email
FROM company INNER JOIN visitors ON company.CompanyID = visitors.companyID
WHERE visitors.createDate>=#form.startdate# And visitors.createDate<=#form.enddate#
ORDER BY company.CompanyName, company.phone1, visitors.createDate
</cfquery>
At this point, I am just not sure if I should use cfreportparam tags or not. The reason is, I am not using an = operator. I need to specify a date range and I can't find an example ANYWHERE on how to accomplish that with the Report Builder. If I do use the cf report param tags, would they look something like this?:
<cfreport format="PDF" template="visitors.cfr" query="#getVisitors#" overwrite="yes">
<cfreportparam NAME="startdate" VALUE="#form.startdate#">
<cfreportparam NAME="enddate" VALUE="#form.enddate#">
</cfreport>
I guess my next question is, do I then need to specify a query within the report builder and also use input parameters within the report builder environment? the documentation on this type of scenario has been virtually non-existent.
I'm really stuck on this one and any help would be appreciated...
<cfquery name="getVisitors" datasource="zipcodesearch">
SELECT company.CompanyID, company.CompanyName, company.phone1, visitors.visitorName, visitors.visitorComp, visitors.createDate, visitors.phone, visitors.email
FROM company INNER JOIN visitors ON company.CompanyID = visitors.companyID
WHERE visitors.createDate>=#form.startdate# And visitors.createDate<=#form.enddate#
ORDER BY company.CompanyName, company.phone1, visitors.createDate
</cfquery>
At this point, I am just not sure if I should use cfreportparam tags or not. The reason is, I am not using an = operator. I need to specify a date range and I can't find an example ANYWHERE on how to accomplish that with the Report Builder. If I do use the cf report param tags, would they look something like this?:
<cfreport format="PDF" template="visitors.cfr" query="#getVisitors#" overwrite="yes">
<cfreportparam NAME="startdate" VALUE="#form.startdate#">
<cfreportparam NAME="enddate" VALUE="#form.enddate#">
</cfreport>
I guess my next question is, do I then need to specify a query within the report builder and also use input parameters within the report builder environment? the documentation on this type of scenario has been virtually non-existent.
I'm really stuck on this one and any help would be appreciated...