Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Execute SQL from crystal report when printing Post Reply Post New Topic
Author Message
jadi
Newbie
Newbie
Avatar

Joined: 02 Apr 2009
Location: United States
Online Status: Offline
Posts: 1
Quote jadi Replybullet Topic: Execute SQL from crystal report when printing
     Posted: 02 Apr 2009 at 1:45pm
Hello all. Please help me.

I have a crystal report.
I want to execute an Update query when the reports are printed.
In one of the tables that are a source for the report, i have field called "print_flag".
When anyone prints a document then i want to change that flag from "N" to "y".
Please help with this!!

From searching on web i found that there is a
"whileprintingrecords" function that we can use. But I dont know how to use an SQL stmt with it
I put the sql stmt in double inverted commas after the function but it did not work.

Please help..
Thank you for your help in Advance!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Apr 2009 at 6:36am
Crystal is basically a reader of data, not a writer.  There is no facility in Crystal that I am aware of that will allow you to update the database...that is what applications are for.  Crystal just tells you what is in the database.
 
WhilePrintingRecords is a directive to Crystal to do something at certain time, as it makes multiple passes through the data before the final report is displayed...this is after collecting data and while it is formatting the records for printing (display)
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum