How to set papersource

When I set the property in printsettings.papersource almost nothing happens. I need to set the papersource in code. But how to do this?

Comments

  • edited 6:45AM
    try

    FastReport.Report report = new FastReport.Report();
    report.PrintSettings.PaperSource = (int)System.Drawing.Printing.PaperSourceKind.Upper;
  • edited 6:45AM
    ipong wrote: »
    try

    FastReport.Report report = new FastReport.Report();
    report.PrintSettings.PaperSource = (int)System.Drawing.Printing.PaperSourceKind.Upper;


    Doesn't work for me.

    My Code is

    FastReport.Report report = new FastReport.Report();
    Report.load(filename);
    report.PrintSettings.PaperSource = (int)System.Drawing.Printing.PaperSourceKind.Middle;
    report.PrintSettingts.ShowDialog = false;
    Report.Print();


    Even if I Change the papersource in the designer and save the new frxfile, fastreport keeps using the Default papersource. The only way to Change the source is to keep the Dialog true and let the user change the papersource. But this is in deed no Option .
  • edited September 2017
    1. Get list of paper sources that your default printer supports, important!!!
    System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();
    int selectedSource = -1;
    foreach (System.Drawing.Printing.PaperSource item in printerSettings.PaperSources)
    {
        selectedSource = item.RawKind;
        break;
    }
    

    2. Assign to report
    FastReport.Report report = new FastReport.Report();
    if (selectedSource != -1)
        report.PrintSettings.PaperSource = selectedSource;
    
  • edited 6:45AM
    ipong wrote: »
    1. Get list of paper sources that your default printer supports, important!!!
    System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();
    int selectedSource = -1;
    foreach (System.Drawing.Printing.PaperSource item in printerSettings.PaperSources)
    {
        selectedSource = item.RawKind;
        break;
    }
    

    2. Assign to report
    FastReport.Report report = new FastReport.Report();
    if (selectedSource != -1)
        report.PrintSettings.PaperSource = selectedSource;
    


    Answer 1 was the key. Thank you.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.