Printing values

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Printing values

Post by blairetabay » Sat Mar 01, 2014 10:16 am

Hi to all,

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


this is the datagrid to show that is working us of now in getting all the value in a row.

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

i try to compare it is the same way it should print all the row

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Printing values NEED HELP

Post by Mark » Sat Mar 01, 2014 5:42 pm

Hi,

Could you write exactly what your code currently does and what you want it to do instead?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: Printing values NEED HELP

Post by blairetabay » Sun Mar 02, 2014 3:01 pm

Hi Mark,


all I want is to print the value in quartam coming from my datagrid. The problem is only the first column of the row is being printed not all the data inside my datagrid.


thanks in advance

Mark

blaireTabay

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Printing values NEED HELP

Post by Klaus » Sun Mar 02, 2014 4:10 pm


Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Printing values

Post by Mark » Sun Mar 02, 2014 4:19 pm

Merge again, Klaus?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Printing values

Post by Klaus » Sun Mar 02, 2014 4:31 pm

Mark wrote:Merge again, Klaus?

Mark
Do you think that will help? :D

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Printing values

Post by Mark » Sun Mar 02, 2014 4:33 pm

Or just delete this thread.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Printing values

Post by Klaus » Sun Mar 02, 2014 4:45 pm

Hi Blaire,

as I wrote in the other thred, this is obvioulsy a very special QuartamReports related problem,
and chances a not very high to find someone in this forum, who also works with that Livecode Add-on.

The Quartam FORUM is in fact accessible and asking there is at least worth a try!

And please stop opening new threads for already posted problems, only because you might not have received a satisfying answer so far.
This is not the first time, mon ami 8)


Best

Klaus

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: Printing values

Post by blairetabay » Sun Mar 02, 2014 5:09 pm

hi Klaus,


Sorry for this thread that i made. its already running now. i just figure it out where i went wrong i just review my codes.


best


blaireTabay

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Printing values

Post by Klaus » Sun Mar 02, 2014 5:22 pm

Hi Blaire,

no problem, glad you got it working now!
Maybe you can tell us what went wrong?


Best

Klaus

Post Reply