Hot Topic (More than 10 Replies) Printing (Read 2968 times)
adammatthews
Member
*
Offline


No personal text

Posts: 4
Joined: Mar 15th, 2004
Printing
Mar 15th, 2004 at 5:11pm
Print Post Print Post  
Does anyone know if Sesame supports coordinate printing as does Q&A, a convenient feature for printing to pre-printed forms?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing
Reply #1 - Mar 15th, 2004 at 6:16pm
Print Post Print Post  
Sesame has a PrintString command which allows very precise printing. See the Programming Guide, page 184-188.
  

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


No personal text

Posts: 4
Joined: Mar 15th, 2004
Re: Printing
Reply #2 - Mar 15th, 2004 at 7:10pm
Print Post Print Post  
Thanks for responding.  Do you know if it is as user friendly as Q&A where you simply input the line # and spacing?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing
Reply #3 - Mar 15th, 2004 at 7:26pm
Print Post Print Post  
Quote:
Thanks for responding.  Do you know if it is as user friendly as Q&A where you simply input the line # and spacing?


Honestly, I never found Q&A's method all that user friendly, especially when I needed to print the same value twice! Wink  I have Q&A databases full of extra fields that exist for no other purpose than that I needed to put the same value on a Print Spec more than once, or I needed to print a value that was not just a straight field value. There's also the fun issue of what constitutes a "line". Somehow, my preprinted forms never seemed to put the fields on the same line boundaries as Q&A. Grin

It does not work like Q&A's Print Spec. It is an SBasic command, rather than a picture of your Form. You will need to learn how to use it, but you will find it far more flexible. You can set precise position, font, font size, column width, measure values, print calculated or hardcoded values, etc.

PrintString("This is my string.", 100, 200, 0, "Arial", 33, 0)

The above line will print "This is my string" 1 inch in and two inches down in Arial font in letters about 1/3 inch tall.
  

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


No personal text

Posts: 4
Joined: Mar 15th, 2004
Re: Printing
Reply #4 - Mar 15th, 2004 at 11:18pm
Print Post Print Post  
Thanks again.  That was really helpful.
  
Back to top
 
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #5 - Mar 16th, 2004 at 6:34pm
Print Post Print Post  
Sad I used such printing all the time as Everyone wanted a print out of the database grouped on certain keys.  I did not need to repeat any fields as I was just printing out the record.  I was trying to find out how to do this in Sesame when I found this post.  I guess I will give it a try. Roll Eyes
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing
Reply #6 - Mar 16th, 2004 at 7:39pm
Print Post Print Post  
Quote:
Sad I used such printing all the time as Everyone wanted a print out of the database grouped on certain keys.  I did not need to repeat any fields as I was just printing out the record.  I was trying to find out how to do this in Sesame when I found this post.  I guess I will give it a try. Roll Eyes


Foster,

Either PrintString or a Report should manage what you need.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #7 - Mar 17th, 2004 at 7:58pm
Print Post Print Post  
OK, I decided to try PrintString and Saw how to write it.   But where does it go, and how do you run it?
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Printing
Reply #8 - Mar 17th, 2004 at 8:47pm
Print Post Print Post  
You have to put this in Command Button on element entry event.  You will have to define the page first before you put the printstring command.  Please see the advanced Programming example on page 221 in the programming guide to get some idea as to how it is done.  You may also refer "Inside Sesame", February issue, that deals with Check printing that requires very precise printing.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Printing
Reply #9 - Mar 17th, 2004 at 8:58pm
Print Post Print Post  
Quote:
OK, I decided to try PrintString and Saw how to write it.   But where does it go, and how do you run it?


My knowledge on print string is limited but basically this wil get you started. You make a command button and attach the code to on element entry.

1 create a command element button
2 save Layout design
3 use program layout to add this code to the button on element entry.

// This starts page
NewPage(850,1100)

//This prints a big header
PrintString("Place your static text here", 300, 25, 0, "BArial", 30, 0)

// now you can put all kinds of stuff. Elements strung together etc. See the Manual


// This is important to have. It lets the system know your finished.

FinishPage()


4 Save layout design
5 close design tab
6 Reconcile app.

Now when you run your app and press the command button a page will print with the header in bold.

Hope this gets you going.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #10 - Mar 17th, 2004 at 9:38pm
Print Post Print Post  
Thanks Bob & Bharat_Naik.  Grin  I think I see. Wink I am trying to learn this inbetween other work!
  
