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

    <DIV id=tts_button style="DISPLAY:block;FLOAT:left;MARGIN:2px 6px 0px 0px;">
    <OBJECT id=tts_object height=18 width=18><PARAM NAME="_cy" VALUE="476"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="http://www.gstatic.com/translate/sound_player.swf"><PARAM NAME="Src" VALUE="http://www.gstatic.com/translate/sound_player.swf"><PARAM NAME="WMode" VALUE="Transparent"><PARAM NAME="Play" VALUE="0"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false"></OBJECT></DIV>
    <P><SPAN class=short_text id=result_box><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>How do I print a form a continuous ??</FONT></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5></FONT></SPAN></SPAN> 


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text id=result_box><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>Now print the form is the same as</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5></FONT></SPAN></SPAN></SPAN></SPAN> 


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>code:</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5> 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);</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>                        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;</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>                        pi.ColStart = sv2.Models.Selection.AnchorColumn;
                            pi.ColEnd = sv2.Models.Selection.LeadColumn;
                            pi.RowStart = sv2.Models.Selection.AnchorRow;
                            pi.RowEnd = sv2.Models.Selection.LeadRow;</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>                        printsheet(false, sv2);
                        }
                    }
                }</FONT></SPAN></SPAN></SPAN></SPAN>

    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5>


     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);
            }</FONT></SPAN></SPAN></SPAN></SPAN>


    <SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#fff;"><FONT size=5></FONT></SPAN></SPAN></SPAN></SPAN> 

  • 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