If the result is just text, you can "export" it to a simple text file with the
System.IO.StreamWriter
class or with
System.IO.File.WriteAllText
method.
To export a single-line Textbox result into a text file:
using(var writer = new System.IO.StreamWriter("output.txt"))
{
writer.WriteLine(textbox1.Text);
}
To export a multiline Textbox or RichTextbox result into a text file:
System.IO.File.WriteAllText("output.txt", textbox2.Text);
System.IO.File.WriteAllText("output2.rtf", richTextbox1.Text);
To export to PDF format you can use some free open-source libraries:
1) iTextSharp (recommended) :
http://sourceforge.net/projects/itextsharp/[
^]
2)Spire.PDF :
https://visualstudiogallery.msdn.microsoft.com/b590710c-efe6-4667-842e-2a592ce000cc[
^]
3)PDF Clown :
http://pdfclown.org/[
^]
Hope this answer helps! - CCB