Xojo Conferences
XDCMay2019MiamiUSA

Printing reports and labels (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: [we] any guide to what works on iOS devices?
Next thread: Video Streaming in Linux


Re: OS X close confirmation save dialog   -   Garth Hjelte
  Printing reports and labels   -   Chris Ruprecht
   Re: Printing reports and labels   -   Chris Ruprecht
   Re: Printing reports and labels   -   Norman Palardy
   Re: Printing reports and labels   -   Chris Ruprecht
   Re: Printing reports and labels   -   Dan Paymar
   Re: Printing reports and labels   -   Norman Palardy
   Re: Printing reports and labels   -   Norman Palardy
    Re: Printing reports and labels   -   Dan Paymar

Printing reports and labels
Date: 01.08.12 20:38 (Wed, 1 Aug 2012 15:38:01 -0400)
From: Chris Ruprecht
Hello guys,

I'm working on a database driven application and I have reached the stage where I need to print labels and such.
If the labels were one label per row, life would be easy, but they aren't. I have two or three labels, depending on the report, across the page.

So far, I have looked at the "Printing" examples that come with RB (I'm using 2011r3) and those examples aren't what I'm looking for. I'd like to use "RBReport" but I don't know how to go about it when I need to populate the report fields.
Say, I do a "select name, address, city, zip, state from customer where ...". Now I need to put the first customer into the fields of the first label, the second into the fields to the right and so on.
Does anybody have an example of that somewhere?

Thanks.

best regards,
chris

Re: Printing reports and labels
Date: 02.08.12 03:48 (Wed, 1 Aug 2012 22:48:00 -0400)
From: Chris Ruprecht
And next you're telling me you want thumbnail images of company logos and 90° anti-clockwise rotated text on the left and right edge of the labels ... man, life with an Epson MX-80 was easy ... ;).

best regards,
chris
-

Re: Printing reports and labels
Date: 01.08.12 22:14 (Wed, 1 Aug 2012 15:14:36 -0600)
From: Norman Palardy

On 2012-08-01, at 2:55 PM, Chris Ruprecht wrote:

> Thanks Dan,
>
> yes, this brings back memories from way back when I was sending stuff to dot matrix printers ;).
> Let me play with this and see if I can produce "pretty" labels for the client.
>
> best regards,
> chris
> --
> chris ruprecht
> database grunt and bit pusher extraordinaíre

Just remember to scale things appropriately given the printers actual resolution
And if folks want the first line big & bold and th others in some other font etc

:P
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Printing reports and labels
Date: 01.08.12 21:55 (Wed, 1 Aug 2012 16:55:21 -0400)
From: Chris Ruprecht
Thanks Dan,

yes, this brings back memories from way back when I was sending stuff to dot matrix printers ;).
Let me play with this and see if I can produce "pretty" labels for the client.

best regards,
chris

Re: Printing reports and labels
Date: 01.08.12 20:43 (Wed, 01 Aug 2012 13:43:57 -0600)
From: Dan Paymar
Take a look at my code below.
Dan Paymar

