Turning the add report functionality in report explorer on or off
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.
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.
This discussion has been closed.
Comments
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;
I did try that, it didn't work.
ok.
Thanks for the suggestion.
Lauchlan M.
[ioAllowNew];
Specifically it says 'undeclared identifier ioAllowNew' and 'incompatible
types: tppItemOptionType and integer'
Lauchlan M.
If I try to do it with include, it says 'cannot assign to left-hand side'.
Lauchlan M.
(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;
I am talking OP, not RAP.
No, I don't.
Thanks,
Lauchlan M.
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;
It didn't compile. It gave me
"Undeclared identifier: 'TppItemOptionType'"
Thanks,
Lauchlan M.
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;
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.
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;