Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Envelopes from print spec (Read 10199 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #15 - Apr 26th, 2005 at 5:02pm
Print Post Print Post  
Marc -

I appreciate the detailed explanation and do understand what you are saying.

I always try to reason things through in a logical sequence and am generally pretty good at it.

Here's the part that I don't undertand, though.  

(1) If I make the "Auto HP LaserJet 5 - Envelopes" the default printer, the printing is done on an envelope.  It would seem to me that would indicate that the Windows printer setup dialogue box is appropriately set up.   It would also seem that I should be able to omit both the PrintPagePaper and the PrintPageTray commands from the programming, since that information is contained in the Printer Setup.

(2) If in the Sesame programming I include "PrintPagePaper(30)" I get a printer message telling me to "load legal size paper."  That tells me two additional things:  (a)  The PrintPagePaper command is being recognized by my print driver and (b) "30" is either being misinterpreted or is simply not the correct code for my particular driver.

(3) If I make another printer (e.g. letter-size one sided) the default printer (which is set up for portrait printing), and use the AlternatePrinterCoding in Sesame, the text is printed in landscape (but, as I said before on letter-size paper).  This tells me, once again, that the AlternatePrinterCoding is being recognized and the page layout is being correctly applied in the AlternatePrinter setup dialogue.  

Why the envelope feeder is not being utilized is totally beyond my comprehension.

At this point, I feel that I must "give up" and leave envelopes set up as my default printer. Perhaps, when I get a new printer, it will "fix" the problem.

On the issue of using mass update to print multiple envelopes, I am having a problem with the coding to retrieve the set of records I want to print on.  I am so "weary" at this point, that I would really appreciate suggested sample programming to

(1) retireve a set of record based on a saved retrieve set

(2) sort the records based on a saved retrieve set

and

(3) print the retrieved, sorted record set (using my existing printspec coding to print the envelopes).

Thanks.


  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Envelopes from print spec
Reply #16 - Apr 26th, 2005 at 7:06pm
Print Post Print Post  
Quote:
Marc -

I appreciate the detailed explanation and do understand what you are saying.

I always try to reason things through in a logical sequence and am generally pretty good at it.

Here's the part that I don't undertand, though. 

(1) If I make the "Auto HP LaserJet 5 - Envelopes" the default printer, the printing is done on an envelope.  It would seem to me that would indicate that the Windows printer setup dialogue box is appropriately set up.   It would also seem that I should be able to omit both the PrintPagePaper and the PrintPageTray commands from the programming, since that information is contained in the Printer Setup.

As I mentioned before, there are two settings. Which of the two that is being used depends on whether the print dialog is being made visible while creating the graphics context. If one is correct that will allow appropriate behavior under some (usuallu only microsoft) applications. Any application that, by default, does not display the print dialog will need the other setting. It is best to make sure that both agree.

Quote:
(2) If in the Sesame programming I include "PrintPagePaper(30)" I get a printer message telling me to "load legal size paper."  That tells me two additional things:  (a)  The PrintPagePaper command is being recognized by my print driver and (b) "30" is either being misinterpreted or is simply not the correct code for my particular driver.

Again, as I said, it depends on whether the printer agrees with MS as to what paper is in which tray.

Quote:
(3) If I make another printer (e.g. letter-size one sided) the default printer (which is set up for portrait printing), and use the AlternatePrinterCoding in Sesame, the text is printed in landscape (but, as I said before on letter-size paper).  This tells me, once again, that the AlternatePrinterCoding is being recognized and the page layout is being correctly applied in the AlternatePrinter setup dialogue. 

Depends on the *default* settings - which are different, parallel, and identical to the "regular" settings.

Quote:
Why the envelope feeder is not being utilized is totally beyond my comprehension.

See above.
Quote:
At this point, I feel that I must "give up" and leave envelopes set up as my default printer. Perhaps, when I get a new printer, it will "fix" the problem.


Not if the condition is reestablished. This is most likely a difference between the two separate settings - the regular settings and the default settings. Those things that print without the system's dialog box appearing use the default settings.

Quote:
On the issue of using mass update to print multiple envelopes, I am having a problem with the coding to retrieve the set of records I want to print on.  I am so "weary" at this point, that I would really appreciate suggested sample programming to

(1) retireve a set of record based on a saved retrieve set

Use LoadRetrieveSpec or set a retrieve spec as the default.
Quote:
(2) sort the records based on a saved retrieve set

LoadSortSpec and a SelectTreeItem call - or use the default spec setting.
Quote:
and

(3) print the retrieved, sorted record set (using my existing printspec coding to print the envelopes).

Simply place the code, pretty much as is in the Mass Update spec for any LE.
Quote:
Thanks.

You're welcome.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #17 - Apr 27th, 2005 at 2:07pm
Print Post Print Post  
Mark -

I am trying to write code to retrieve and sort records in preparation for running a mass update to print envelopes ... and I'm trying to take it a step at a time.

So, for right now, I am simply trying to retrieve the appropriate records in sorted order.

Here is the code I have on my command button:

Code
Select All
var saverecord as Int
var loadretrieve as Int
var doretrieve as Int
var loadsort as Int
var dosort as Int



saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")

loadretrieve = @LoadRetrieveSpec("Paid Subscribers - People Who have paid for a subscription to the Middle Villager Newsletter")

doretrieve = @selecttreeitem("Search Menu!Search Commands!Retrieve New Results (F10)")

loadsort =
@LoadSortSpec("Alphabetical By Last Name")


dosort = @selecttreeitem("Search Menu!Search Commands!Sort")

If not @Askuser("You are about to print","(several hundred) envelopes","Do you want to do this?") Then
STOP



STOP

AlternateDefaultPrinter("Envelopes")
PrintPagePaper(20)
Newpage(950,412)
PrintString("Herbert Teicher", 30, 25, 0, "Arial", 14, 0)
PrintString("26 McDonald Street", 30, @PageExtentY(), 0, "Arial", 14, 0)
PrintString("Staten Island, NY  10314-5055", 30, @PageExtentY(), 0, "Arial", 14, 0)

PrintString(Mail Name, 450, 200, 0, "BArial", 16, 0)
PrintString(Street Address + " " + Apt, 450, @PageExtentY(), 0, "BArial", 16, 0)
PrintString(City + ", " + State + "  " + Zip, 450, @PageExtentY(), 0, "BArial", 16, 0)

PrintString("Thanks for supporting The Middle Villager Newsletter", 30, 355, 0, "IArial", 12, 0)

FinishPage()

 



I know that the print code has to be moved to the mass update spec; however, I would think that the code should work up to the STOP point.  

In other words I expect to get the appropriate retrieved set of records in sorted order, before being asked whether to continue.    

Instead, I still have all the records in the database as they were when I opened the application.

Also, in the "Ask User" box, can I include the actual number of records in the retrieved record set - and, if so, how?

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
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: Envelopes from print spec
Reply #18 - Apr 27th, 2005 at 2:27pm
Print Post Print Post  
Hello Spencer,

I believe you need the following line in your code after the SelectTreeItem that saves the record.

@SelectTreeItem("Search Update Menu!Search (F7)")

@ResultSetTotal() will return the number of records in the result set so

Code
Select All
If @Askuser("You are about to print", @ResultSetTotal() + " envelopes","Do you want to do this?") Then
{
//Run Mass Update
} 



-Ray
  

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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #19 - Apr 27th, 2005 at 2:41pm
Print Post Print Post  
Ray -

Just tested the programming you suggested and it is perfect.  It tells me the number of records retrieved.  Thank you, thank you!

The problem I am still having, however, is that it is not retrieving the records I want.  Do you see anything wrong with my code for retrieving (and sorting) a record set?

Thanks
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
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: Envelopes from print spec
Reply #20 - Apr 27th, 2005 at 2:50pm
Print Post Print Post  
Spencer,

Is it retrieving all the records, no records, some of the records but not the right ones?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
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: Envelopes from print spec
Reply #21 - Apr 27th, 2005 at 3:00pm
Print Post Print Post  
Spencer,

I see a problem with the sort. In the order that you have it

Code
Select All
dosort = @selecttreeitem("Search Menu!Search Commands!Sort") 



should be

Code
Select All
dosort = @SelectTreeItem("Search Update Menu!Results Commands!Sort") 



-Ray
  

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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #22 - Apr 27th, 2005 at 3:01pm
Print Post Print Post  
Ray -

When the application is started, I automatically retrieve all records sorted alphabetically by last name.  There are 1866 records in all.

When I use press the command button, the record set remains unchanged with 1866 records still there.

I assume therefore, that it is not completing the retrieve function.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
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: Envelopes from print spec
Reply #23 - Apr 27th, 2005 at 3:05pm
Print Post Print Post  
Spencer,

Does the screen flash like it goes back to the retrieve spec?

One way to find out is open your application and go to the 6th record, any number would work other than the first.
Click the Button
Are you still on the same record?

If you are then you are not returning to the retrieve spec.
If you are not then the Retrieve spec is not loading properly. Check the name of the spec.

-Ray
  

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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #24 - Apr 27th, 2005 at 3:16pm
Print Post Print Post  
Ray -

I am so glad that I have you.   lol  You are great.

I tried it again from the 6th record and nothing happened.  The problem was with the name of my retrieve spec.  I was typing the entire name the way I saw it in the spec navigator.

However,  the actual name was simply "Paid Subscribers."  (The rest of it probably came from a "description" of the spec).    I just tried it and it worked like a charm.

I did not yet try the sort with the change you told me to make.  The records were already in alphabetical order, so it appeared right.   I will play with that, too, by first changing the sort order and then see if it is changed to the way I want it.  I think I should be able to do that on my own.

Thanks again for helping me through this.
« Last Edit: Apr 27th, 2005 at 10:56pm by SpencerWulwick »  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #25 - Apr 27th, 2005 at 11:31pm
Print Post Print Post  
Ray, et. al. -

I am still having problems with my command button for retrieving a record set and sorting it (although i am happy to say that I am making great progress and am very much encouraged).

First, I would like to point out (just in case it is not self evident) that the reason for all the "save record" commands is that when a record has a date of birth, the age is automatically recalculated, on form entry.  In order to ensure that I don't get the "sometimes" message that "my record has changed but not yet been saved," I included the "save" command to preclude the possibility.

Here is the code I am presently using:

Code
Select All
var saverecord as Int
var loadretrieve as Int
var doretrieve as Int
var loadsort as Int
var dosort as Int

saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")

loadretrieve = @LoadRetrieveSpec("Paid Subscribers")

saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")

doretrieve = @selecttreeitem("Search Menu!Search Commands!Retrieve New Results (F10)")

saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")

loadsort = @LoadSortSpec("Alphabetical By Last Name")

saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")

dosort = @SelectTreeItem("Search Update Menu!Results Commands!Sort")

If @Askuser("You are about to print", @ResultSetTotal() + " envelopes","Do you want to do this?") Then
{
//Run Mass Update
}

STOP

AlternateDefaultPrinter("Envelopes")
PrintPagePaper(20)
Newpage(950,412)
PrintString("Herbert Teicher", 30, 25, 0, "Arial", 14, 0)
PrintString("26 McDonald Street", 30, @PageExtentY(), 0, "Arial", 14, 0)
PrintString("Staten Island, NY  10314-5055", 30, @PageExtentY(), 0, "Arial", 14, 0)

PrintString(Mail Name, 450, 200, 0, "BArial", 16, 0)
PrintString(Street Address + " " + Apt, 450, @PageExtentY(), 0, "BArial", 16, 0)
PrintString(City + ", " + State + "  " + Zip, 450, @PageExtentY(), 0, "BArial", 16, 0)

PrintString("Thanks for supporting The Middle Villager Newsletter", 30, 355, 0, "IArial", 12, 0)

FinishPage()

 



I am having a couple of problems with the retrieve/sort spec.

1) When I press the command button, the appropriate record set is retrieved, however it is not properly sorted.  That's my first problem.  (I am presented - at this point - with the ask user message telling me the number of envelopes I am about to print and asking if I want to continue).

