adjust papersource does exactly nothing

jam176jam176 Member Posts: 27
edited 2007-09-21 in Navision Attain
hi everybody!

i've spent an hour or two to teach my HP 4000 printer which paper tray to use; papertray or manual feed. but i had no success.

first i tried to set the options papersourcefirstpage and papersourceotherpages. then i tried to force it by programming
currreport.papersource:= x;
where x was 1, 2, 3, 4, 257,...

but whatever i tried, the printer used the standard tray.

what is my mistake. i just want a specific report always to be printed on colored paper out of the manual feed.
thx
jam176

Comments

  • SavatageSavatage Member Posts: 7,142
    have you double checked that the printer is set up?

    http://h20000.www2.hp.com/bizsupport/Te ... cale=en_US

    just a thought....

    I have seen several posts regarding "findtrays" app - but I don't think anyone has ever responded with a solution.
  • jam176jam176 Member Posts: 27
    well, the printer is set up, as i can fix it. the link of the HP site shows how to configure. but i guess my problem is a little different.

    no matter which tray is used if the paper runs out in a specific tray! i just want to say the printer which one it should use for my report.

    in the manual feeder (tray 1) lies colored paper. for one report the printer should always use this paper. every other report schould be printed on white paper out of the standard tray (the cassette, tray 2).

    if i force this in winword (e.g.) its working. but if i set the papersource options in navision always the standard tray of the printer is used, giving a damn what i set!
    thx
    jam176
  • SavatageSavatage Member Posts: 7,142
    Here's what the help says..sometimes re-reading it sparks an idea! :idea:

    PaperSourceFirstPage/OtherPage

    Use the AssistButton to select a paper source from the list of paper sources supported by a particular printer. The list contains 13 standard trays and 8 printer specific trays.

    It is based on information in the fin.stx file.

    If the printer that is used for this report does not support the specified PaperSourceFirstPage, it will use the default tray specified by the printer driver.

    If you leave the PaperSourceFirstPage property as <Undefined>, the printer will use the default tray.

    If you do not specify a value for the PaperSourceOtherPages property, a value specified for PaperSourceFirstPage will apply.

    The printer specific trays contained in the list are intended for use with printers that have other paper sources than the ones listed. To find out how a Printer Specific Feed is mapped to the actual feed on an actual printer, you will have to experiment with choosing a Printer Specific Feed. Then, when you select a printer in the Page Setup dialog, you can see how the Printer Specific Feed is mapped for that particular printer.

    Attention
    A different setting in the Print dialog or Page Setup dialog overrides the value specified for the PaperSourceFirstPage property.


    PAPERSOURCE

    Use this function to return the paper source used for the current page or a specified page, and to set a new paper source.

    CurrReport.PAPERSOURCE(PaperBinNo [, PhysicalPage])
    PaperBinNo
    : tray number

    PhysicalPage
    : page number

    Comments
    The PAPERSOURCE function has two parameters: the tray number, which is mandatory, and the page number, which is optional. If the printer does not support the tray number, the function call will be ignored, and the printer will continue using the previously selected tray.

    The tray numbers that correspond to the options for the PaperSourceFirstPage and PaperSourceOtherPages properties are as follows:

    1 Upper or Only One Feed
    2 Lower Feed
    3 Middle Feed
    4 Manual Feed
    5 Envelope Feed
    6 Envelope Manual Feed
    7 Automatic Feed
    8 Tractor Feed
    9 Small-format Feed
    10 Large-format Feed
    11 Large-capacity Feed
    14 Cassette Feed
    15 Automatically Select
    256 Printer Specific Feed 1
    257 Printer Specific Feed 2
    258 Printer Specific Feed 3
    259 Printer Specific Feed 4
    260 Printer Specific Feed 5
    261 Printer Specific Feed 6
    262 Printer Specific Feed 7
    263 Printer Specific Feed 8

    If the printer supports other tray numbers, you can enter these too.

    If you do not specify a page number, the tray change will apply to the current page. The new tray will also apply to subsequent pages until the next tray change occurs.

    When you do specify a page number, the tray change will take place when the specified page is printed. Subsequent pages will also use this tray until the next tray change. The tray change can be placed anywhere on a page and still apply to the whole page.

    If you specify more than one paper tray selection for a page, the printer uses the last selection.
  • SavatageSavatage Member Posts: 7,142
    we print our credit memo's on Pink Paper.

    Located in drawer 4 of our Canon Image writer IR8500.

    *(happens to be the last drawer too)*

    Using Assist...
    Using the "Printer Specific Feed 4" - Nothing happened

    When I switched it to "Lower Feed" - bingo! worked without a problem.

    did you try different colored paper in each drawer to see if you can get any of the trays to work?
  • jam176jam176 Member Posts: 27
    navision seems to be very tricky. due to Savatage's good advices i decided to put this
    [b]OnAfterGetRecord()[/b]
    i:= CurrReport.PAGENO;
    CurrReport.PAPERSOURCE := i;
    

    to my report. no success. then i tried the upper numbers
    [b]OnAfterGetRecord()[/b]
    i:= CurrReport.PAGENO + 250;
    CurrReport.PAPERSOURCE := i;
    

    and voiala: at papersource = 257 the printer asked for manual tray. well i had to put the paper out and in again, because the printer ment this was a kind of error, but it forced the manual tray. (even tough 257 means tray 2, and manual tray is 1 at my HP4000!)

    ok, it's not nice, but it works.

    anyway, i put the code out of the trigger, clear everything, so that there were no settings for papersource anymore and compiled the object. i printed out again and what happened: the report prints to tray number 257!

    i wanted to write it here, if anyone is interessted in. navision is STRANGE!

    thank you very much Savatage.
    thx
    jam176
  • LorryLorry Member Posts: 2
    Hi
    Sorry for putting up this old thread, but I wanna set things clear.

    257 is the manual feed.

    For more information read this thread (my post):

    http://www.mibuso.com/forum/viewtopic.php?t=2905

    Greetings
    Lorry
  • rvduurenrvduuren Member Posts: 92
    Hello All,

    A small c# Console program tells you everything you want to know about your local default printer (*no e-doc printers)..
    Note: You need a least dotNet FrameWork 2
    using System;
    using System.Drawing.Printing;
    
    namespace DefPrintSettings_c
    {
        public class DefPrintSettings
        {
            [STAThread]
            static void Main(string[] args)
            {
                PrintDocument pd = new PrintDocument();
                PageSettings pg = pd.DefaultPageSettings;
                PrinterSettings ps = pg.PrinterSettings;
    
    
                Console.WriteLine("Retrieving default Printer settings..");
                Console.WriteLine("PrinterName = " + pd.PrinterSettings.PrinterName);
                Console.WriteLine("Is default Printer = " +
                                   ps.IsDefaultPrinter.ToString());
                Console.WriteLine("Is plotter = " + ps.IsPlotter.ToString());
                Console.WriteLine("Is printer valid = " + ps.IsValid.ToString());
                Console.WriteLine("Can Duplex = " + ps.IsValid.ToString());
                Console.WriteLine("Num copies = " + ps.Copies.ToString());
                Console.WriteLine("Max Copies = " + ps.MaximumCopies.ToString());
                Console.WriteLine("Max Page = " + ps.MaximumPage.ToString());
                Console.WriteLine("Min Page = " + ps.MinimumPage.ToString());
                Console.WriteLine("Supports Color = " + ps.SupportsColor.ToString());
                foreach (PaperSize p in ps.PaperSizes)
                    Console.WriteLine("Supports Paper Size: " + p.PaperName);
                foreach (PaperSource p in ps.PaperSources)
                   // This Line retrieves the printer tray ID's (p.RawKind)
                    Console.WriteLine("Supports Paper Source: {0} - {1}",p.SourceName,p.RawKind);
    
                Console.WriteLine("\nPage Settings");
                Console.WriteLine("Is Color = " + pg.Color.ToString());
                Console.WriteLine("Top Bound = " + pg.Bounds.Top.ToString());
                Console.WriteLine("Bottom Bound = " + pg.Bounds.Bottom.ToString());
                Console.WriteLine("Left Bound = " + pg.Bounds.Left.ToString());
                Console.WriteLine("Right Bound = " + pg.Bounds.Right.ToString());
                Console.WriteLine("Top Margin = " + pg.Margins.Top.ToString());
                Console.WriteLine("Bottom Margin = " + pg.Margins.Bottom.ToString());
                Console.WriteLine("Left Margin = " + pg.Margins.Left.ToString());
                Console.WriteLine("Right Margin = " + pg.Margins.Right.ToString());
                Console.WriteLine("Landscape = " + pg.Landscape.ToString());
                Console.WriteLine("PaperSize = " + pg.PaperSize.PaperName);
                Console.WriteLine("PaperSource = " + pg.PaperSource.SourceName);
                Console.WriteLine("PrinterResolution = " +
                                  pg.PrinterResolution.Kind.ToString());
                Console.WriteLine("PrinterResolution X = " +
                                  pg.PrinterResolution.X.ToString());
                Console.WriteLine("PrinterResolution Y = " +
                                  pg.PrinterResolution.Y.ToString());
                Console.Write("Press Enter to continue..");
                Console.ReadLine();
    
            }
        }
    }
    
    

    This code line retrieves the printer tray ID's (p.RawKind)
    foreach (PaperSource p in ps.PaperSources)               
                    Console.WriteLine("Supports Paper Source: {0} - {1}",p.SourceName,p.RawKind);
    

    Download full source and compiled program here.. -->http://www.filefreak.com/pfiles/29019/Printersettings_src_bin.zip
    Met vriendelijke groet, best regards,

    Rvduuren
Sign In or Register to comment.