Hot Topic (More than 10 Replies) Printout problem (Read 4219 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Printout problem
Nov 1st, 2007 at 2:19pm
Print Post Print Post  
My Workorders and Invoices use the @ symbol in text strings for noting price rates, for example: "1 Rigger, 3 hours @ $64.00 per hour, Uncrating"

However, on my printouts, everything after the @ symbol is not being printed.  Have I done something wrong with my PrintString command or is there special programming I need to put in place to make this work?
  

**
Captain Infinity
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: Printout problem
Reply #1 - Nov 1st, 2007 at 2:55pm
Print Post Print Post  
You have to use @Replace() to replace a single @ with @@.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #2 - Nov 1st, 2007 at 3:04pm
Print Post Print Post  
OK, thanks.  Where should this be done, when the string is first generated or just before it is printed?  If the former, I can easily do it in my programming when the different elements are put together to form the string (though I'd rather not have "@@" appear on the display, because I'm sure my users will be confused by it).  If the latter I'm afraid I'll need some further advice and hand-holding as it will be a wholesale overhaul of my print routine.  Which I don't mind, but I will need help.
  

**
Captain Infinity
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: Printout problem
Reply #3 - Nov 1st, 2007 at 3:18pm
Print Post Print Post  
You could do either of those but I would recommend the later, and don't worry I'm here if you need a hand.

-Ray
  

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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #4 - Nov 1st, 2007 at 3:25pm
Print Post Print Post  
Another recommendation: Write a function for this. That way, if you need to add or adjust what special characters need attention, you can do so in one place and all your PrintString code will fall into line automatically.

Code
Select All
FUNCTION CleanPrintData(vIn as String) as String
var vRet as String

    vRet = vIn
    vRet = @Replace(vRet, "@", "@@")
    // Do any other stuff you need to do
    Return vRet

END FUNCTION

PrintString(CleanPrintData(PriceRate1), 100, 200, 0, "BArial", 33, 0)
PrintString(CleanPrintData(PriceRate2), 100, 250, 0, "BArial", 33, 0)
PrintString(CleanPrintData(PriceRate3), 100, 300, 0, "BArial", 33, 0)
 

  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #5 - Nov 1st, 2007 at 3:41pm
Print Post Print Post  
Are there any other characters I'll need to replace?
  

**
Captain Infinity
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: Printout problem
Reply #6 - Nov 1st, 2007 at 4:25pm
Print Post Print Post  
Not that I know of.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #7 - Nov 1st, 2007 at 7:09pm
Print Post Print Post  
Can @Replace be used within the Printstring command, to alter the value of the element being printed?  That is, can
Code
Select All
Printstring(Laborer_1, 335, vPosY + 375, 0, vFont, vSize, 0) 


become
Code
Select All
Printstring(@Replace(Laborer_1, "@", "@@), 335, vPosY + 375, 0, vFont, vSize, 0) 


?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #8 - Nov 1st, 2007 at 7:46pm
Print Post Print Post  
Infinity wrote on Nov 1st, 2007 at 7:09pm:
Can @Replace be used within the Printstring command, to alter the value of the element being printed?

Yes, but the way I showed you will make your life much easier in the long run than embedding this in each of your PrintString calls. Up to you though.  Smiley
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #9 - Nov 1st, 2007 at 7:54pm
Print Post Print Post  
Sorry Erika, I didn't see your earlier reply.  Thanks, I'll give it a try.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #10 - Nov 1st, 2007 at 8:34pm
Print Post Print Post  
I'm having partial success, and am very confused by what I am seeing.

Here is one of my current print routines:

Code
Select All
Var vWillItFit as Int
Var vTextToPrint as String
Var vMaxWidth as Int
Var vLen as Int
Var vWidth as Int

// Prints the Pickup Company name
vWillItFit = 0
vTextToPrint = CleanPrintData(Pickup_Company)
vLen = @Len(vTextToPrint)
vMaxWidth = 300 //This is the Max printed width
While((vWillItFit = 0) And (vLen > 0))
{
	Printstring(vTextToPrint, 0, 0, 0, vFont, vSize, 1)
	If @PageExtentX() <= vMaxWidth Then
	{
		vWillItFit = 1
	}
	Else
	{
		vLen = vLen - 1
		vTextToPrint = @Left(vTextToPrint, vLen)
	}
}
Printstring(vTextToPrint, 160, vPosY + 255, 0, vFont, vSize, 0) 



When the value stored in Pickup_Company is "Company @ Name", the printout is "Company".

When the value stored in Pickup_Company is "@ Name", the printout is "@ Name".

???
  

**
Captain Infinity
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: Printout problem
Reply #11 - Nov 1st, 2007 at 9:30pm
Print Post Print Post  
Hello Scott,

I see what you are seeing here. I think it has to do with a problem in an underlying library and the @ symbol. I'll pass it on to development.

In the meantime what you can do is change that function Erika gave you to

Code
Select All
FUNCTION CleanPrintData(vIn as String) as String
var vRet as String

    vRet = vIn
    vRet = @Replace(vRet, " @ ", " at ")
    // Do any other stuff you need to do
    Return vRet

END FUNCTION 



-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #12 - Nov 1st, 2007 at 10:19pm
Print Post Print Post  
Thanks Ray.  Whew, am I relieved!  I hate to hear that there's a bug in the program but I gotta tellya, this was driving me absolutely nuts this afternoon.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #13 - Nov 2nd, 2007 at 1:06am
Print Post Print Post  
Infinity wrote on Nov 1st, 2007 at 10:19pm:
Thanks Ray.  Whew, am I relieved!  I hate to hear that there's a bug in the program but I gotta tellya, this was driving me absolutely nuts this afternoon.

This one isn't even our program. It's one of the base libraries. Makes it extra fun to find.
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #14 - Nov 2nd, 2007 at 10:27am
Print Post Print Post  
Quote:
This one isn't even our program. It's one of the base libraries. Makes it extra fun to find.

I don't envy you that.  Make it fun; make it a contest.

While you're digging in there, is it possible to redesign PrintString() so that it can handle @ symbols without jumping through hoops (to coin a phrase)?  Seems like just about everybody will need to print the symbol at some point, what with email addresses being so ubiquitous.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #15 - Nov 2nd, 2007 at 11:20am
Print Post Print Post  
Infinity wrote on Nov 2nd, 2007 at 10:27am:
While you're digging in there, is it possible to redesign PrintString() so that it can handle @ symbols without jumping through hoops (to coin a phrase)?  Seems like just about everybody will need to print the symbol at some point, what with email addresses being so ubiquitous.


I'm not sure, but that's actually why I suggested you make the cleaner a function. So that, if we do manage that, you can comment out the one @Replace rather than having to chase it through all your PrintString statements.
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #16 - Nov 2nd, 2007 at 11:34am
Print Post Print Post  
Thanks.  I am using the Function and it is working well, replacing "@" with "at".  Which is fine for my Invoice printouts where they break out rates ("1 hour at $57.00", for example), but will not work for email addresses (which I'm not currently having to print, but I'm sure I will someday).
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #17 - Nov 2nd, 2007 at 11:59am
Print Post Print Post  
Quote:
Hello Scott,
I see what you are seeing here. I think it has to do with a problem in an underlying library and the @ symbol. I'll pass it on to development.


It's funny, but before I started using the function, I was hard coding @replace() statements into my Invoice printout, using a variable.  I.E.:
Code
Select All
Var vNewString as String

// Prints the job description
vNewString = @Replace(Desc_line_1, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 15), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_2, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 35), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_3, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 55), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_4, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 75), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_5, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 95), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_6, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 115), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_7, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 135), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_8, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 155), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_9, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 175), 0, vFont, vSize, 0) 


