1. Daniel Vivier
  2. PowerBuilder
  3. Friday, 11 June 2021 16:17 PM UTC

I'm wondering whether anyone has done any enhancing of their PB applications to allow users to do scripting of the app's functions, and if so, what sort of technologies and techniques they used.

Here's an example of a user request we got today. A user has 60 different memorized reports in our program. They need to regularly create each report, save it to a password-protected PDF, and email each one to a different person.

Each of those individual features is already in the program (create memorized reports, save to password-protected PDF, and email the PDF), but it's all done through the UI, and it would be done one report at a time.

Obviously it would be an enormous benefit to the user if they could write a fairly simple script to do all that, and have the program run it. I'm envisioning something like this (just a first draft!):

RunMemorizedReport("Report 1 Name")
SaveReportAsPDF("password") // applies to last-run report
EmailReportTo("name", "email") // applies to last-PDF'd report
RunMemorizedReport("Report 2 Name")
...

Thanks!

Steen Jakobsen Accepted Answer Pending Moderation
  1. Sunday, 13 June 2021 06:03 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

 

I do lots of scripting using dw.evaluate()

It work great.

 

// steen

Comment
  1. Daniel Vivier
  2. Sunday, 13 June 2021 14:02 PM UTC
Thanks, Steen. So I guess if you were using dw.evaluate(), you'd have to have some global functions to do the actions. I guess we'd have to give up on standard naming (gf_*) for that to look reasonable to users. Definitely seems like a quite simple way to do it.
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Friday, 11 June 2021 21:07 PM UTC
  2. PowerBuilder
  3. # 2

I implemented this with a new module in my primary application called MULTI-REPORT PROCESSING. It was a major project, but it was worth it in terms of the time saved for the people that generate reports - they LOVE this! It's a generic solution that allows for either the same or different parameters at each run.


It's a Wizard:
   tabpage 1:  Lists all of the available reports and the output options.
   tabpage 2:  List the set of generic parameters that will be distributed to the individual reports
   tabpage 3:  Displays the distributed parameters on each selected report
   tabpage 4:  Everything needed to run the report and specify the target location.

Modules window:


Tabpage 1:


Tabpage 1 with only the selected reports displayed:



tabpage 2:

Note that the parameter values listed above are from SPACES to ZZZZZ.
Check the ALL VALUES checkbox on each row to get the maximum range of the parameter, regardless of datatype.
Valid parameters are saved when the user clicks on the next tabpage.


tabpage 3:

Remember: empty spaces get flagged as errors, but one or more SPACES are valid.


tabpage 4:

Users can specify the target file for the generated reports.
The Max number of rows that can be returned in a report is saved in a Preference (a user-modifiable constant).
Previously selected reports and output options can be overriden here for this run only.
"Halt on error" means to stop the current run on the first error.

Results are displayed by color per row:






Comment
  1. Daniel Vivier
  2. Sunday, 13 June 2021 14:00 PM UTC
Wow, very impressive! Ton of good ideas there.
  1. Helpful
  1. Olan Knight
  2. Sunday, 13 June 2021 20:58 PM UTC
Thanks, Dan! :)

  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 11 June 2021 17:41 PM UTC
  2. PowerBuilder
  3. # 3

it can be done in PB.

i have some lightweight scripting in my app.  I suggest using dw evaluate as much as possible (you need a datawindow object for that but it doesn't have anything in it).   i also have a PB script parser/state machine built to process my functions and parameters.  Simple commands and functions are pretty straightforward.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.