private void imprimir_pedido()
{ CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ParameterFields paramFields = new ParameterFields();
ParameterField paramField = new ParameterField();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "@Id_Pedido";
paramDiscreteValue.Value = _numero_despacho; paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
crystalReportViewerPedidos.ParameterFieldInfo = paramFields; rptDoc.Load("D:/xxxxxxxxxxxx.rpt"); rptDoc.SetDatabaseLogon("xxxxxxxx", "xxxxxxxxxxxxxx"); crystalReportViewerPedidos.ReportSource = rptDoc; rptDoc.PrintToPrinter(1, false, 0, 0); }
Note:. I in crystal report is marked with check the option "save data in the report". with the order number "always prints". But if I recall check, nothing prints.