Print a specific layout of a print definition

Manuel Kuebler

How can I print a specific layout of a print definition.

Print Definition Code: U0000059
Layout Definition Code: U0000065

Paolo Manfrin

Hi Manuel,


do you mean print via a command via code?


 


If yes the solution is the command ExecutePrintDef.


See a sample below 


- first parameter: Print Definition name under PrintDef > Extended Definition > Name Id


- second parameter: true (means to identify the printDefinition by name and not by code)


- third parameter: type of the output (preview, pdf, print, etc...)


- all other parameters: sequence of key, value, key, value which means parameter name, parameter value, parameter name, parameter value, etc...


 


LayoutHelper.LayoutOpener.ExecutePrintDef("DRUCK_PDF_SalesOrder", true, LayoutHelper.LayoutOpener.OpenLayoutModes.PDF, "DocEntry", docEntry, "DocNum", docEntry, "CountryCode", countryCode);


 


In the forum if you search for "ExecutePrintDef" you will find other samples.


 


hth


paolo


Manuel Kuebler

Hi Paolo,

thanks for your answer.

I have a print definition with several layout definitions. I would like to print a specific layout definition of the print definition.

Paolo Manfrin

Hi Manuel,


a solution would be to create a new layoutdefinition with only one printdefinition and set it to INACTIVE.


With this trick the layoutdef will not show up when clicking print or preview but when you send the command via code it will print


 


hth


paol


0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post