Make PDF

Posted by: patrik on 16 January 2018, 7:55 am EST

    • Post Options:
    • Link

    Posted 16 January 2018, 7:55 am EST

    I really like Spread.NET, I have use it’s since version 1.0

    It’s only the printing / PDF never working in a good way. But maybe in version 11?

    If I want to print all my sheets in one print it’s same I make a print for each one.

    The PDF will be one file for each sheets. the footer will show page 1 for all my PDF files.

  • Posted 16 January 2018, 10:50 pm EST

    Hello,

    Please make sure you call the PrintSheet() method for all sheets using:

    fpSpread1.PrintSheet(-1);

    Please refer to the attached sample application where I am able to export all sheets to one PDF file with all data. It also has same footer(as set in code) for all pages.

    Provide me your sample application in you are using the same approach and still facing the issue.

    Thanks,

    Deepak SharmaSpreadWinPDFPrinting.zip

  • Posted 17 January 2018, 12:31 pm EST

    Thanks for always perfect support.

    I change this code little and try to print and not save to PDF.

    in this sample Print Dialog shows 4 times, is it’s possible to have it’s only show one time?

    namespace SpreadWinPDFPrinting
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                fpSpread1.Sheets.Count = 4;
                FarPoint.Win.Spread.PrintInfo pf = new FarPoint.Win.Spread.PrintInfo();
                pf.PrintToPdf = false;
                pf.Footer = "Sheet";
                pf.ShowPrintDialog = true;
                pf.PdfFileName = @"C:\Data\PDFFILE.PDF";
    
                for (int s = 0; s < fpSpread1.Sheets.Count; s++)
    
                {
                    fpSpread1.Sheets[s].PrintInfo = pf;
                    fpSpread1.Sheets[s].RowCount = 10;
                    fpSpread1.Sheets[s].ColumnCount = 5;
                    for (int r = 0; r < fpSpread1.Sheets[s].RowCount; r++)
                        for (int c = 0; c < fpSpread1.Sheets[0].ColumnCount; c++)
                            fpSpread1.Sheets[s].Cells[r, c].Value = s + r + c;
                }
            }
            private void button1_Click(object sender, EventArgs e)
            {
                fpSpread1.PrintSheet(-1);
            }
        }
    }
    
  • Posted 19 January 2018, 12:57 am EST

    Hello,

    I dont find a way to cancel the print dialog. when you set ShowPrintDialog to true for each PrintInfo object the dialog will popup everytime the sheet is printed.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels