This content has been marked as final. Show 5 replies
It would be very difficult considering that printing usually happens on the client and <cfquery> happens on the server.
I wasn't sure if it was at all possible knowing that the print is a client activity, so where would I put the <cfquery> to have it run after the report is viewed.
> I wasn't sure if it was at all possible knowing that the print is a client activity, so where would I put the <cfquery> to have it run after the report is viewed.
I see you have two choices. If user approval is irrelevant, run the
update after the report is generated, viewed or not. If user approval
is required, have a form control they activate to send a request to the
server to do the update.
I have tried to run the query like this.
<cfquery name="QUnprintedPIs" datasource="FleetmaxTitles">
<cfquery name="UpdateInfo" datasource="">
<cfreport format="PDF" template=".cfr"></cfreport>
This is how it is set up now, the insert is working fine, but since the report is running after the query, it outputs null.
If I put the report before the query, it runs the reportbut wont run the query.
this does not answer your question but it makes your insert more efficient.
instead having your query inside a loop, it is usually more efficient to put your loop inside your query. Something like this
insert into SomeTable
(field1, field2, etc)
<cfloop query = "something">
select distinct #value1#, #value2#, etc
<cfif currentrow lt recordcount>