Page 1 of 1

Cloning card with datagrid

Posted: Wed Aug 28, 2013 4:28 pm
by MaxV
Hi,
I have to create a PDF with many page, every page has it's own datagrid with 2 columns (named "Decrizione" and "Importo").
The first page is the master page, all other pages are cloned from the first one. The problem is that all cloned page has the label of the columns inverted (data are in the correct order :?: ), but only the first (master) page is ok. Since all other elements and the data loaded in the datagrid are ok, I don't know what is wrong :(
Moreover I use the master page and add data in it like in all others..
I use the following code to load data in the data grid in every page cloned:

Code: Select all

clone this card
put 1 into n #line counter
repeat for each line riga in tRecords   
  put the first item of riga into myArr[n]["Descrizione"]
  put the second item of riga into myArr[n]["Importo"]         
  add 1 to n
end repeat      
set the dgData of group "voci" to myArr   
delete variable myArr
Here is the results:
Image

Any ideas?

Re: Cloning card with datagrid

Posted: Wed Aug 28, 2013 4:35 pm
by Klaus
Buongiorno Max :-)

hmm, sound like a bug to me!

is your datagrid of type TABLE?
If yes, you could simply set its DGTEXT to tRecords!
And better you could do this:
...
## We put the HEADER into the first line of the data for the datagrid:
put "Descrizione" & TAB & "Importo" into tData

## Now we add the actual data
put CR & tRecords after tData

## Now we tell Livecode that the first line contains our headers for the datagrid:
set the dgtext[TRUE] of grp "whatever" to tData
...
That should "fix" the wrong order of the headers.


Best

Klaus

Re: Cloning card with datagrid

Posted: Wed Aug 28, 2013 4:41 pm
by MaxV
I suspect that it's a bug too. I inspected the Label property values and they are correct, but someway when cloning... some scramble labels rendering...

Re: Cloning card with datagrid

Posted: Wed Aug 28, 2013 4:59 pm
by MaxV
There is some memory management bug, closing all the IDE and reopening it all seem resolved