i'm a new user of LC.
A serious problem appear on my print a stack
after i have created a stack that will print everything works will. i loop the value of the data grid to fit to my needs,
From here everything just work accordingly on just 1 page of document.
Problem is i have lot of documents pages to be print.
any suggestion will do.
thanks in advance.
best for all.
how to print two pages or more in datagrid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 34
- Joined: Mon Feb 24, 2014 10:12 am
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: how to print two pages or more in datagrid
Hi.
There are a number of ways to print multiple pages. Please read the dictionary on the "revPrintText" command.
Craig Newman
There are a number of ways to print multiple pages. Please read the dictionary on the "revPrintText" command.
Craig Newman
Re: how to print two pages or more in datagrid
Here is how I did it, probably not even close to the best way but it works for me. Basically I create a .htm and print it from google chrome
Code: Select all
on mouseUp
local tFileName, tFileContents, tDate, tDataLineTemp, htmlScript
put short date into tDate
replace "/" with "-" in tDate
put "//mfcpdc2/qc/Metals Fab tracker/Reports/" & tDate & " " & fld "Job" & " NDT Report.htm" into tFileName
put the dgProp[ "columns" ] of group "DataGrid 1" into tColumnTitles
replace "tracker" with "" in tColumnTitles
put "<table border=" & quote & "1" & quote & ">" & return & "<thead><tr>" into htmlScript
put 1 into lNumber
repeat with x = 1 to the number of lines of tColumnTitles
put "<th title=" & quote & "Field #" & lNumber & quote &">" before line x of tColumnTitles
put "</th>" after line x of tColumnTitles
put lNumber + 1 into lNumber
end repeat
put tColumnTitles after htmlScript
put return & "</tr></thead>" & return & "<tbody>" after htmlScript
put the dgText of group "DataGrid 1" into tData
repeat with x = 1 to the number of lines of tData
put line x of tData into tDataLineTemp
replace Tab with return in tDataLineTemp
repeat with y = 1 to the number of lines of tDataLineTemp
put "<td align=" & quote & "left" & quote & ">" before line y of tDataLineTemp
put "</td>" after line y of tDataLineTemp
end repeat
put "<tr>" before tDataLineTemp
put return & "</tr>" & return after tDataLineTemp
put tDataLineTemp after htmlScript
end repeat
put htmlScript into URL ("file:" & tFileName)
launch url ("file:" & tFileName)
end mouseUp
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- Posts: 1
- Joined: Thu Sep 11, 2014 5:26 pm
Re: how to print two pages or more in datagrid
Hello Dav im having some problems with launch url, when i use it with a simple url it opens chrome and launch that url, but when i try to open the htm file that you created with your script chrome doesnt do it.
maybe u can help me with that.
Regards
maybe u can help me with that.
Regards
DavJans wrote:Here is how I did it, probably not even close to the best way but it works for me. Basically I create a .htm and print it from google chrome
Re: how to print two pages or more in datagrid
put short date into tDate
replace "/" with "-" in tDate
put "//mfcpdc2/qc/Metals Fab tracker/Reports/" & tDate & " " & fld "Job" & " NDT Report.htm" into tFileName
here is the script where I create the html file, it is putting it on my server (//mfcpdc2/) make sure you change that to your server or local C: or it wont be able to save the file for chrome to open.
maybe post your adapted script?
replace "/" with "-" in tDate
put "//mfcpdc2/qc/Metals Fab tracker/Reports/" & tDate & " " & fld "Job" & " NDT Report.htm" into tFileName
here is the script where I create the html file, it is putting it on my server (//mfcpdc2/) make sure you change that to your server or local C: or it wont be able to save the file for chrome to open.
maybe post your adapted script?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här