Help with printer bin
Hi fellas: I use FR 4.7.61 (not official) and I have many trouble when I try print in different paper bin. I read all the post in this forum and many lots of them in the Internet...and no found solution for that.
Sincelery, I frustrated. My paper bin's are: (1) 259, (2) 260 and (3) 261 in the HP P2015dn.
I made it a small program in D2009 for test printing without FR and...works fine, changed the printer bin; but when I use FR with the same code not work, not change the paper bin.
#1 Question: FR can print in different bin's? [img]style_emoticons/<#EMO_DIR#>/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> #2 Question: If yes, how to do that?[/img][img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> #3 Question: FR give me back the happiness?[/img][img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> TIA berthauser[/img]
Sincelery, I frustrated. My paper bin's are: (1) 259, (2) 260 and (3) 261 in the HP P2015dn.
I made it a small program in D2009 for test printing without FR and...works fine, changed the printer bin; but when I use FR with the same code not work, not change the paper bin.
#1 Question: FR can print in different bin's? [img]style_emoticons/<#EMO_DIR#>/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> #2 Question: If yes, how to do that?[/img][img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> #3 Question: FR give me back the happiness?[/img][img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> TIA berthauser[/img]
Comments
Anyway, I found ONE solution...at least for me. This is:
#1. Add "frxPrinter" in your uses clauses
#2. If you got select printer and the paper bin, then
a. cb_Printers.Items := frxPrinters.Printers;
b. cb_PaperBin.Items := frxPrinters.Printer.Bins;
c. frxReport1.PrintOptions.Printer := cb_Printers.Text;
d. frxPrinters.PrinterIndex := frxPrinters.IndexOf(frxReport1.PrintOptions.Printer);
e. TfrxReportPage(frxReport1.Pages[1]).Bin := frxPrinters.Printer.BinNameToNumber(frxPrinters.Printer.Bins[cb_PaperBin.ItemIndex]);
f. TfrxReportPage(frxReport1.Pages[1]).BinOtherPages := TfrxReportPage(frxReport1.Pages[1]).Bin;
g. if frxReportPedido.PrepareReport then
frxReport1.Print;
frxReport1.Free;
#3. That's all
One more thing:
If you wish print directly, you can ignore the letters "a" thru "d" and replace ".....BinNameToNumber(frxPrinters.Printer.Bins[cb_PaperBin.ItemIndex])" for
"......Printer.BinNameToNumber(frxPrinters.Printer.Bins[4])" where "4" is the value what represent the index of paper bin loaded in the combobox;
Of course, you can write all values in a INI file and then load it....etc.
Thanks for "all" and Mr. Gordk and for Sven in the "http://www.delphipraxis.net/topic97001.html" forum.
Berthauser