[Imported] Multiple Pick Actions from a single Button click?
>>Message imported from previous forum - Category:ClearSCADA Software<< User: florian, originally posted: 2018-10-24 19:38:40 Id:193 This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.
**_neilj:_** **_I have 7 Crystal Reports to Export when the user clicks a button. However, a Button can only have one Pick Action method (which was how the CR Training Course did it), so I'm thinking of using Structured Text logic to call the Export method for each report.Can anyone give an example of the code required to declare each of the Crystal Report objects and call the Export method?_**
**_...or is there an easier way? (i.e. not using a script/logic)_**
AWoodland: Logic is probably best, less to worry about about what happens if your client connection goes down mid way through the process. Some example code:
PROGRAM GenerateReport METHOD Report1 AT %M(.Crystal Report 1.Export); Report2 AT %M(.Crystal Report 2.Export); END_METHOD
What you want to do after all 7 are generated might make it somewhat easier to do in scripting...
**_neilj:_** **_Thanks for the pointers Adam.The final code I created, with "Date From" and "Date To" values that all the Crystal Reports will use, is:_**
**_PROGRAM ExportReports_** **_METHOD_**
**_Report_01 AT %M(.DV01 - Inflow Vol.Export) : DATE, DATE;_** **_Report_02 AT %M(.DV02 - Total Inflow Vol.Export) : DATE, DATE;_** **_Report_03 AT %M(.DV03 - Target Discharge Vol.Export) : DATE, DATE;_** **_Report_04 AT %M(.DV04 - Actual Discharge Vol.Export) : DATE, DATE;_** **_Report_05 AT %M(.DV05 - Discharge Vol Diff.Export) : DATE, DATE;_** **_Report_06 AT %M(.DV06 - Discharge Vol Breach.Export) : DATE, DATE;_**
**_start_date AT %M(...Report Start Date.CurrentValue) : DATE;_**
**_end_date AT %M(...Report End Date.CurrentValue) : DATE;_**