2) If I click "yes" on the askuser box and then  click on the command button a second time, I am presented with the askuser box yet a second time, asking if I want to contnue.    By clicking on the command button a second time, the records are then properly sorted.

It seemed to me that perhaps my statements were "out-of-order" so I tried a couple of variations, with no success.

I am eager to get to the actual "print" (mass update) command and would appreciate additional help.

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
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: Envelopes from print spec
Reply #26 - Apr 28th, 2005 at 2:55pm
Print Post Print Post  
Hello Spencer,

The order looks fine to me, Looks like the order I have from the application I built yesterday to look at this. Try this code see if it gives you different results.

Code
Select All
Var SaveRecord as Int
Var LoadRetrieve as Int
Var DoRetrieve as Int
Var LoadSort as Int
Var vReturn as Int

SaveRecord = @SelectTreeItem("Search Update Menu!Navigation!Save Record")

vReturn  = @SelectTreeItem("Search Update Menu!Search (F7)")

LoadSort = @LoadSortSpec("Alphabetical By Last Name")

LoadRetrieve = @LoadRetrieveSpec("Paid Subscribers")

DoRetrieve = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)") 



-Ray
  

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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #27 - Apr 29th, 2005 at 1:54am
Print Post Print Post  
Ray -

I'm still struggling along with my little project that I had thought would be much easier for me to accomplish.  But, as I said before, I am making progress.