And this was working (and is still working) for every line on my Invoice except the top portion, where I print the Company Name, Address, Contact, P.O. Number, etc.  When I tried it in in my Workorders, it worked for all the details of the Delivery customer, but none of the Pickup customer, which is strange because it's exactly the same data coming from different but identical elements.  The problem seems to be randomly, eccentrically selective.

As it stands now, I'm using the function to replace "@" with "at" everywhere on my Workorder, and on the top section of my Invoice.  The bottom section of my Invoice has the hard coding you see above (replacing "@" with "@@") and is happily printing the @ symbol on every line that shows a "description @ rate" string.  It's perverse, but it's working.

Let me know if you'd like to see the code, maybe it will help with your investigation.

  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Printout problem
Reply #18 - Nov 2nd, 2007 at 12:06pm
Print Post Print Post  
Scott,

Whether the problem manifests seems to be related to the width of the value against the width of the "box" it prints inside. Some values with @ will print fine just by doubling the @. Others will not. We have not yet tracked down the exact circumstances that cause failure.

This can be seen in other places than PrintString. For example, a static text element containing @@ will show this behavior if resized just so.
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #19 - Nov 2nd, 2007 at 12:12pm
Print Post Print Post  
Ah, I see, that makes sense.  In general, it's working for every string I do not limit width, and failing for the ones I do.  Good to know, thanks.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #20 - Nov 2nd, 2007 at 12:34pm
Print Post Print Post  
A related question....  I just tried an experiment with a record that has a long value on a line whose width I do not regulate (80 characters) to see if its length would cause an embedded "@" symbol to make it truncate.  The whole thing printed but, curiously, the line wrapped at just shy of 7 inches from the left margin, and I can't figure out why.  Visually, I have another inch or more for the line to print on before wrapping.  The code for the printstring is:
Code
Select All
vNewString = @Replace(Desc_line_1, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 15), 0, vFont, vSize, 0) 


