Normal Topic Print Image File questions (Read 790 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Print Image File questions
Mar 20th, 2012 at 6:45pm
Print Post Print Post  
I was printing to a specific pre printed form using printstring commands and all was good.

The form then needed to be sent as a print image file so I created a generic text printer set my programming in sbasic to choose that printer and all was good.

That process created 1 file every time a user reviewed the data and pressed the command button.

I now need to "batch" the output so there is 1 file with lots of forms instead of 1 form per file.

My thoughts are maybe use some sort of utility to merge all .txt files sesame creates or is there a method to append the txt file the generic printer is creating  or would I scrap my printstring code completely and use file I/O commands to create my own print image files or maybe have a reviewer mark record as good to print then do a retrieve on all them then do some kind of loop stuff to print to generic text printer.

All thoughts and help will be appreciated.
Thanks   
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Print Image File questions
Reply #1 - Mar 20th, 2012 at 6:49pm
Print Post Print Post  
Check out the NewPage() command. This is in contrast to NewDocument().
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Print Image File questions
Reply #2 - Mar 20th, 2012 at 7:23pm
Print Post Print Post  
Thanks,

I have used Newdocument in other instances but always when running through a bunch of records within the same command button push. In the situation I am dealing with presently users are reviewing files and when they are satisfied a particular record is correct  they would print it and move on to another record. It could be numerous records before  they press the button again. Thats why I was thinking I would maybe change the record status / flag and then run the retrieve at a set time of the day and loop through the records that meet that criteria and output them to the generic text printer at once.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Print Image File questions
Reply #3 - Mar 20th, 2012 at 7:55pm
Print Post Print Post  
It may be simplest  to just let the user  continue as is making 1 file at a time and then add a new ADMIN button that has Sbasic that runs copy *.txt dateandtime.txt and then move all the other files to a done section.

Something like that.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
RickRob
Member
*
Offline



Posts: 3
Joined: Apr 17th, 2012
Re: Print Image File questions
Reply #4 - Apr 17th, 2012 at 8:02pm
Print Post Print Post  
Hi - I am having the same problem- this is the loop code I am using and it works fine when sent to a printer but not to a file (ask for a new file name for each page.  Did you ever solver your issue?

Var vCount as Int
Var vLoop as Int
Var vPos as Int

SUBROUTINE PrintIt()

PrintPageOrientation(1)
AlternateDefaultPrinter("textprint")
Newpage (850,1100)

PrintString(Company, 30, 35, 0, "Arial", 14, 0)
PrintString(Address, 30, 55, 0, "Arial", 14, 0)
PrintString(City, 30, 85, 0, "Arial", 14, 0)
PrintString(sTate, 30, 105, 0, "Arial", 14, 0)
PrintString(Zip, 30, 155, 0, "Arial", 14, 0)

finishPage()

END SUBROUTINE

     vPos = @ResultSetCurrentPosition()
     vCount = @ResultSetTotal()
     For vLoop = 1 to vCount
           ResultSetCurrentPosition(vLoop)
           PrintIt()
     Next
     ResultSetCurrentPosition(vPos)


  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Print Image File questions
Reply #5 - Apr 17th, 2012 at 9:04pm
Print Post Print Post  
Hey Rick,

Try

Code
Select All
Var vCount as Int
Var vLoop as Int
Var vPos as Int

SUBROUTINE PrintIt()

PrintPageOrientation(1)
AlternateDefaultPrinter("textprint")
Newpage (850,1100)

PrintString(Company, 30, 35, 0, "Arial", 14, 0)
PrintString(Address, 30, 55, 0, "Arial", 14, 0)
PrintString(City, 30, 85, 0, "Arial", 14, 0)
PrintString(sTate, 30, 105, 0, "Arial", 14, 0)
PrintString(Zip, 30, 155, 0, "Arial", 14, 0)

finishPage()

END SUBROUTINE


	NewDocument(1)
	vPos = @ResultSetCurrentPosition()
	vCount = @ResultSetTotal()
	For vLoop = 1 to vCount
		ResultSetCurrentPosition(vLoop)
		PrintIt()
	Next
	ResultSetCurrentPosition(vPos)
	FinishDocument()
 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
RickRob
Member
*
Offline



Posts: 3
Joined: Apr 17th, 2012
Re: Print Image File questions
Reply #6 - Apr 18th, 2012 at 11:57am
Print Post Print Post  
Thanks Ray
  
Back to top
 
IP Logged