I tried the new code you provided and that seems to work better. 

I am left with two issues.  First, here's the code I am currently using on the command button:

Code
Select All
Var SaveRecord as Int
Var vReturn as Int
Var LoadSort as Int
Var LoadRetrieve as Int
Var DoRetrieve as Int

SaveRecord = @SelectTreeItem("Search Update Menu!Navigation!Save Record")

vReturn  = @SelectTreeItem("Search Update Menu!Search (F7)")

LoadSort = @LoadSortSpec("Alphabetical By Last Name")

LoadRetrieve = @LoadRetrieveSpec("Paid Subscribers")

DoRetrieve = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")

If @Askuser("You are about to print", @ResultSetTotal() + " envelopes","Do you want to do this?") Then

{
AlternateDefaultPrinter("Envelopes")
PrintPagePaper(20)
Newpage(950,412)
PrintString("Herbert Teicher", 30, 25, 0, "Arial", 14, 0)
PrintString("26 McDonald Street", 30, @PageExtentY(), 0, "Arial", 14, 0)
PrintString("Staten Island, NY  10314-5055", 30, @PageExtentY(), 0, "Arial", 14, 0)

PrintString(Mail Name, 450, 200, 0, "BArial", 16, 0)
PrintString(Street Address + " " + Apt, 450, @PageExtentY(), 0, "BArial", 16, 0)
PrintString(City + ", " + State + "  " + Zip, 450, @PageExtentY(), 0, "BArial", 16, 0)

PrintString("Thanks for supporting The Middle Villager Newsletter", 30, 355, 0, "IArial", 12, 0)

FinishPage()
 



I know that this won't print all the envelopes, but I thought it would print an envelope for the first record in the set; it doesn't.

Also, I thought that the mass update would be more straight-forward with something like: RunMassUpdate("Pint Envelopes") but, unfortunately, it doesn't seem to be.

I have checked everything I could find on Mass Update in both the Programming Guide and the User's Guide but just can't seem to get the gist of what I need to do.  I have created and named a Mass Update Spec in the Global Code of the form.  Am I supposed to write code to "load" it and then SelectTreeItem() to run it?  If so, how do I tell it that I want it to continue without input from the user?

If I could resolve these last two issues, I should be able to complete this phase of my application.  (Actually, my first question isn't germain to the task; however, it would help me to understand why it doesn't work for the first envelope).

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Envelopes from print spec
Reply #28 - May 2nd, 2005 at 12:49am
Print Post Print Post  
This might be a solution to your last two items:

I would suggest that you record a macro to "MassUpdateUnattended", which calls the Mass Update from the Tree and presses Continue to allow non intervention by the user.

Now in your program, load the Mass Update Spec, then call the macro.

Do not include the loading of the Mass Update spec in the macro, just the call for execution and Continue button.  This will alllow you to have a "generic" Mass Update macro that you can call with any Mass Update Spec.
« Last Edit: May 2nd, 2005 at 3:14am by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Envelopes from print spec
Reply #29 - May 8th, 2005 at 5:45pm
Print Post Print Post  
Ray -

I responded to a similar discussion on another thread but am repeating a question previously asked that has not been answered, with regard to the following code:

Code
Select All
Var SaveRecord as Int  
Var vReturn as Int
Var LoadSort as Int
Var LoadRetrieve as Int  
Var DoRetrieve as Int  
  
SaveRecord = @SelectTreeItem("Search Update Menu!Navigation!Save Record")  
  
vReturn  = @SelectTreeItem("Search Update Menu!Search (F7)")  
  
LoadSort = @LoadSortSpec("Alphabetical By Last Name")  
  
LoadRetrieve = @LoadRetrieveSpec("Paid Subscribers")  
  
DoRetrieve = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")  

If @Askuser("You are about to print", @ResultSetTotal() + " envelopes","Do you want to do this?") Then  
  
{
AlternateDefaultPrinter("Envelopes")
PrintPagePaper(20)  
Newpage(950,412)  
PrintString("Herbert Teicher", 30, 25, 0, "Arial", 14, 0)  
PrintString("26 McDonald Street", 30, @PageExtentY(), 0, "Arial", 14, 0)  
PrintString("Staten Island, NY  10314-5055", 30, @PageExtentY(), 0, "Arial", 14, 0)  
  
PrintString(Mail Name, 450, 200, 0, "BArial", 16, 0)  
PrintString(Street Address + " " + Apt, 450, @PageExtentY(), 0, "BArial", 16, 0)  
PrintString(City + ", " + State + "  " + Zip, 450, @PageExtentY(), 0, "BArial", 16, 0)  

PrintString("Thanks for supporting The Middle Villager Newsletter", 30, 355, 0, "IArial", 12, 0)
  
FinishPage()   



I know that this won't print all the envelopes, but I thought it would print an envelope for the first record in the set; it doesn't. Can you see any reason why it wouldn't print one envelope?

While playing with recording a macro to run the mass update, I discovered that while I had RECORDING ON, I as NOT asked whether I wanted user intervention.  I am assuming, therefore, that when the progamming is run, that additional user input would  NOT be required.  Do you know whether my assumption is correct?

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print