Execute SQL from crystal report when printing
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Execute SQL from crystal report when printing

  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Unhappy Execute SQL from crystal report when printing

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

  2. #2
    Join Date
    Jul 2005
    Posts
    1,076

    Re: Execute SQL from crystal report when printing

    I have seen a way to do it
    Set a Stored Procedure as Your datasource
    In this Stored Procedure there are 2 parts
    First : Update the table
    Second : Execute the SELECT statement that generate the data that the rpt process

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center