Subscribe to this thread
Home - General / All posts - Radian - copy values from query results
mlinth
447 post(s)
#28-Mar-17 10:38

Is there a way to copy values from a query results pane?

E.g. in Manifold I can run a select query, then select records from that query output and subsequently copy the rows. I don't appear able to do that in Radian.

What I'm trying to do is run a select query, then copy / paste the output into Excel.

I can of course do a select INTO query and export that, but in this case copy/paste would be easier.

On a related note, is there a way of copying the values of one cell from the query results? If I hover over a cell a little pop-up appears with the contents, but I can't copy that to the clipboard.

adamw


10,447 post(s)
#28-Mar-17 12:50

If the result table of the query exposes a btree index, you can select records and then copy / paste them as a new table or into an existing table.

Example query that you can select and copy records from:

--SQL

SELECT * FROM mfd_root WHERE name LIKE 'mfd%';

You can not, however, copy and paste records between Radian and Excel and you can not copy and paste cell values.

We have a number of wishlist items in this area, more suggestions for specific items are always welcome.

mlinth
447 post(s)
#29-Mar-17 13:46

Thanks Adam,

Will have a think and send in a suggestion.

Meanwhile, is it possible to access the clipboard from a script? If so I could write a little copy/past script. I had a quick play and couldn't figure it out, but I thought that it might be a nice little "get to know scripting" exercise in Radian for me.

M

adamw


10,447 post(s)
#29-Mar-17 17:36

Yes, you can access the clipboard from a script.

In .NET, this is done using the System.Windows.Clipboard class. You can, for example, access data copied from Excel using Clipboard.GetText (use other methods to determine whether the clipboard contains anything, etc). That text is going to be tab-separated CSV, if I remember correctly - you can then parse that into records and values and insert the result into a table in Radian. Going the other way around is currently difficult, because when you copy data from Radian, we only put them into the clipboard in binary format.

tjhb
10,094 post(s)
#29-Mar-17 21:04

I made a few notes here on some of the .NET methods, after experimenting with how Manifold 8 uses the Clipboard. Might be of some use.

mlinth
447 post(s)
#29-Mar-17 21:59

Thanks Adam and Tim,

I think I'm missing something obvious, but I can't get this working in Radian. The following (vb.net) works perfectly in Manifold:

Imports Manifold.Interop.Scripts

Imports System.Windows.Forms

Class Script

    Shared Sub Main

 

        dim myString as string = "Hello"

        myString = Clipboard.GetText()

        Context.Application.MessageBox(mystring, "Clipboard contents")

        Clipboard.SetText("here, is, some, text for the clipboard"

    End Sub

End Class

So, I can get text from the clipboard, and I can put text on the clipboard. (Note it references System.Windows.Forms).

Now, trying the same in Radian, I get a "Clipboard is not declared" error. What am I missing? (It coughs if I add "Imports System.Windows.Forms" - can't find the namespace)

' VB.NET

Imports System.Windows

Class Script

Shared Manifold As Manifold.Context

Shared Sub Main()

 

    dim myString as string = "Hello"

    myString = Clipboard.GetText()

    Manifold.Application.Log(myString) 

    'Manifold.Application.OpenLog()

End Sub

End Class

Lorne

655 post(s)
#29-Mar-17 22:33

Try this:

' VB.NET

' $reference: System.Windows.Forms.dll

Imports System.Windows.Forms

Class Script

Shared Manifold As Manifold.Context

Shared Sub Main()

Clipboard.SetText("Hello")

Manifold.Application.MessageBox(Clipboard.GetText(), "")

End Sub

End Class

mlinth
447 post(s)
#30-Mar-17 07:27

Thanks Lorne. That's the bit I was missing.

Works now!

M

lionel

995 post(s)
#27-Jul-17 06:42

where is documentation about Manifold.Context ? and more general context ?

i see context is use by office https://dev.office.com/reference/add-ins/shared/office.context.document

i see context is use by adam http://www.georeference.org/Forum/t136236.8#136245

.

Where is documented all the "namespace" ? locate for manifold in this directory ?

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\manifold.*

.

Can we have access to the API using the dll like MAnifold.Interop.Scripts.Dll ?

.

What is the name functionnalities aim of this dll ?

( share dynamic ,jit , server ? , RCW or CCW ? , COM or .NET )


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en

KlausDE

6,410 post(s)
#27-Jul-17 07:27

http://manifold.net/doc/api/scripts-net.html#the_context_object


Do you really want to ruin economy only to save the planet?

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.