SHARE
TWEET

Untitled

a guest Jun 18th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void Frm_Impresion_Presupuesto_Load(object sender, EventArgs e)
  2.     {  
  3.         ConnectionInfo myConnectionInfo = new ConnectionInfo();
  4.         myConnectionInfo.ServerName = System.Environment.MachineName;
  5.  
  6.         myConnectionInfo.DatabaseName = "DIENTE_SANOS";
  7.         myConnectionInfo.UserID = "ODONTOLOGIA";
  8.         myConnectionInfo.Password = "ODONTOLOGIA";
  9.         myConnectionInfo.IntegratedSecurity = false;
  10.         rd = new ReportDocument();
  11.         ParameterField pco = new ParameterField();
  12.         ParameterFields pfields = new ParameterFields();
  13.         ParameterDiscreteValue pdvc = new ParameterDiscreteValue();
  14.  
  15.         pco.Name = "@CODPRE";
  16.         pdvc.Value = SecPre;
  17.  
  18.         pco.CurrentValues.Add(pdvc);
  19.         pfields.Add(pco);
  20.  
  21.         crystalReportViewer1.ParameterFieldInfo = pfields;
  22.         SetDBLogonForReport(myConnectionInfo);
  23.         rd.Load("D:/Reporte/Reporte_Presupuesto.rpt");                    
  24.         crystalReportViewer1.ReportSource = rd;
  25.         SetDBLogonForReport(myConnectionInfo);
  26.     }
  27.  
  28.     ReportDocument rd = new ReportDocument();
  29.  
  30.     private void SetDBLogonForReport(ConnectionInfo connectionInfo)
  31.     {
  32.         TableLogOnInfos tableLogOnInfos = crystalReportViewer1.LogOnInfo;
  33.         foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
  34.         {
  35.             tableLogOnInfo.ConnectionInfo = connectionInfo;
  36.         }
  37.  
  38.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top