Can anyone point me in the right direction for how to set up a workflow to automate the running/emailing out of a custom crystal report?
This isn't an answer to your question, but we use a third party Crystal Report scheduler called Logicity to automatically send out reports. It allows us to convert to PDF or Excel automatically. It is simple and has worked fine for our needs. I only use the X3 workflows for email alerts like when batch tasks or imports fail.
Glen,
I have some reports running and emailed based on the workflow as I’ve explained. What I do is I run the report as an action on the workflows start and either export it to excel or pdf. Then in the workflow I specify in the file attachment field the path to the file I just created and the workflow emails the report.
If it needs to be scheduled and not triggered through any transaction then I can use the Recurring task management and trigger the workflow.
I agree that this is only for someone that knows a little how to code in X3 and it is not fully GUI but it does the job. You can create the code once and then just call the action with parameters.
HI Glen,
I was recently doing something simular and I'm curious about how (what format) you specified the path to your file. I ran into issues with this and ended up having to use the filpath formula and even then was limited to the file being in the root, or a subfolder in the root of the current X3 folder. I'd also be intersted in more details on running the report as an action when the workflows start - you you set that up exaclty. When you mention the code, are you talking about the Call WORKFLOW(TYPEVT,CODEVT,OPERAT,CLEOBJ) from AWRK code? I'm using that as well in my code.
Thanks,
-Mike
Hi Mike,
To set the file path, add an entry point to AIMP3 and set the FICHIER variable to your desired path. In the example below I set the path and file name and I add the soh number in the file name. Use this same logic in the workflow path.
$ACTION
Case ACTION
When "IMPRIME" : Gosub IMPRIME
Endcase
Return
$IMPRIME
If ETAT = 'MyReportName' and DESTINATION = 4 Then
FICHIER = "C:\tmp\" + [F:SOH]SOHNUM + "_created.xls"
Endif
Return
Regarding the action start, in the last tab of the workflow just select an action and specify to run at start. On the bottom enter the parameters. The action is going to call etat from aimp3
The answer is yes to running the workflow from code
Thanks,
Israel
*Community Hub is the new name for Sage City