• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Query after report Print

New Here ,
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

I have set up a .cfr report, that open in a blank pdf window. It is possible to set it so that once it is printed an insert query would run??
TOPICS
Advanced techniques

Views

454

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

It would be very difficult considering that printing usually happens on the client and <cfquery> happens on the server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

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.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 18, 2007 Jul 18, 2007

Copy link to clipboard

Copied

rjproc wrote:
> 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.
>
> Thanks

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

I have tried to run the query like this.
<cfquery name="QUnprintedPIs" datasource="FleetmaxTitles">
SELECT
FROM
WHERE
</cfquery>

<cfloop query="">
<cfquery name="UpdateInfo" datasource="">
INSERT INTO
VALUES(,,)
</cfquery>
</cfloop>

<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.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 20, 2007 Jul 20, 2007

Copy link to clipboard

Copied

LATEST
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
from SomeSmallTable
<cfif currentrow lt recordcount>
union
</cfif>
</cfloop>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation