Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Using UserDefiend Variables for Search and passing values end executing them

edited October 2002 in General
HI all,
You guys are great.I'll thanks all of you helping me out with my problems.

Here is what I want to do next :
1. We have a Query wizard similar you report builder's query wizard.

2. After loading table/Fields, in the Search screen , I want add a user
defined values and Save the query.


3.At the time of opening the Report, I will prompt them to enter the actual
value and execute the Report.

Here is want I am talking abt:

Field Name Field Alias Operator Value

BDate Birth Day = :Birth
day

Here Birth day value is asked user to enter at the time of opening the
query.
Please let me know how do I complete this task...

Thank you
Sincerely,
-Bhoj

Comments

  • edited October 2002
    You can create autosearch fields at runtime on the report (these search
    values are not persistent). Then use the standard autosearch techniques to
    check these values and modify the query that you create by adding a filter
    or adding to the WHERE clause. See the autosearch demos in the
    RBuilder\Demos\Autosearch directory.

    Are you using the DADE classes to handle the code behind you query wizard?
    If you are, then you are probably familiar with the TdaSQL class. Using the
    TdaSQL object of the dataview, you can define search criteria at runtime
    which can be persistent if the template is saved with this dataview in the
    datamodule of the report template. Here is an example of adding search
    criteria on the TdaSQL object after it has been extracted from the report:

    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Yes, I am aware of tdaSQL object that what I've been playing with so far.
    The example you send me doesn't have a right dfm file.
    Could you please send me again which I can be compiled in Delphi 4.0?

    Thanks
    -Bhoj


  • edited October 2002
    Sorry, I don't have D4 installed right now. You should be able to open the
    pas file and recreate the form in a new project. The form has a report, a
    designer component and two buttons. One calls Report.Print and the other
    calls Designer.Showmodal. The report has a single customer dataview in it.
    That is all that is in the form. All of the good stuff is located in the
    the form unit which you should be able to open to see the approach.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.