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

Creating AutoSearch parameter not linked to a Field

edited November 2006 in End User
Hi all,

Is there a way to create an AutoSearch parameter that is not linked to a Field?


For instance, I need an unlinked parameter that provide to end-user an choice to show or
hide an specific column on final report. In this case, the end-user will choice between y
or n (yes or no), for example.

Is it possible?

By the way, using D7 with RB 7.04.


TIA,
Laercio

Comments

  • edited November 2006
    Hi Laercio,

    It is possible to create an AutoSearch field that is not linked to any data
    however in your case you would need to create a custom autosearch dialog.
    If you take a look at some of the autosearch demos, you will see that the
    text generated for the autosearch dialog is dependent on the type of search
    operator you are using. You would need to customize this text in order to
    give your users a good idea what is required as an input. Then you could
    hide the column based on the entered value in the OnGetAutoSearchValues
    event.

    Another option would be to display your own dialog before the report prints
    and toggle the visibility based on that input. This may be easier that
    trying to manipulate the autosearch dialog.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Hi Nico,

    Thanks for your reply.

    More questions:
    1. How to create an AutoSearch field that is not linked to any data?
    2. Is there a way to do this in an end-user application environment? In other words, can
    the end-user create this type of AutoSearch field, without code? I'm trying to do all
    reports in my application using only end-user environment.

    By the way, I already have a custom autosearch dialog created and I think that using
    AutoSearch dialog is the best way to solve my problem.


    TIA,
    Laercio


    Nico Cizik (Digital Metaphors) escreveu:
  • edited November 2006
    Hi Laercio,

    Sorry, this is not possible to do without code. Essentially you trying to
    use the AutoSearch parameters for something they were not designed to do.
    The end-user solution will not allow this.

    I would recommend either adding a custom area to your autosearch dialog that
    simply sets a flag in Delphi letting the report know to hide or show a
    column, or perhaps adding a toolbar button or link to the previewer that
    does the same.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Nico,

    Thanks a lot, I'll try to do something like you suggested.

    Laercio


    Nico Cizik (Digital Metaphors) escreveu:
  • edited November 2006
    Nico,

    By the way, you said in the first answer that is possible to create via
    code, ok? So, can you give me an example about how to do this?

    I think I made a mistake, sending a copy of this message to your e-mail.
    Sorry for an inconvenience.

    TIA,
    Laércio


    Nico Cizik (Digital Metaphors) escreveu:
  • edited December 2006
    Hi La?rcio,

    You can use the Report.CreateAutoSearchCriteria method to manually create
    autosearch criteria (see the autosearch demos located in the
    \RBuilder\Demos\... directory) or if you are using DADE, you can use the
    TdaSQLBuilder to do the same. Take a look at the TdaSQLBuilder topic in the
    RBuilder help for more information and code examples.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    Ok Nico, thanks for your help.

    Laércio


    Nico Cizik (Digital Metaphors) escreveu:
This discussion has been closed.