Collection to clipboard

ilarum

New Member
Hi,

I need to move all the data from collection to clipboard. Is there any specific action stages to get this done.
 

wasifahmad

New Member
You can try to convert collection to json . Also you can loop through the collection to keep the data sepearted by piped character and then copy the total data to a clipboard
 

maubrey

New Member
You can use a loop and calc/multi calc stage(s) to keep adding to a data item and then use 'Set Clipboard' in 'Utility - Environment' to grab the whole lot when you're done but I somehow don't think that will achieve the end you want. What do you want to do with the clipboard data?
 

Sachin_Kharmale

Active Member
Hi @ilarum ,

if you want to copy collection to clipboard then add new action in
collection Manipulation VBO. Copy Collection to Clipboard.

1. Code Stage Code Screen Shot.

View attachment 1585548937247.png
2.VB.net Code.
Code:
Try
    Dim strBuilder As New StringBuilder
    For J As Integer = 0 To Source_Collection.Columns.Count - 1
        strBuilder.Append(Source_Collection.Columns(J).ColumnName & chr(9))
    Next
    strBuilder.AppendLine()
    'copy the requested rows one by one
    For I As integer = 0 To Source_Collection.Rows.Count -1
        Dim Values(Source_Collection.Columns.Count - 1) As Object
        For J As Integer = 0 To Source_Collection.Columns.Count - 1
            Values(J) = Source_Collection.Rows(I)(J)
            strBuilder.Append(Values(J) & chr(9))
        Next
        strBuilder.AppendLine()
    Next       
    Clipboard.SetDataObject(strBuilder.ToString,True)
    Success = True
Catch Ex As Exception
    Success = False
    Error_Message = Ex.ToString()
End Try
I hope it will help you..!
 

vaibhavmane

New Member
Hi @ilarum ,

if you want to copy collection to clipboard then add new action in collection Manipulation VBO. Copy Collection to Clipboard.

1. Code Stage Code Screen Shot.
View attachment 5308
2.VB.net Code.
Code:
Try
    Dim strBuilder As New StringBuilder
    For J As Integer = 0 To Source_Collection.Columns.Count - 1
        strBuilder.Append(Source_Collection.Columns(J).ColumnName & chr(9))
    Next
    strBuilder.AppendLine()
    'copy the requested rows one by one
    For I As integer = 0 To Source_Collection.Rows.Count -1
        Dim Values(Source_Collection.Columns.Count - 1) As Object
        For J As Integer = 0 To Source_Collection.Columns.Count - 1
            Values(J) = Source_Collection.Rows(I)(J)
            strBuilder.Append(Values(J) & chr(9))
        Next
        strBuilder.AppendLine()
    Next      
    Clipboard.SetDataObject(strBuilder.ToString,True)
    Success = True
Catch Ex As Exception
    Success = False
    Error_Message = Ex.ToString()
End Try
I hope it will help you..!
Hi Sachin,

I have tried this code but I have 2 errors.

1) Description: Compiler error at line 2: Type 'StringBuilder' is not defined.
2) Description: Compiler error at line 16: 'Clipboard' is not declared. It may be inaccessible due to its protection level.

Please check it.

Thanks,
Vaibhav.
 
Top