How to Copy the selected portion of rows from one spread to another spread

Posted by: brganesh on 8 September 2017, 1:45 pm EST

  • Posted 8 September 2017, 1:45 pm EST

    I have selected some parts of rows in the spread(say for example 5 to 55) i just want these selected rows to be saved as excel file.

    i got several examples like assigning a new spread object and assign the old grid to this newly created one and save it as excel file...

    but i just need to save the selected parts of rows to  be saved in the Excel file 

     we are using spread for windows and c# for coding,can i have some example coding... to complete this..

     

  • Replied 8 September 2017, 1:45 pm EST

    Hello,


    Here is code to take data from first Spread and put it in a hidden Spread for exporting to Excel.

    <FONT size=2>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Copy data from first Spread

    </FONT></FONT><FONT size=2>

    fpSpread1.Sheets[0].AddSelection(2, 5, 22, 55);


    fpSpread1.Sheets[0].ClipboardCopy();


    fpSpread1.Sheets[0].ClearSelection();


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Create new Spread control and paste the data you want exported.

    </FONT></FONT><FONT size=2>

    FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>FpSpread</FONT></FONT><FONT size=2> ss = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>FpSpread</FONT></FONT><FONT size=2>();


    ss.Sheets.Count = 1;


    ss.ActiveSheet.ClipboardPaste();


    ss.SaveExcel(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>@"c:\test\test.xls"</FONT></FONT><FONT size=2>);

    </FONT>
Need extra support?

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

Learn More

Forum Channels