vNewString is a String variable.  The other variables are:
vPosY1 = 330 (330 from the top of the form)
vFont = "Sans Serif"
vSize = 16
and my page is set up as
Code
Select All
NewPage(850,1100)
PrintPageMargin(0, 0, 18, 0) 


What am I overlooking?
  

**
Captain Infinity
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: Printout problem
Reply #21 - Nov 6th, 2007 at 6:20pm
Print Post Print Post  
Scott,

You're not overlooking anything. It's related to the the same problem as the text not appearing if it has a @ in it.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #22 - Sep 7th, 2011 at 1:50pm
Print Post Print Post  
I apologize for resurrecting such an old topic, but this issue popped up for me again, when one of my dispatchers placed an @ symbol in a line of text that usually would not contain such a symbol.  My current programming for printing this section is:
Code
Select All
// Prints the job description
vNewString = @Replace(Desc_line_1, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 15), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_2, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 35), 0, vFont, vSize, 0)
vNewString = @Replace(Desc_line_3, "@", "@@")
PrintString(vNewString, 20, (vPosY1 + 55), 0, vFont, vSize, 0)
.... 



This has been working well so far because most of the lines in the "Description" section are short, and generally everything fits.  But one line of her's was long, and the @ symbol made it wrap the last inch and a half onto the next line (even though there's space available on the line it's supposed to be on) which overwrote text on that next line.

Anyway, long story, but my question is, has Development been able to tackle this issue in the latest releases?  I'm using Sesame Version 2.0.6 right now.
  

**
Captain Infinity
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: Printout problem
Reply #23 - Sep 7th, 2011 at 5:58pm
Print Post Print Post  
Hello Scott,

Looking in the change log I see an entry for 2.5.2 that says

Quote:
Fix to allow @@ to be printed using PrintString without affecting wrapping.


So I believe this one should be fixed.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Printout problem
Reply #24 - Sep 10th, 2011 at 11:27am
Print Post Print Post  
Thanks Ray!!
  

**
Captain Infinity
Back to top
IP Logged