[Solved] Printing Documents Via mmservice - copies wrong

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
kpassey
Posts: 22
Joined: Tue Apr 15, 2008 2:51 pm

[Solved] Printing Documents Via mmservice - copies wrong

Post by kpassey »

Hi,

I wrote a while back, a small java program to merge data from an AS400 database using ODBC which worked fine pre 2.4.

Basically the AS400 called this program in batch, passing the java program details of the document and the number of copies, printer name etc.The AS400 then calls the java program via RUNRMTCMD on a PC. Now I've upgraded to 2.4 I'm getting double the amount of copies I need printing unless of course the number is one..On the printer queue it states 2 copies but 4 get printed.

Anybody here see this - and most importantly solved it. I'm setting the number of copies on the mmservice property value.

Code: Select all

PropertyValue[] printOpts = new PropertyValue[1];

			printOpts[0] = new PropertyValue();
			printOpts[0].Name = "CopyCount";
			printOpts[0].Value = new Short((short) copies);

			oObjProps.setPropertyValue("DataSourceName", mSource);
			oObjProps.setPropertyValue("ActiveConnection", xConnection);
			oObjProps.setPropertyValue("Command", mQRY);
			oObjProps.setPropertyValue("CommandType", new Integer(
					com.sun.star.sdb.CommandType.QUERY));
			oObjProps.setPropertyValue("OutputType", new Short(
					com.sun.star.text.MailMergeType.PRINTER));
			oObjProps.setPropertyValue("DocumentURL", loadUrl);
			oObjProps.setPropertyValue("PrintOptions", printOpts);
Thanks

Kevin
Last edited by kpassey on Thu Sep 18, 2008 12:16 pm, edited 1 time in total.
kpassey
Posts: 22
Joined: Tue Apr 15, 2008 2:51 pm

[SOLVED]Re: Printing Documents Via mmservice - copies wrong

Post by kpassey »

Fixed as a bug in 3.0
Post Reply