cancel
Showing results for 
Search instead for 
Did you mean: 

Document printing SDK

Former Member
0 Kudos

Hi

Is it possible to print a range of documents via the SDK, analogously as in "sales - document printing"?

And if possible, can anyone give us some program-code how we can accomplish this?

Many thanks in advance,

Iris Spenninck

Accepted Solutions (0)

Answers (2)

Answers (2)

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Iris,

Currently the ability to capture the output of a print event is not available as far as the range of values chosen for the report and the report layout itself. This functionality will be available with the SAP Business One 2005 SDK where we will expose the "ReportLayoutService". Any custom reports for add-ons need to be created with an external report writer such a Crystal Reports, Cognos, etc.

Hope this helps,

Eddy

Former Member
0 Kudos

Eddy,

can you provide us with the documentation about ReportLayourService ? thanks

former_member185703
Active Contributor
0 Kudos

Hi,

SDK has no interface to support printing; you would have to use the APIs in Windows - or e.g. MFC for this "directly".

Regards,

Frank

Former Member
0 Kudos

Hi there,

If the SDK has no interface to support printing, how do I print after I had created a Delivery Order using SDK?

How do I use the APIs in Windows to get the print layout format I had specific in SBO Layout Designer?

Quite confusing... Cos SBO SDK allows us to create marketing document but don't allow us to print? Meaning if I create 100 Delivery Order using SDK, I had to go to the Delivery Order Screen to click 100 times to send for printing? Please help?

Former Member
0 Kudos

Hi,

I have the same problem, i solved in this manner (you need use ui api )

aplication.ActivateMenuItem("2053") 'open invoice form

Dim fo As SAPbouiCOM.Form

fo = aplication.Forms.ActiveForm

fo.Mode =SapbouiCOM.BoFormMode.fm_FIND_MODE 'activates find

fo.Items.Item("8").Specific.value = numfac

'numfac is the docentry you want to print

fo.Items.Item("1").Click() 'makes the search

aplication.Menus.Item("520").Activate() 'open printing dialog

fo.Items.Item("1").Click() 'close the invoice form

with this code you must press "print" in the printdialog

hope it helps you

Salvador Biot

Former Member
0 Kudos

hello Salvador,

above auto printing or developping the printing fnc, i need also advanced setup for printing an invoice.

i need the 'print preferences' screen with a subtable per document:

invoice =

1 print on printer 1 ... 2 times

2 print on printer 4 ... 1 time

3 print on Printer 5 drawer 2 ... 1 time

etc...

and more. so a mix from visual studio with window API reading the possible queues and need for the possible documents with their layout setup for each customer...

has someone an idee what to use ?

thanks

philippe h

Former Member
0 Kudos

Hello Salvador

I tried your code and the last three line would not work. Can you please give me some more examples?

Thank You

Former Member
0 Kudos

Hi

Laura what not work?

'fo' is your form, 'aplication' is your aplication object

fo.Items.Item("1").Click() 'makes the search

aplication.Menus.Item("520").Activate() 'open printing dialog

fo.Items.Item("1").Click() 'close the invoice form

tell me more

Thanks

Salvador Biot

Former Member
0 Kudos

Thank you for your help!

Once the Print Form is up, can I code the click of the print button?

Former Member
0 Kudos

You could try sending a keystroke with

SendKeys.Send("") The tricky part here is that the Print dialog might not be open yet when the Sendkeys.Send gets executed. A workaround that I have used successfully is to fill the keyboard buffer with meaningless keystrokes before invoking the dialog. Something like this: SendKeys.Send("{PGUP 100}") 'insert the line that kicks off the dialog here SendKeys.SendWait("") SendKeys.SendWait("")

HTH

Juha

Former Member
0 Kudos

Thank You for your help Juha,

I still am unable to make it work can you help?

             
applic.ActivateMenuItem ("2050") 'open invoice form
Dim fo As SAPbouiCOM.Form
Set fo = applic.Forms.ActiveForm
fo.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE 'activates find
fo.Items.Item("8").Specific.Value = sObjectCode
fo.Items.Item("1").Click  'makes the search
<b>SendKeys "{ENTER}", False
applic.ActivateMenuItem ("520")
'applic.Menus.Item("520").Activate 'open printing dialog
SendKeys "{ENTER}", True</b>             
fo.Items.Item("1").Click 'close the invoice form

Yes, I tried to change may true and false.

thank you again

Former Member
0 Kudos

Try this

1. Make sure that SendKeys refers to System.Windows.Forms

2. Modify your code

-- snip --

SendKeys.Send("{PGUP 100}")

applic.ActivateMenuItem ("520")

' You may try uncommenting the next line, too:

' System.Threading.Thread.Sleep(1000)

SendKeys.SendWait("")

SendKeys.SendWait("") applic.StatusBar.SetText(" was sent to keyboard. Is the 'Print' window active?",5,2)

-- snip --

HTH

Juha

HTH

Juha

Former Member
0 Kudos

Thank You!!!

I just realized that I need to:


SendKeys ("{TAB 100}")
SendKeys ("{ENTER 100}")
applic.ActivateMenuItem ("520") 'open printing dialog
SendKeys ("{TAB}"), True
SendKeys ("{ENTER}"), True

The PGUP was just choosing the Default Printer.

Thank You!!!