I have a form, and in this form, I have a print button that opens a reportviwer report made with a dataset. What I need to do with this report is to automate it, instead of clicking the print button, it opens the reportviwer screen afterwards and having to save it in PDF and then open the pdf.
I would like to know if it is possible and if yes how to do to shorten this entire path and click on the print button, and it already open the reportview report already in pdf, triggering the user program's pdf program to view, or either when you click the print button or view it in pdf.
Follow the code on the print button that calls the reportviwer.
public partial class frmPedioVenda : Form
{
public frmPedioVenda()
{
InitializeComponent();
}
private void frmPedioVenda_Load(object sender, EventArgs e)
{
}
private void bntPesquisa_Click(object sender, EventArgs e)
{
this.PedidoVendaPHTableAdapter.Fill_ph(this.PedidoVendaDataSet1.PedidoVendaPH, txtPedido.Text);
this.reportViewer1.RefreshReport();
}
Here I already create the report and visualize:
private void bntPesquisa_Click(object sender, EventArgs e)
{
this.PedidoVendaPHTableAdapter.Fill_ph(this.PedidoVendaDataSet1.PedidoVendaPH, txtPedido.Text);
this.reportViewer1.RefreshReport();
}