Hello,
I wan't to know if it's possible de open à Crystal Report note save in the database SLX but in a repertory on the server as a "CrystalReportViewer" in a .net application. In fact, I wan't to preview and print a report in a click action button on my form. To print the informations of my form, I add a parameter in my report and set the value in my code as this :
Sage.Entity.Interfaces.IRequestSampleDoc rsd = form.CurrentEntity as Sage.Entity.Interfaces.IRequestSampleDoc;<br /> <br /> if(rsd != null) { ReportDocument report = new ReportDocument(); report.Load("E:\\Saleslogix\\Reports\\DemandeEchDoc.rpt"); CrystalReportViewer crystalReportViewer1 = new CrystalReportViewer(); crystalReportViewer1.ReportSource = report; report.SetParameterValue("idRequest", rsd.Id); ParameterFieldDefinitions crParameterFieldDefinitions ; ParameterFieldDefinition crParameterFieldDefinition ; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = rsd.Id; crParameterFieldDefinitions = report.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["idRequest"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); CrystalDecisions.Web.CrystalReportViewer crystalReportViewer1 = new CrystalDecisions.Web.CrystalReportViewer(); crystalReportViewer1.ReportSource = report; crystalReportViewer1.RefreshReport(); }
But my report will not open and I don't have any error that can help me for debug... Can you help me please ? Thanks in advance for your response! |