[Solved] Print multiple copies dBase

Discuss the database features

[Solved] Print multiple copies dBase

Postby christos73 » Sat Jan 20, 2018 9:39 pm

Hello,

I've installed Invoice_Forms_v2.odb from:
[Example] Invoice Forms (without macros)

and i need to print 2 copies each time when i print. But without using the printer options (number of copies).

Thanks and bye!
Last edited by christos73 on Sun Jan 21, 2018 9:00 pm, edited 2 times in total.
Apache OpenOffice 4.1.5 - Win 7 Home - Macedonia is Greek
christos73
 
Posts: 4
Joined: Sat Jan 20, 2018 4:26 pm

Re: Print multiple copies dBase

Postby Villeroy » Sat Jan 20, 2018 11:35 pm

print 2 copies of what?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24957
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Print multiple copies dBase

Postby christos73 » Sat Jan 20, 2018 11:41 pm

to be printed 2 times the same page.

maybe with macro(CopyCount) ?
Apache OpenOffice 4.1.5 - Win 7 Home - Macedonia is Greek
christos73
 
Posts: 4
Joined: Sat Jan 20, 2018 4:26 pm

Re: Print multiple copies dBase

Postby Villeroy » Sat Jan 20, 2018 11:48 pm

I don't know any macro "CopyCount". 2 times which page? What is a "page" in the database you have linked?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24957
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Print multiple copies dBase

Postby christos73 » Sat Jan 20, 2018 11:52 pm

I want to make a button in calc so when i press it 'll print my sheet 2 times without doing it manually from Print 'Number of copies"
Forcing it to print 2 copies with one click.
Apache OpenOffice 4.1.5 - Win 7 Home - Macedonia is Greek
christos73
 
Posts: 4
Joined: Sat Jan 20, 2018 4:26 pm

Re: Print multiple copies dBase

Postby Villeroy » Sun Jan 21, 2018 12:01 am

Import the record set in question 2 times into Calc.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24957
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Print multiple copies dBase

Postby UnklDonald418 » Sun Jan 21, 2018 12:38 am

Chapter 13 of Andrew Pitonyak's book “OpenOffice.org Macros Explained” includes a discussion of writing macro code to print Writer documents as well as Calc documents.
Chapter 5 of his download “Useful Macro Information” has a section named “Print Current Document”
both can be downloaded from
http://www.pitonyak.org/oo.php
You should also be aware that a Base form is actually a Writer document.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the subject line
Apache OpenOffice 4.1.4 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 645
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Print multiple copies dBase

Postby christos73 » Sun Jan 21, 2018 1:01 am

Found it.

Code: Select all   Expand viewCollapse view
REM  *****  BASIC  *****
Sub printDocOnce
   DIM oDoc   
   oDoc = ThisComponent

   REM Set backgroundImage-option to False
   DIM oSettings
   oSettings = oDoc.createInstance("com.sun.star.text.DocumentSettings")
  rem oSettings.PrintPageBackground = False

   REM Set printOptions
   DIM mPrintOpts(2) AS NEW com.sun.star.beans.PropertyValue
   mPrintOpts(0).Name = "CopyCount"
   mPrintOpts(0).Value = 1
   mPrintOpts(1).Name = "Collate"
   mPrintOpts(1).Value = True

   REM Print
   oDoc.Print(mPrintOpts())

   REM Set backgroundImage-option back to True
   rem oSettings.PrintPageBackground = True
   REM Do a 0-print to set the option   
   DIM mPrintOpts2(0) AS NEW com.sun.star.beans.PropertyValue
   mPrintOpts2(0).Name = "CopyCount"
   mPrintOpts2(0).Value = 0
   oDoc.Print(mPrintOpts2())
End Sub

Import the record set? how?
Apache OpenOffice 4.1.5 - Win 7 Home - Macedonia is Greek
christos73
 
Posts: 4
Joined: Sat Jan 20, 2018 4:26 pm


Return to Base

Who is online

Users browsing this forum: UnklDonald418 and 9 guests