In the end-user report designer, when I preview the report, it shows a parameter dialog on the left side, before the report is displayed. However when I use the following C# code to preview the report , the parameter dialog is not displayed.
XtraReport report = new XtraReport();
report.LoadLayout(reportFilePath);
if (report.DataSource != null)
((SqlDataSource)report.DataSource).ConfigureDataConnection += ConfigureDataConnection;
report.RequestParameters = true;
ReportPrintTool printTool = new ReportPrintTool(report);
printTool.ShowRibbonPreview();
Because the parameter dialog is not shown, the user cannot input parameters to the user and the report displayed is blank.
What should I do to make the report parameter dialog shown here?
Thanks.
Hello Yiwei,
I cannot replicate this issue using the sample project I attached. Would you please try to modify it so we can replicate this issue? Thank you for your feedback in advance.
Thanks,
Elliot
Elliot,
I have a problem recompiling the sample you gave me. We are currently using DevExpress 17.1. It seems that
DevExpress.XtraReports.UI.ExpressionBinding
is not in that version. What should I do?
Thanks for the quick response. I really appreciate it.
Willie
Elliot,
I figure out the real problem. I want to use one single report previewer to show multiple reports instead of launching report previewer multiple times. So my code is something like this:
XtraReport multiReports = new XtraReport();
for (int i = 0; i < count; i++)
{
string reportFilePath = reportFilePaths[i];
XtraReport report = new XtraReport();
report.LoadLayout(reportFilePath);
report.CreateDocument();
multiReports.Pages.AddRange(report.Pages); // combine reports
multiReports.PrintingSystem.ContinuousPageNumbering = false;
}
multiReports.RequestParameters = true;
ReportPrintTool printTool = new ReportPrintTool(multiReports);
This works great if the reports don't have parameter prompts. If they do, we have a trouble. So my real question is how can we achieve our goal to use a single report previewer to display multiple reports with parameter prompts?
You can experiment using two reports with parameter prompts.
Thanks a lot!
Hello,
The XtraReports Suite does not have the capability to re-create a merged report after submitting parameters in the parameter panel. You can create a report with subreports to accomplish this task. Here is a corresponding code snippet:
XtraReport mainReport = new XtraReport(); DetailBand detail = new DetailBand(); mainReport.Bands.Add(detail); XRSubreport subreport1 = new XRSubreport(); XRSubreport subreport2 = new XRSubreport(); XtraReport1 report = new XtraReport1(); subreport1.ReportSource = report; XtraReport1 report2 = new XtraReport1(); subreport2.ReportSource = report2; subreport2.LocationF = new PointF(0, 25); mainReport.Bands[BandKind.Detail].Controls.Add(subreport1); mainReport.Bands[BandKind.Detail].Controls.Add(subreport2); ReportPrintTool printTool = new ReportPrintTool(mainReport); printTool.ShowRibbonPreview();
Thanks,
Elliot
Elliot,
I again run into the problem.
I have a problem recompiling the sample you gave me. We are currently using DevExpress 17.1. It seems that
DevExpress.XtraReports.UI.ExpressionBinding
is not in that version. What should I do?
Thanks for the quick response. I really appreciate it.
Willie
Hello Yiwei,
I have converted my project to the 17.1 version. Take a moment to review it in the attachment.
Thanks,
Elliot