Posted 24 November 2022, 5:06 am EST
Hello ! I’ve tried to pass values from c# wpf code to a parameter of a report. But all the options the tool provide me are readonly. I’ve seen this example but in this version doesn’t works:
var report = new MyReport();
report.Parameters["Parm1"].PromptUser = false;
report.Parameters["Parm1"].Value = someVariable;
report.Parameters["Parm2"].PromptUser = false;
report.Parameters["Parm2"].Value = someVariable2.ToString("M-d-yyyy");
report.Run();
I reference my report this way:
[code]string file_name = @“…....\FD\RdlReport1.rdlx”;
GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(file_name));
GrapeCity.ActiveReports.Document.PageDocument pageDocument = new GrapeCity.ActiveReports.Document.PageDocument(pageReport);
GrapeCity.ActiveReports.Viewer.Win.Viewer viewer1 = new GrapeCity.ActiveReports.Viewer.Win.Viewer();
pageReport.Parameters[“ou”].DefaultValues = “aa”;[/code]
In the last line i try to put values but doesn’t works i hope you can help me thank you!