Current filter:
                                You should refresh the page.
                                0
                                  • I am attempting to embed a subreport within a master report following the steps outlined in the documentation: How to: Create a Master-Detail Report using Subreports
                                    The report runs without displaying the data for the subreport.

                                    Here is the pertinent information:

                                    Sub report's BeforPrint Event handler:

                                            private void xrSubreport2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
                                            {
                                                ((DetailedConclusionSubReport)((XRSubreport)sender).ReportSource).ParamOversightID.Value =
                                                        Convert.ToInt32(GetCurrentColumnValue("OversightID"));
                                            }

                                    Filter String of the sub report's Report: [OversightID] = ?ParamOversightID

                                    Declaration of the parameter:

                                    Visible = false
                                    Type = Int32
                                    Name = ParamOversightID
                                    Modifiers = Public

                                    I temporarily turned the parameter on: Visible = true and ran the sub rejport standalone in the preview mode. I manually entered parameter values and the sub report ran okay. Also i am able to run the master report okay (the sub report simply does not display).

                                    THE PAGE HEADER OF THE SUBREPORT DOES DISPLAY. So i know the subreport is connecting.

                                    My suspicion is that the event handler is wrong.

                                    Willie

                                0

                                Hi Willie,

                                Thank you for contacting us. Your approach seems correct. It looks like the issue is related to your particular report layout implementation. To clarify the situation, please post your sample project here.
                                I will examine it, and then check for a solution.

                                Thanks,
                                Alex

                                0

                                Attached is a sample project.

                                WindowsFormsApplication1.zipx
                                0

                                Willie,

                                I cannot extract the WindowsFormsApplication1.zipx archive on my machine. Please repack your example using the built-in Windows -> Send to compressed folder feature, and post it here. Then, I will continue the research.

                                Thanks,
                                Alex

                                0

                                i have rezipped the sample application. Sorry for the inconvenience.

                                WindowsFormsApplication1.zip
                                0

                                Willie,

                                No problem at all. It looks like you are trying to render the main report using the Preview option in Visual Studio. Please note that all code-behind event handlers are not effective in this situation. You might need to handle the Form.Load event and create an XtraReportMain instance. This way, you should be able to display the main report using its ShowPreview method.If you need to see changes both at design time and at runtime, please use the XtraReports' scripting technology, and move all event handlers to scripts.
                                To learn more, check the Scripting Overview documentation article.

                                Thanks,
                                Alex

                                0

                                I have run the report inside of my main program. I get the same result as when i am in the designer. I also tested by having my labels in the sub rejport show (setting the report property to show up on empty data). For each master record i see the sub report's labels but no data is loaded.

                                As a side note: I have also tested by trying the detail band method and also i get no data.

                                0

                                Willie,

                                This is rather strange. I do not have VistaDB installed on my machine. However, I have managed to replace the report's datasource using the common Northwind database.
                                Attached is a sample project that works fine here. Please review it and let me know whether or not this helps.

                                Thanks,
                                Alex

                                B199509.zip
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.