how to get rid of the white space when hiding a subreport ssrs2008? - ssrs-2008

I am using SSRS-2008. I am using a subreport named SubReport1 in my main report named MainReport1.
When SubReport1 has no rows, I get white-space in place of SubReport1in MainReport1.
How can i get rid of this?

The subreport will be displayed in main report with the properties mentioned in the subreport itself. So, if reduce the row height, it will not affect the report display if there exist a value. In all other cases, you will not see a blank space over there in the main report. (The row boundaries also could set to 'None' values in main report)
Select the row properties -> under 'Layout' section, you could find the 'Height' parameter. Provide value for this parameter as 0.07938cm

Related

Jaspersoft studio calculate variables before detail band

Jaspersoft studio 6.2.
The report below, there are 3 bands: title, detail, and summary. Detail is in the middle. Look at "Activated staff" on the top on title band, it used a variable (activatedstaffcount1) as expression. The variable sum all activated staff counts in the detail. However it shows null. The bottom one is in the summary band and used the same variable but it shows correct number. The middle section is the data (detail band). I want to show aggregated result before the display data(detail band), how can I do it?
Try to set also Evaluation time in the text field which contains that variable to the "Report".
If the text field is outside of the table - try to return value into the parameter back from dataset and display that parameter at the end of report evaluation.

How to give expression for the details band based on the return value from subreport of the same band?

I am using iReports 4.7.1
I have 2 sub reports in my main report and they are in saperate bands. I need to hide the band if sub report returns no rows. I am able to get subreport value in my main report. But if i use that variable as a expression in the same band the value of that variable is becoming null, If i use that same variable in other details band, it is not becoming null.
I have two question to ask,
Why the value is becoming null if i use in same band?
Is their any other way to hide subreport returns no rows?
I followed this steps to create variable and return value from subreport to main report.
And also i tried this new Boolean($V{SUB_REPORT_ROW_CNT}.intValue()!=0) or $V{SUB_REPORT_ROW_CNT} != null expression in print when expression for the band.
Why the value is becoming null if i use in same band?
I need to see jrxml but probably you do not have correct EvaluationTime on the textField, try to set Band or Report example evaluationTime="Report" on the textField.
Is their any other way to hide subreport returns no rows?
The normal way to remove an empty subreport is by setting isRemoveLineWhenBlank="true" on the reportElement of the subreport.
Make sure your subreport return no page (empty) when no data by setting the whenNoDataType="NoPages" (or removing this attribute since this default) on the jasperReport tag
This will remove the subreport, note however if you like text under it to move you need to set positionType="Float", otherwise they will remain where they are since default is positionType="FixRelativeToTop"

Passing Value from Sub Report To MainReport on Crystal Reports

I'm currently having a problem with regards on Crystal Report Shared Variable. this is my situation.
I have a Report consist of multiple sub reports (and of course the main report). i need to expose a value in main report from Sub Report, but the problem is i need to Display it before the sub report was rendered. Please see the image below:
As you can see the image above, i need to display the value below (Sub report with RED encircle with VALUE) on the TOP (Red encircle without value).
I used Shared Variable but i think it will not work since the TOP will be first rendered (where i need to display the Value from subreport) before the Below(where i need to get the value).
Is it possible?
The section that displays the value has already been rendered by the time the other section sets the value of the shared variable.
Two options:
add a second instance of the subreport to a section that precedes the section when you want to display its value; you won't be able to suppress either the section or the subreport, so you will need to make the subreport as small as possible and change the font colors to white
use a sql-expression field to calculate the desired value and avoid the subreport complexity altogether

How to reduce space in crystal report detail section?

I have a crystal report. In that I need to reduce much more space in detail section. how to do that?
I tried suppress method.but again it showing same problem. how to solve this ?
Here is my crstal report design and output samples
Here is output sample
while taking print it is showing more space . after first report entry , it is showing more space. indicated using next report in red line.
Here are a few ways:
align the top edge of each item to the top edge of each section
make the height of each item in each section equal to the height of the shortest item in that section; if you need any field to grow, toggle its 'can grow' property to checked
set each section's height to match the height of its tallest field
delete or suppress PageHeaderSection4 and ReportFooterSection2
does the Supplier ID and associated field need to be in its own section?

JasperReports, PrintWhenExpression and RemoveLineWhenBlank → Strange Behaviour

I have a problem with JasperReports when using printWhenExpression and RemoveWhenBlank inside a subreport.
To reproduce this problem, I made a simple example using one master report and two subreport.
The first subreport, let's call it the static subreport, contains two Static Text components in the title band (Label 1 on the first line, Label 3 on the second), both have the Position Type attribute set to Float. The title band Split Type attribute is set to "Immediate".
The dynamic subreport have three Static text components (Label 1 on the 1st line, Label 2 on the second and Label 3 on the third), all of them have the Position Type set to Float. But Label 2 has PrintWhenExpression set to Boolean.FALSE and RemoveLineWhenBlank set to TRUE. So Label 2 is hidden and Label 3 is moved to Label 2's place under Label 1.
So basically the dynamic subreport and the static one have the same structure and should behave the same way when printed inside a report. But that's not the case in this little example.
In the master report I'm using a subreport component inside the detail band ( the split type of the detail band is set to Immediate ) and using a JREmptyDataSource with 90 empty rows. When pointing the subreport component to the static subreport, the pdf output generated by jasperreports is corrrect. But when using the dynamic subreport, jasperreports leaves an empty space (that is used when using the static subreport) at the end of the first page and jumps to the next page to print Label 3.
In the real case that I have a problem with, I have a subreport that contains more than 20 lines with Static Text and Text Field components, most to them with printWhenExpression set to a field or a parameter and RemoveLineWhenBlank set to TRUE. When producing the pdf output in some cases I have that specific subreport (which should occupy just  a third of a page) spanning one page and a half with a lot of space spread between the visible lines in the subreport. And I think the combination of RemoveLineWenBlank and PrintWhenExpression is what's causing the problem.
 
So what I want know is if this is a bug or just me missing something in the documentation.
Here is a link to the post I made at the JasperReports forum, it contains the templates for the master report and the two subreports, plus two pdfs generated by jasperreports and screenshots showing the layout of the subreports: link
Thanks in advance for your help.