
How to insert a data in a data grid from other substack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to insert a data in a data grid from other substack
hello everyone i just want to ask what is the script if i want to transfer the data from the fields in my substack to the main stack of the datagrid. thanks in advance 

Thank you & God Bless Everyone
Regards,
lemodizon

Regards,
lemodizon
Re: How to insert a data in a data grid from other substack
Hi.
You can collect the entirety of the contents of a DG using either the "dgData" or the "dgText". This gives either an array or a tab/return delimited dataSet.
Going the other way, if you format your field data with tabs and returns, just as if you wanted to paste into an Excel spreadsheet, and set the "dgData" of the dataGrid to that dataSet, the information will appear by magic.
Craig Newman
You can collect the entirety of the contents of a DG using either the "dgData" or the "dgText". This gives either an array or a tab/return delimited dataSet.
Going the other way, if you format your field data with tabs and returns, just as if you wanted to paste into an Excel spreadsheet, and set the "dgData" of the dataGrid to that dataSet, the information will appear by magic.
Craig Newman
Re: How to insert a data in a data grid from other substack
Hi Lemuel,
looks like you have a datagrid of typ TABLE, right?
Then you can modify -> the dgtext of grp "your datagrid here"
which is nothing but TAB and CR delimited text!
Do this, you may need to add -> of cd XYZ of stack XZY in the script,
depending where you put the script:
Best
Klaus
looks like you have a datagrid of typ TABLE, right?
Then you can modify -> the dgtext of grp "your datagrid here"
which is nothing but TAB and CR delimited text!
Do this, you may need to add -> of cd XYZ of stack XZY in the script,
depending where you put the script:
Code: Select all
...
## Collect the data in stack "Substack"
put fld "ID Number" & TAB & fld "Real Name" & TAB & fld "AGE" into tNewData
## Check if datagrid already has content:
put the dgtext of grp "your datagrid here" into tOldData
## New and first entry:
if tOldData = EMPTY then
put tNewData into tOldData
else
## We ADD the data
put CR & tNewData after tOldData
end if
## Now set the new data:
set the dgtext of grp "your datagrid here" to tOldData
...
Klaus
Re: How to insert a data in a data grid from other substack
Hello Klaus,
I tried your code there is error i think i did something wrong or i missed a script.
where will i put this: of cd XYZ of stack XZY in the script,
depending where you put the script:
Thanks Klaus
I tried your code there is error i think i did something wrong or i missed a script.
where will i put this: of cd XYZ of stack XZY in the script,
depending where you put the script:
Thanks Klaus
Thank you & God Bless Everyone
Regards,
lemodizon

Regards,
lemodizon
Re: How to insert a data in a data grid from other substack
What is the exact "address" of the datagrid?
LC needs to know, just like the postman!
...
put the dgtext of grp "your datagrid here" OF CD "xyz" OF STACK "your stack here" into tOldData
...
LC needs to know, just like the postman!

...
put the dgtext of grp "your datagrid here" OF CD "xyz" OF STACK "your stack here" into tOldData
...
Re: How to insert a data in a data grid from other substack
Klaus,
Thanks again this is now working. here is the script i created.
Thanks again this is now working. here is the script i created.

Thank you & God Bless Everyone
Regards,
lemodizon

Regards,
lemodizon