Source language: Translate to:

Datatable in clipboard INTO grid table in NB

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Datatable in clipboard INTO grid table in NB

Postby schmutly » Fri Apr 05, 2013 1:52 am

Howdy gang,
I have an external program that grabs some data and exports it into an excel file
or as a datatable into the clipboard.
I want to be able to import from the clipboard into neobook and have that 'table' populate
a grid, similar to the grids in the DBPro or even using a plugin like HPWGrid??
Any ideas thanks?
robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Datatable in clipboard INTO grid table in NB

Postby HPW » Fri Apr 05, 2013 2:33 am

Examine the [Clipboard] variable.
There you may see the format of the data.
When it is some kind of stringlist with a delimiter and one or two lineend char then you should be able to parse and/or reformat it.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Datatable in clipboard INTO grid table in NB

Postby schmutly » Fri Apr 05, 2013 5:22 am

Thanks Hans,
will look at that shortly,
Rob
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Datatable in clipboard INTO grid table in NB

Postby Neosoft Support » Fri Apr 05, 2013 11:32 am

If the contents of the clipboard are formatted correctly, you can use DBPro's dbpRecordToVar action to import it.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Datatable in clipboard INTO grid table in NB

Postby dpayer » Sat Apr 06, 2013 6:43 am

schmutly wrote:Howdy gang,
I have an external program that grabs some data and exports it into an excel file
or as a datatable into the clipboard.
I want to be able to import from the clipboard into neobook and have that 'table' populate
a grid, similar to the grids in the DBPro or even using a plugin like HPWGrid??
Any ideas thanks?
robbie


Here is a project to import via clipboard from excel (or table in MSIE) into a NB Variable Array. It can display the data in a HTML table inside a NB Webbrowser object.
Or you could loop the data in the variable to include it in multiple records of a database.

viewtopic.php?f=9&t=19293&p=11205997

David Payer
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Datatable in clipboard INTO grid table in NB

Postby schmutly » Mon Apr 08, 2013 2:03 am

Thanks for all the suggestions all.
@David...
I actually tried your Array2Table but i think theres a problem
with the delimiters.
I have in clipboard, for example:
"name","age"
"rob","20"
"joe",21"
"sam","22"
If i copy that to clipboard then click the "paste & process" it
sometimes doesnt copy all the quotes (yes, i know its from clipboard only)
but if i have a string in one of the elements ie:
"rob","a knife,fork and spoon" then the array gets split into 3 because of that
extra , after knife (having set the delimiter with ","
It's probably me not understanding that correctly.
I have no worries importing a CSV into DBPro.
Its funny, all i want is a simply grid to 'display' my results from another program that i made which has
an option to copy to excel (works perfect) or copy as a variable. Then i copy this variable to clipboard
and want it to display by pasting it into a NB array.
Tried also to use HPWGrid but cant get it to work.

So basically trying to get a "clipboard" containing
"name","age"
"rob","20"
"joe",21"
"sam","22"
.....into a grid and display like DAvid has show in the array.

@ Support
"....If the contents of the clipboard are formatted correctly..."
From the Csv i copy it to clipboard:
"Title","Platform","Genre"
"Kingdom Hearts 3D","Nintendo 3DS","RPG"
"Pilotwings Resort","Nintendo 3DS","Flight Simulation,Simulator"
....etc,
I will have a look at DBPro's dbpRecordToVar and try that tonight.
Thanks for all your help.
Ps: the other program is a 3rd party program that stores the results in Excel,
but if someone doesnt have excel i prefer a NB where results are displayed in
a Grid instead of having to rely on Excel.
Cheers and Thanks again,
robbie
EDIT:
The DBPro dbpRecordToVar didnt work as it tried to import into one record but i need
each field separated.I tried to use
dbpImportFromCSV "Tags" "Field1" "[Clipboard]" "Delimiter=,;ContainsFieldNames=Yes;MatchFieldNames=Yes"
and use the clipboard & tried even a variable but no go.
If it had an importFromVariable instead of from Csv & think it would work.
Heeellllp lol ;P
Robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Re: Datatable in clipboard INTO grid table in NB

Postby Neosoft Support » Mon Apr 08, 2013 10:59 am

The dbpVarToRecord can only import one record at a time. If the clipboard contains multiple records then you will need to save the clipboard contents to a file, then use dbpImportFromCSV to import that file. For example:

FileWrite "[PubDir]TempData.csv" "All" "[Clipboard]"
dbpImportFromCSV "Tags" "Field1" "[PubDir]TempData.csv" "Delimiter=,;ContainsFieldNames=Yes;MatchFieldNames=Yes"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Datatable in clipboard INTO grid table in NB

Postby schmutly » Mon Apr 08, 2013 5:32 pm

Thank you :D
worked a treat..feel a bit stupid as once i looked at it made complete
sense.Thats great..thank you again all.
Robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm


Return to NeoBookDBPro

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron