1
I have a form, and in this form, I have a button print out which opens a reportviwer report made with a dataset. What I need to do with this report is automate it, instead of me clicking the print button, it open the reportviwer screen later and have to save in PDF to then open the pdf.
I would like to know if it is possible and if yes how to shorten this whole way and click on the print button, and it already open the report of reportview already in pdf, triggering the pdf program of the usurer’s machine to view, that is when you click the print button already view in pdf.
Follow the code on the print button that calls 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();
}
Pablo thanks for the attention this code you passed above it just generates not visualize right.
– Junior Guerreiro
No, it saves the pdf to disk and opens
– Pablo Tondolo de Vargas
Why you link the dataset 2 times?
– Junior Guerreiro
Because they are two different Datasets, the
DemonstrativoDataSet
I use to mount the header. and theDemonstrativoProcedimentoDataSet
I use to show the details.– Pablo Tondolo de Vargas
But depending on how your report is going, you don’t need to put the datasets.
– Pablo Tondolo de Vargas
So Pablo I already assemble the report as shown in my code above, I already see it on the mounted screen, what I need and generate direct pdf and already view.
– Junior Guerreiro
Let’s go continue this discussion in chat.
– Pablo Tondolo de Vargas
Chat..
– Pablo Tondolo de Vargas