On 8/1/12 1:38 PM, Chris Ruprecht wrote:
> Hello guys,
>
> I'm working on a database driven application and I have reached the stage where I need to print labels and such.
> If the labels were one label per row, life would be easy, but they aren't. I have two or three labels, depending on the report, across the page.
>
> So far, I have looked at the "Printing" examples that come with RB (I'm using 2011r3) and those examples aren't what I'm looking for. I'd like to use "RBReport" but I don't know how to go about it when I need to populate the report fields.
> Say, I do a "select name, address, city, zip, state from customer where ...". Now I need to put the first customer into the fields of the first label, the second into the fields to the right and so on.
> Does anybody have an example of that somewhere?
>
> Thanks.
>
> best regards,
> chris

' Print the label or labels

' Parameters:
' Size: 1 = 4x1, 2 = 4x2
' SLP: Starting label position (1 - 10 or 1 - 20)
' n: Entry number of one label, or -1 to print labels for marked entries

dim s as string
dim g as graphics
dim p, h, v, x as integer
dim LabelNumber, LabelsPerPage as integer

LabelsPerPage = 20 / Size
LabelNumber = SLP - 1 ' Current label position, origin 0

g = OpenPrinterDialog ' Allow user to select the printer
if g = nil then
beep
MsgBox "Couldn't open printer dialog"
return
end

g.TextFont = "Ariel"
g.TextSize = 14
'g.Bold = true

if n < 0 then ' Printing labels for marked records?

for x = 0 to MainWindow.CustomerList.ListCount - 1 ' yes
if MainWindow.CustomerList.cell( x, 6 ) = "*" then ' Marked record?
s = MainWindow.GetAddress( x ) ' yes, get the name and address
p = LabelNumber mod 2 ' Horizontal position ( 0=Left, 1=Right )
h = p * 4.2 * 72 + 20 ' Horizontal offset from left edge of sheet
p = LabelNumber / 2 ' Vertical position ( 0-4 or 0-9 )
v = p * Size * 72 + VerticalOffset ' Vertical offset down from top of sheet
g.DrawString s, h, v
LabelNumber = LabelNumber + 1
if LabelNumber >= LabelsPerPage then ' Page full?
LabelNumber = 0 ' yes, start a new page
g.NextPage
end
end
next x

else ' Printing a single label for CustomerList entry n

s = MainWindow.GetAddress( n ) ' Print a label for this customer
p = LabelNumber mod 2 ' Horizontal position ( 0=Left, 1=Right )
h = p * 4.2 * 72 + 20 ' Horizontal offset
p = LabelNumber / 2 ' Vertical position ( 0-4 or 0-9 )
v = p * Size * 72 + 40 ' Vertical offset
g.DrawString s, h, v

end


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Printing reports and labels
Date: 02.08.12 20:03 (Thu, 2 Aug 2012 13:03:32 -0600)
From: Norman Palardy

On 2012-08-02, at 12:35 PM, Dan Paymar wrote:

> The implication seems to be that with my code the labels will be printed at 72 dpi resolution. Nope, they're printed at 300/1200 dpi (the printer's inherit resolution). Perhaps because my HP printers (one LaserJet, one inkjet) have many fonts built in.
>
The implication is that your code doesn't seem to make any adjustments to how it does things if the printer reports 300 x 300 or 600 x 600.
In fact you seem to have hard coded the Size * 72 (which I assume is DPI).
If you use built in fonts then it _may_ result in nice clear output on that device but it may not on a different one.

There is a way to get nice clear output on pretty much any device

Norman Palardy



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Printing reports and labels
Date: 02.08.12 15:48 (Thu, 2 Aug 2012 08:48:22 -0600)
From: Norman Palardy

On 2012-08-01, at 8:48 PM, Chris Ruprecht wrote:

> And next you're telling me you want thumbnail images of company logos and 90° anti-clockwise rotated text on the left and right edge of the labels ... man, life with an Epson MX-80 was easy ... ;).
>
> best regards,
> chris
> --
> chris ruprecht
> database grunt and bit pusher extraordinaíre

The biggest thing will be the proper handling of the printer resolution so you dont end up with fuzzy output

After that it's all feature requests :P

Norman Palardy



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Printing reports and labels
Date: 02.08.12 19:35 (Thu, 02 Aug 2012 12:35:09 -0600)
From: Dan Paymar

On 8/2/12 8:48 AM, Norman Palardy wrote:
> On 2012-08-01, at 8:48 PM, Chris Ruprecht wrote:
>
>> And next you're telling me you want thumbnail images of company logos and 90° anti-clockwise rotated text on the left and right edge of the labels ... man, life with an Epson MX-80 was easy ... ;).
>>
>> best regards,
>> chris
>> --
>> chris ruprecht
>> database grunt and bit pusher extraordinaíre
> The biggest thing will be the proper handling of the printer resolution so you dont end up with fuzzy output
>
> After that it's all feature requests :P
>
> Norman Palardy

The implication seems to be that with my code the labels will be printed
at 72 dpi resolution. Nope, they're printed at 300/1200 dpi (the
printer's inherit resolution). Perhaps because my HP printers (one
LaserJet, one inkjet) have many fonts built in.

Dan Paymar

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>