I'm not really sure I'm going about my problem the right way or not. What I want to to is have a save button, bring up the save dialog, and save a report from reportViewer(.r dlc) in .pdf format.
The only this is, I don't show the user the dialog for previewing the report, so I can't access any of that functionality, and I know that already has an export to pdf function.
I need to do this without the use of those features. Any suggestions or ideas would be a great help!
Here is some code...
private void saveButton_Clic k(object sender, EventArgs e)
{
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string fileNameExtensi on;
byte[] bytes = reportViewer1.L ocalReport.Rend er("PDF", null, out mimeType, out encoding, out fileNameExtensi on, out streamids, out warnings);
SaveFileDialog saveFile = new SaveFileDialog( );
saveFile.Filter = "Text Files|*.txt|All Files|*.*";
if (saveFileDialog 1.ShowDialog() == DialogResult.OK )
{
File.WriteAllBy tes(saveFile.Fi leName, bytes);
}
Katie
The only this is, I don't show the user the dialog for previewing the report, so I can't access any of that functionality, and I know that already has an export to pdf function.
I need to do this without the use of those features. Any suggestions or ideas would be a great help!
Here is some code...
private void saveButton_Clic k(object sender, EventArgs e)
{
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string fileNameExtensi on;
byte[] bytes = reportViewer1.L ocalReport.Rend er("PDF", null, out mimeType, out encoding, out fileNameExtensi on, out streamids, out warnings);
SaveFileDialog saveFile = new SaveFileDialog( );
saveFile.Filter = "Text Files|*.txt|All Files|*.*";
if (saveFileDialog 1.ShowDialog() == DialogResult.OK )
{
File.WriteAllBy tes(saveFile.Fi leName, bytes);
}
Katie
Comment