Back to top
 
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #11 - Mar 17th, 2004 at 10:48pm
Print Post Print Post  
Undecided I am dumb!  I looked over material and it looks like button will print one record only.  I would like to print 6 small records to a page. with 2 line header. 8 line to a record with each line having one to five fields. I used a dashed line between records.  I really am just trying to print a snapshot of each record.  Any help is appreciated.   Smiley
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing
Reply #12 - Mar 17th, 2004 at 11:12pm
Print Post Print Post  
You can also use PrintString in a Mass Update to print multiple records.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #13 - Mar 23rd, 2004 at 3:57pm
Print Post Print Post  
I wish Sesame had something like coordinate printing.  As I said earlier, I would like to print 6 small records to a page. with 2 line header. 8 line to a record with each line having one to five fields. I used a dashed line between records.  In Q&A I could tell each field where to print, do page setup, add headers and/or foorters, then tell Q&A where to print, use field names or not and finally how many records to a page. Grin
   Sesame does not help with any of this! No drop down lists, nothing.  Sad   I use to be a semi-power user of Q&A and know it had its faults.  But to print a record did not require a complete program to be written.  Right now it looks like I need to add a loop until last record.  I am trying and I will be back with more questions.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printing
Reply #14 - Mar 23rd, 2004 at 5:15pm
Print Post Print Post  
Foster,

It can be a bit tricky getting multiple records on a page. I wrote some code to get you started. It is a Mass Update written to run against the Customers sample application that comes with Sesame.

GLOBAL CODE:
Code
Select All
stat vHeader as String
stat vNumPerPage as Int
stat vNumRowsPerRecord as Int
stat vCnt as Int
stat vFace as String
stat vSize as String

// Change these to suit your needs
vHeader = "This is my header." + @NewLine() + "It has two lines."
vNumPerPage = 6
vNumRowsPerRecord = 8
vFace = " Arial"
vSize = "15"

vCnt = 0
 



ANY OTHER ELEMENT:
Code
Select All
var vYPos as Int
var vLSize as Int

vLSize = @ToNumber(vSize)
If vCnt = 0
{
	vYPos = 100
}
Else
{
	vYPos = 100 + (((vNumRowsPerRecord + 2) * vCnt) * vLSize)
}

vCnt = vCnt + 1

If vCnt = 1
{
	NewPage(850, 1100)
	PrintString(vHeader, 100, 50, 0, vFace, vSize, 0)
}

// Row 1
PrintString(Key, 100, vYPos, 0, vFace, vSize, 0)
PrintString(First, 200, vYPos, 0, vFace, vSize, 0)
PrintString(MI, 350, vYPos, 0, vFace, vSize, 0)
PrintString(Last, 400, vYPos, 0, vFace, vSize, 0)

// Row 2
PrintString(Company, 100, vYPos + vLSize, 0, vFace, vSize, 0)

// Row 3
PrintString(Add1, 100, vYPos + (vLSize * 2), 0, vFace, vSize, 0)

// Row 4
PrintString(Add2, 100, vYPos + (vLSize * 3), 0, vFace, vSize, 0)

// Row 5
PrintString(City, 100, vYPos + (vLSize * 4), 0, vFace, vSize, 0)
PrintString(State, 300, vYPos + (vLSize * 4), 0, vFace, vSize, 0)
PrintString(Zip, 400, vYPos + (vLSize * 4), 0, vFace, vSize, 0)

// Row 6
PrintString(Phone, 100, vYPos + (vLSize * 5), 0, vFace, vSize, 0)

// Row 7
PrintString(EMail, 100, vYPos + (vLSize * 6), 0, vFace, vSize, 0)

// Row 8
PrintString(Position, 100, vYPos + (vLSize * 7), 0, vFace, vSize, 0)

// Separator
PrintString(@Txt(50, "-"), 100, vYPos + (vLSize * 8), 0, vFace, vSize, 0)

If ((@ResultSetCurrentPosition() = @ResultSetTotal()) Or (vCnt = vNumPerPage))
{
	FinishPage()
	vCnt = 0
}
 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #15 - Mar 23rd, 2004 at 6:47pm
Print Post Print Post  
Thank yoou Hammer!!  Grin Grin Tried your programming  and it worked! Cheesy  It would have taken me a long time to come up with some of those line of code, not to mention many messages!  Thanks again for the help.  (But still miss Q&A printing, maybe what we need is a programing wizard!)
  
Back to top
 
IP Logged
 
adammatthews
Member
*
Offline


No personal text

Posts: 4
Joined: Mar 15th, 2004
Re: Printing
Reply #16 - Mar 23rd, 2004 at 7:14pm
Print Post Print Post  
I'm the one who started this thread.  I've read all the posts and want to thank everyone who's participated, especiallly Hammer.   One point though, - although Sesame seems to address printing on forms, the scripting for those of us who are not particularly script saavy seems intensive.   Since the program designers of Sesame had the Q&A user population in mind when they designed the program, I wish they could have paralleled the simplicity of coordinate printing, perhaps as an option with the more precise scripting method.  Thanks again to all.
  
Back to top
 
IP Logged
 
Foster
Ex Member


Re: Printing
Reply #17 - Mar 23rd, 2004 at 7:50pm
Print Post Print Post  
Cheesy  I agree with adammatthews and am glad he asked the question to get the ball rolling.
  
Back to top
 
IP Logged