How do I change a user parameter at runtime from a layout object trigger?
Quite simply, you can’t. Once the BeforeReport trigger has fired, Reports locks down the user parameters until the report is finished. Oh, I know you can put a statement into a layout trigger at design time and the compiler will accept it, but the moment you run the report you will get a nasty error and the report will die. Why they couldn’t catch those problems at compile time I have no idea, except that it probably uses the same PL/SQL compiler as Forms which uses that same syntax for the perfectly acceptable function of changing field values. That being said, there is valid technique to mimic having a user variable which can be changed over the course of the report execution. What you have to do is create a PL/SQL package that contains a variable as well as the functions to read and write to that variable. Since variables inside a package are both local to that package and persistent over the duration of the run, you use this to save and change your variable value. I know that this
Related Questions
- If a user has a program that calls a subprogram, which is object code only, could the user see statement level statistics on that subprogram if the user makes the source code accessible to PROFILER?
- Why do the changes that I make to the column heading in the LAYOUT page of the USER DEFINED REPORT take sometimes and not others?
- Can I change a value of some flowchart objects parameter at model runtime?