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

Turning the add report functionality in report explorer on or off

edited June 2002 in General
Hi.

I have a report explorer component. I have figured out that to turn the 'add
new' button on or off I need to set the report explorer | ItemOptions
property to include ioAllowNew.

Doing this in design time is fine . . . in runtime I have tried

ReportExplorer.ItemOptions := []; // to clear the item options

ReportExplorer.ItemOptions := ReportExplorer.ItemOptions + ioAllowNew; // to
add ioAllowNew to it

However, the compiler does not allow the second line - it doesn't recognise
the ioAllowNew.

What is the right syntax for adding/removing the ioAllowNew from the
ItemOptions? Do I need to include some unit so it recognises the ioAllowNew?

These definitions are missing from the online help.

Thanks,

Lauchlan M.

Comments

  • edited June 2002
    Hi Lauchlan,

    working with a set in Delphi should be basic (see Delphi.hlp not
    RBuilder.hlp). How do you set a TFont.Option?
    try this :
    ReportExplorer.ItemOptions := ReportExplorer.ItemOptions + [ioAllowNew];
    You don't need to include another unit, because 'TppItemOptions' are
    declared in 'ppRptExp.pas'

    regards,
    Chris Ueberall;

  • edited June 2002
    > working with a set in Delphi should be basic (see Delphi.hlp not

    I did try that, it didn't work.


    ok.

    Thanks for the suggestion.

    Lauchlan M.
  • edited June 2002
    > > try this :
    [ioAllowNew];

    Specifically it says 'undeclared identifier ioAllowNew' and 'incompatible
    types: tppItemOptionType and integer'

    Lauchlan M.
  • edited June 2002
    > > > try this :

    If I try to do it with include, it says 'cannot assign to left-hand side'.

    Lauchlan M.
  • edited June 2002
    Lauchlan,

    (I assume we are talking about ObjectPascal and not RAP)
    do you have a variable or a constant defined named 'ioAllowNew'?
    I know no other reason, it should normally compile fine.

    regards,
    Chris Ueberall;

  • edited June 2002
    > (I assume we are talking about ObjectPascal and not RAP)

    I am talking OP, not RAP.


    No, I don't.

    Thanks,

    Lauchlan M.
  • edited June 2002
    Lauchlan,

    try this :
    ReportExplorer.ItemOptions := ReportExplorer.ItemOptions +
    [TppItemOptionType(1)];

    (But don't use it in your real application!)
    if you can compile it, you must have anywhere a re-definition of
    'ioAllowNew'.

    HTH,
    Chris Ueberall;

  • edited June 2002
    > ReportExplorer.ItemOptions := ReportExplorer.ItemOptions +

    It didn't compile. It gave me

    "Undeclared identifier: 'TppItemOptionType'"

    Thanks,

    Lauchlan M.
  • edited June 2002
    Lauchlan,

    TppItemOptionType is declared in 'ppRptExp.pas', which will be automatically
    included in your uses clause when dropping a 'TppReportExplorer' on the
    form.
    I think you must have a corrupt ReportBuilder installation.
    See tech-tip 'Cleaning up a Corrupt Installation'.

    HTH,
    Chris Ueberall;

  • edited June 2002
    > TppItemOptionType is declared in 'ppRptExp.pas', which will be
    automatically

    Thanks Chris.

    That solved it! I was setting the priviliges for adding new reports in my
    log in / initialisation section on a seperate form, and I hadn't added the
    ppRptExp to my uses clauses there.

    Lauchlan M.
  • edited June 2002
    Lauchlan,

    when I have such a problem like you had, I always scan the source code,
    simply using the full text search of the Windows Explorer helps a lot.
    I am glad to hear that you are back on the right track!

    regards,
    Chris Ueberall;

This discussion has been closed.