2006 IR Open Discussion Posted August 20, 2006 Share Posted August 20, 2006 By: JInish Abraham - jinish "No records found" message 2003-12-09 03:49 I have a report with 5 sub reports. These are not basically sub reports as the data they hold is unrelated. But these have to be printed on the same report one after the other. I guess I can achieve this only thru sub reports. Now the complexity lies here. At some point, there is a possibility that some of the sub reports would not contain any data. In this case, I have to show a message "No data found" for that sub report only. The other sub reports should show the data. I could not find a solution to this in the documents available. So the workaround I thought is, I will have multiple reports containing these sub reports. One with data sections for all sub reports. Another with data section only for first sub report and "No data found" message for all the other reports, so on....But this will result in me designing 2 to the power 5 = 32 different reports. Now when I run the report, I will check for the size of the data source I am passing for the sub reports. Depending on their sizes, I will decide which report to pick up. Is this possible?. But here the difficulty is I have to design 32 reports and will have 32 if conditions in my code... Can any of you think of any other alternative?? Can I make use of the printwhenexpression feature here? If yes, how? Thanks in advance, Jinish Abraham By: Teodor Danciu - teodord RE: "No records found" message 2003-12-09 05:31 Hi, I suggest a different trick. If you have the possibility to test how many records are in the data source of a particular subreport, before passing this data source to the subreport, then you could decide to hide the subreport and display a text field "No records found". Behind each subreport you will place a text field that says "No records found" and you'll switch between this text field and the corresponding subreport using their <printWhenExpression>. I hope this helps. Teodor By: JInish Abraham - jinish RE: "No records found" message 2003-12-09 21:36 Hi, Thanks a lot for your quick reply. As u said, I can do it by hiding the sub report and displaying the text. But I need to show the column headers for that sub report and under these heading only the text should appear. So I guess, for each sub report, on top of the textfields (coulmn values), I can place a static text showing "no records found". Now I will switch between this static text and the column values depending on the size of the data source. But I cant keep the data source empty also, as there is no option to show the details if no data is present in the data source. So i guess, I need to put some dummy data into the datasource and then switch between the text and the column values. Does it sound okay?..waiting for ur response.. Thanks in advance, Jinish Abraham By: Teodor Danciu - teodord RE: "No records found" message 2003-12-10 10:21 Hi, If you have columnCount="1" in your subreport, then you could place the "No records" text inside the summary section of the subreport (in case you don't use this summary section). Then use the <printWhenExpression> of this summary to show or hide that message based on the REPORT_COUNT variable. Also use whenNoDataType="AllSectionsNoDetail" for your subreport template. I hope this helps. Teodor Link to comment Share on other sites More sharing options...
rita_dewan Posted November 7, 2006 Share Posted November 7, 2006 Hi Teodor,I was facing the same kind of problem your ideas helped me out and I could successfully get it done. Thanks a million. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now