HELP How do I print a form a continuous

Posted by: weidabao on 8 September 2017, 2:14 pm EST

  • Posted 8 September 2017, 2:14 pm EST



    How do I print a form a continuous ??


     


    Now print the form is the same as


     


    code:


     FarPoint.Win.Spread.SheetView sv = fpSpread1_Sheet1;
                for (int i = 0; i < sv.Rows.Count; i++)
                {
                    FarPoint.Win.Spread.SheetView sv2 = fpSpread1_Sheet2.Clone();
                    if (sv.Cells.Get(i, 0).Value == null)
                    {
                        break;
                    }
                    if (sv.Cells.Get(i, 1).Value != null)
                    {
                        if (!htPrint.ContainsKey(sv.Cells.Get(i, 0).Value.ToString()))
                        {
                            htPrint.Add(sv.Cells.Get(i, 0).Value.ToString(), null);


                            sv2.Cells.Get(1, 1).Value = txtGuiGe.Text.Trim();
                            sv2.Cells.Get(2, 0).Value = txtPiHao.Text.Trim();
                            sv2.Cells.Get(2, 2).Value = cmbDengJi.Text.Trim();
                            sv2.Cells.Get(3, 0).Value = sv.Cells.Get(i, 3).Value;
                            sv2.Cells.Get(3, 2).Value = sv.Cells.Get(i, 4).Value;
                            sv2.Cells.Get(3, 3).Value = sv.Cells.Get(i, 1).Value;
                            sv2.Cells.Get(4, 0).Value = DateTime.Now.ToString("yyyy/MM/dd") + "-" + sv.Cells.Get(i, 0).Value.ToString();
                            sv2.Cells.Get(4, 3).Value = Main.mUser.BianHao;


                            pi.ColStart = sv2.Models.Selection.AnchorColumn;
                            pi.ColEnd = sv2.Models.Selection.LeadColumn;
                            pi.RowStart = sv2.Models.Selection.AnchorRow;
                            pi.RowEnd = sv2.Models.Selection.LeadRow;


                            printsheet(false, sv2);
                        }
                    }
                }



     public void printsheet(bool print, FarPoint.Win.Spread.SheetView sv2)
            {


                pi.PrintType = FarPoint.Win.Spread.PrintType.All;



                pi.ShowGrid = false;
                pi.ShowBorder = false;
                pi.ShowShadows = true;
                pi.ShowColor = false;
                pi.UseMax = true;
                pi.BestFitCols = false;
                pi.Preview = print;
                //pi.Centering = FarPoint.Win.Spread.Centering.Horizontal;


                sv2.PrintInfo = pi;
                fpSpread1.PrintSheet(sv2);
            }


     

  • Replied 8 September 2017, 2:14 pm EST

    Hello,

    I am not sure what exactly you mean by continuous print.Looking at your code it seems that you want a cell range to be printed, I used the following code and successfully printed a cell range.Please have a look,

    Dim printset As New FarPoint.Win.Spread.PrintInfo()

    printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange

    printset.ColStart = 1

    printset.ColEnd = 3

    printset.RowStart = 1

    printset.RowEnd = 3

    ' Set the PrintInfo property for the first sheet.

    FpSpread1.Sheets(0).PrintInfo = printset

    FpSpread1.PrintSheet(0)

     

    If this is not what you are looking for, please let me know your requirement.

    Thanks,

     

     

Need extra support?

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

Learn More

Forum Channels