Solved Procedute to take a Print screen & Store in Data Item Using Blue Prism

VJR

Well-Known Member
Staff member
#21
Hi Ujjaldas,

The code I've mentioned above is in BP v5 and you have v6. Perhaps something may have changed and hence you are seeing the errors.
In any case Format is a Microsoft.VisualBasic function.
Either add 'Microsoft.VisualBasic' to the Namespace imports section of the Initialise tab
OR use any of the .net equivalent of the format and now functions. (Refer link https://www.dotnetperls.com/datetime-format-vbnet)
 

VJR

Well-Known Member
Staff member
#23
@VJR
thanks a lot for the description :)

I took the mentined steps bot got an error on the code. Could you help?



View attachment 1673
Hi lee,

- Open the 'Initialise' tab -> 'Code Options' tab of the 'Utility - Image Manipulation'
- Add this path to the External References. (Must be at the same location as mentioned below but locate it on your machine)
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll

- Add the below in the Namespace Imports section
Microsoft.VisualBasic
System.Windows.Forms
 

lee

New Member
#24
@VJR ,I cannot understand the path question because I do not know whether there are special path we need to pat attention to. Do we only need to input the OutputFolderPath ?
Thanks a lot for your help.
I had solve the problems, there is no question with VBO and code. Thanks a lot.
 
#27
@VJR Thanks for your inputs for screen capture . I Have gone through the all step mentioned and implemented ,while running i'm getting below internal error .Could you please help us to resolved the below issue.

Internal : Could not execute code stage because exception thrown by code stage: Illegal characters in path.
 

VJR

Well-Known Member
Staff member
#28
@VJR Thanks for your inputs for screen capture . I Have gone through the all step mentioned and implemented ,while running i'm getting below internal error .Could you please help us to resolved the below issue.

Internal : Could not execute code stage because exception thrown by code stage: Illegal characters in path.
Hi Devendhar, can you post the details that I enquired for?
 
#29
@VJR : I have attached image files for the below error message .Could you please verify and let me know any changes on this.

Internal : Could not execute code stage because exception thrown by code stage: Illegal characters in path.
 

Attachments

VJR

Well-Known Member
Staff member
#30
Hi Devendhar,

This is how you can get to trace to the source of the issue.

- Error Message:
Internal : Could not execute code stage because exception thrown by code stage: Illegal characters in path.

This means there is something wrong in the path.

- How is this path being passed to the code stage?
It is passed via 'OutputFolderPath'

- What is the value of 'OutputFolderPath' from the data item?
C:\ERICSSON

- Where is this 'OutputFolderPath' used in the Code stage due to which it is throwing the error?
On this line-
FullSavedScreenshotPath = OutputFolderPath & Format(now, "dd-MMM-yy hh-mm-ss") & ".jpeg"

- Lets replace the value from the data item on this line
Code Line:
FullSavedScreenshotPath = OutputFolderPath & Format(now, "dd-MMM-yy hh-mm-ss") & ".jpeg"
After Replace:
FullSavedScreenshotPath = C:\ERICSSON21-Aug-18 09-04-08.jpeg

- The original cause of the problem
There should be a slash in the path after the folder name in your data item, else it is an invalid path.
C:\ERICSSON21-Aug-18 09-04-08.jpeg
C:\ERICSSON\21-Aug-18 09-04-08.jpeg

This is the example I have used-
Also you forgot to read the instructions in Point #3 :)
You need to make sure that the folders exists or can amend the code that checks if the folder exists and creates one if it doesn't. Note the backslash \ at the end of the path.




But you can even add a line of code to append a slash in the OutputFolderPath variable if it is not found at the end of it.
 

VJR

Well-Known Member
Staff member
#33
Hi @VJR

I am getting compile error after clicking on Check Code button code stage.
I have copied and pasted the same code which you have provided.
I am using Windows 7 and BP 6.
Attaching the screenshot.

Would appreciate if you can look into it.

Thank You
Are you creating the new action outside of the Image manipulation VBO as opposed to the below given instructions?

Follow the below steps to create a new Action in the existing VBO:
Take a backup of 'Utility - Image Manipulation' xml file from the Blue Prism's VBO folder


2. Add a new tab and name it 'GetScreenshot'

If you want to create outside of it then you need to include all the namespace and references that are already in the Image Manipulation plus the one I have mentioned in post #8.
 

rva

New Member
#34
Are you creating the new action outside of the Image manipulation VBO as opposed to the below given instructions?

Follow the below steps to create a new Action in the existing VBO:
Take a backup of 'Utility - Image Manipulation' xml file from the Blue Prism's VBO folder


2. Add a new tab and name it 'GetScreenshot'

If you want to create outside of it then you need to include all the namespace and references that are already in the Image Manipulation plus the one I have mentioned in post #8.
Hi @VJR
Thanks for your reply!
I am creating the action in the existing 'Image Manipulation' VBO only.

Attached the screenshot, please have a look.
 

Attachments

#40
Hello @VJR I have added everything in NameSpace and in External References. I also checked the code and input/output parameters, there seems to be in right place. I still get an "A generic error occured in GDI+" error. How to fix this? Thanks
 

Attachments

Top