i have a serious problem regarding with printing,
it almost working now the only problem is the datagrid printing to loop its value. I try a button on the other card its working.
code for printing
Code: Select all
local sCurrentRecord
local sDetail, sDocument, sLastRecord,sample
local tLayoutFile, tDataBroker, tShowPreview
on mouseUp
put 1 into sCurrentRecord
if "qrtReportsLib" is not among the lines of the stacksInUse then
start using stack "qrtReportsLib"
end if
put AbsolutePath ("tabaySample.qrl") into tLayoutFile
put the long ID of me into tDataBroker
put true into tShowPreview
qrtReports_PrintReport tLayoutFile, tDataBroker, tShowPreview
end mouseUp
on MyPrintReport
put 1 into sCurrentRecord
#put fld "CustomerName" into sDocument["CustomerName"]
#set the itemDelimiter to tab
-- put fld "txt_PatientID" into sample["sample2"]
-- put fld "txt_f" into sample["sample3"]
-- put fld "txt_f" into sample["sample4"]
#answer sample["sample2"]
put fld "txt_id" into sample["sample2"]
#put fld "txt_f" into sample["sample3"]
#put fld "txtM" into sample["sample4"]
#put tRecords into sample["sample4"]
end MyPrintReport
on MyPrepNextDetail
put the dgData of group "dgGrid" into theDataA
put the dgIndexes of group "dgGrid" into theIndexes
repeat for each item theIndex in theIndexes
set the itemDelimiter to tab
put theDataA[theIndex]["Col 3"] & cr after tRecords1
put theDataA[theIndex]["Col 1"] & cr after tRecords2
end repeat
put tRecords1 into sample["sample3"]
put tRecords2 into sample["sample4"]
#answer values
end MyPrepNextDetail
function qrtReports_endOfReport
-- we only have to print a single record
if sCurrentRecord > 1
then return true
else return false
end qrtReports_endOfReport
on qrtReports_moveNextRecord
-- merely update our sCurrentRecord local variable
MyPrepNextDetail
MyPrintReport
add 1 to sCurrentRecord
end qrtReports_moveNextRecord
function qrtReports_valueOfExpression pExpression
-- this function will evaluate an expression and return the result
put pExpression into tExpression
replace "<QUOTE_REPLACEMENT>" with quote in tExpression
return value(tExpression)
end qrtReports_valueOfExpression
function AbsolutePath pRelativePath
## this helper function looks for files from the directory where the stack is saved
put the effective filename of this stack into tAbsolutePath
set the itemDelimiter to "/"
put pRelativePath into item -1 of tAbsolutePath
return tAbsolutePath
end AbsolutePath
Code: Select all
on mouseUp
put the dgData of group "dgGrid" into theDataA
put the dgIndexes of group "dgGrid" into theIndexes
repeat for each item theIndex in theIndexes
put theDataA[theIndex]["Col 3"] & cr after tRecords
end repeat
answer tRecords
#breakpoint
end mouseUp