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

VJR

Well-Known Member
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
@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
@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.
 

lee

New Member
@VJR I still have a question about how to insert this image to a word file. Thanks a lot foe your help and patience.
 

Devendhar

New Member
@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
@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?
 

Devendhar

New Member
@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

  • Initialise.png
    30.4 KB · Views: 53
  • Object_Code.png
    29.3 KB · Views: 42
  • Object_Input.png
    25.9 KB · Views: 32
  • Object_Output.png
    27.1 KB · Views: 28
  • Object_RunningFlow.png
    35.6 KB · Views: 27
  • ObjectFlow.png
    20 KB · Views: 27

VJR

Well-Known Member
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.

6-action-stage-of-process-call-jpg.448



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.
 

rva

New Member
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
 

Attachments

  • Screenshot Compile time error.PNG
    67.1 KB · Views: 26
  • Code.PNG
    69.6 KB · Views: 21

VJR

Well-Known Member
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
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

  • Screenshot.PNG
    99.1 KB · Views: 23

VJR

Well-Known Member
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.
Share the screenshot of your References and Namespace sections.
 

paulo_braggion

New Member
Hello @VJR

I am a problem, When I run the code, it gives me an error "A generic error occurred in GDI+". I am putting as input parameter the folder: "C: \ BluePrism"

Can you help me?
 

tommylu

New Member
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

  • 1.PNG
    13.5 KB · Views: 16
  • 2.PNG
    15.8 KB · Views: 14
  • 3.PNG
    17.6 KB · Views: 13
Top