subreport using iReport tool - subreport

I am having one master report and and need to show 4 different sections in next page. So for those 4 different kind of details , i have created 4 subreports in detail band of main report. Now these 4 reports will be displayed as 4*4 matrix (like 1st and 2nd subreport side by side and 3rd and 4th report just below first and second one , again side by side) now if first and third subreports while runtime didn't got displayed (may be because data which gets populated in them is not present) so space occupied by them is now empty i.e their is space in left hand side of matrix but 2nd and 4th subreports are displayed which are on right hand side. Now here is my query : how can i move 2nd and 4th subreports on left hand side which is empty space?
similary if 2nd subreport is not present , how would i move 4th report up i.e on 2nd subreports place.
so basically i was not able to move subreports either on top or left side which are empty for no data.
Please help as i am badly stuck here from 1 week.

I don't think it's possible to dynamically move subreports on the horizontal plane.
However, you could use the Float value of the Position Type element of your subreports. This would display subreport 3 in the position of subreport 1 of 1 is empty or not displayed and 4 in the position of 2.
There is, however, a complicated way to make it appear as if the report is behaving the way you want it to behave. It requires your main report to detect if one of the subreports is empty. So if you CAN detect that (i.e. your main reports knows when one of your subreports will be empty, e.g. based off of certain values or parameters or the result o a query) you can add every possible combination and positioning of subreports in a different detail band and use the Print When Expression to determine which of these should be displayed.
Example:
Detail 1, print when "all sureports filled"
S1 | S2
S3 | S4
Detail 2, print when "subreport 1 not filled"
S2 |
S3 | S4
Detail X, print when "subreport 2 filled AND subreport 4 filled"
S2
S4
...or whatever arrangement you like.
But I would not recommend doing that. Maintaining the report becomes a pain in the butt and execution times increase drastically.

Related

Change Cell Reference Within a Repetition

I need to transpose data on a single row into a table. What I'm doing is taking a base inventory item and creating 6 more items from it. For example, my base inventory item is a ball, and I want to create 6 different balls from that of various colours (blue ball, black ball, and so forth). To do so, I've used the REPT function to repeat a process 6 times to create my list of inventory items.
=transpose(split(rept(C4&""&F4&""&";",6),";"))
C4 contains my base inventory item code (ie: ball) while F4 contains the subcode (ie: -blue). The formula combines these values in "ball-blue" etc.
This works just fine. The problem I'm running into is that I want to change the F4 cell reference each time it repeats. I want to shift it to the right so that I can pick up the rest of subcodes into the table.
try:
=INDEX(TRANSPOSE(IF(F4:J4<>""; C4&"-"&F4:J4; )))

Excel - my formula needs to incorporate the last filled cell in column

I am building a calculator that detects streamflows that falls below a certain flow rate. I have an array formula that takes a column of data, and identifies how many data points in a row fall below a particular threshold (threshold value in C12):
{=MAX(FREQUENCY(IF(E23:E12275<C12,ROW(E23:E12275)),IF(1-(E23:E12275<C12),ROW(E23:E12275))))}
This formula works, but I want to be able to build in the ability to detect the last row with entered data. In this example, the data set finishes at E12275, but datasets can extend many more rows. If I extend the formula to this:
{=MAX(FREQUENCY(IF(E23:E1000000<C12,ROW(E23:E1000000)),IF(1-(E23:E1000000<C12),ROW(E23:E1000000))))}
the formula interprets the blank cells (after the last full cell) as zero, and says that they fall below the threshold. This gives me a result of 987725 (1000000-12275)
I have built another formula that detects the bottom row cell address:
=ADDRESS(LOOKUP(2,1/(E23:E1000000<>""),ROW(E23:E1000000)),5,1)
However I am having trouble incorporating this result into the existing formula. Does anyone have any thoughts on how to do this?
NB: I have also toyed with the idea of building a formula that excludes blank cells, however the actual datasets include blank cells, which should be interpreted as "below threshold"

Excel Array: Reducing the Number of Calculation Steps

As per my on-going journey through the world of Excel arrays, I was wondering if someone might be able to give me a pointer or two.
On the excel sheet attached, I currently have a four-step process to get from a segregated lookup to a gapless list:
Step 1 (yellow): For the 50-word long list in sheet 'Data', a 50-cell lookup is performed to see whether the input in row 1 (red) appears somewhere in the corresponding cell. In this case, the lookup is performed three times for three different inputs, i.e. in columns C-E.
Step 2 (orange): An array then relists the contents of the 50-cell lookup above it but removes all empty cells (i.e. where there is no match to the input in row 1)
Step 3 (green): The results from step 2 are listed out in a single column.
Step 4 (blue): The results from step 3 are listed out using the same technique as in step 2 in order to remove the blank cells.
Collectively, this enables a gapless listing of all data objects which contain the given inputs somewhere in their string.
However, my real list of data objects is 5000 entries long and I would like to look up the results for 100 or more inputs. As step 1 requires each combination to be looked up separately, this requires 500,000 calculations for step 1 alone, which causes a heavy toll on the processors.
Therefore, I was wondering if anyone had an idea as to how I could shortcut this process to reduce the number of cells / calculations involved. I assume that step 1 and 2 could somehow be merged, but my knowledge of arrays is not sufficient to think of how this could be done.
It would be brilliant to hear from somebody who may have some advice on the matter!
Kind regards,
Rob
File Link: https://drive.google.com/open?id=10O91QDD78RkbWtQx2iWfax17Dt5TPw1G
Since you're not removing duplicated entries from the final list, this is quite straightforward.
Based on the workbook you provided, to be entered within the Lookup sheet:
In cell A1:
=SUMPRODUCT(0+ISNUMBER(FIND(C1:E1,Data!A1:A50)))
In any cell of your choice, to begin the list of returns, array formula**:
=IF(ROWS($1:1)>A$1,"",INDIRECT("'Data'!"&TEXT(SMALL(IF(ISNUMBER(FIND(C$1:E$1,Data!A$1:A$50)),10^5*ROW(Data!A$1:A$50)+COLUMN(Data!A$1:A$50)),ROWS($1:1)),"R0C00000"),0))
and copied down until you start to get blanks for the results.
Notes:
Instructions for entering an array formula are at the foot of this post.
The sheet name (emboldened within the second formula) should be amended as required.
It is important that the range containing the values being searched for (A1:C1 here) and that containing the entries to be searched within (A1:A50) be orthogonal, i.e. one is a horizontal range, the other a vertical range.
If you are not using an English-language version of Excel then the part "R0C00000" within the second formula may need amending.
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

SSRS - Print order issue

I have the following scenario: I have a matrix table with dynamic rows and columns, the rows have three groups Product_Type, Manufacturer and Supplier the Columns are stores that are dynamically generated. All the data comes from a single DataSet returned from a stored procedure in SQL Server.
The rows are to big too fit on a single screen and the columns as well, now when this happens the print order must be as follow: if the columns overflows then the columns must print on the following page continuing with all of the rows (the 3 types). If the rows overflows but not the columns then that columns must display on the following page for the remaining rows. These two scenarios is quite straight forward and I already got it to work. If both the columns both overflows it must print as the following picture:
I am struggling to get it right, I am not a novice in SSRS and only know the fundamentals. I have struggled quite a while trying to figure it out and can't seem to get it right.
Any expert advice will be much appreciated.
One way to achieve this if you have two matrixes one after the other.
The first you hide any columns # > x (where x is the number of columns you can fit onto a page) and subsequent matrix hide the column # <= x
Matrix 1
Matrix 2

Finding Most Common Word In A Tally/Ledger System

I currently use the following array formula to find the most common word or number in a range, ignoring any blank cells:
{=(INDEX(D1:D10,MODE(IF((D1:D10<>"")*ISNA(MATCH(D1:D10,$A$1:$A1,0)),MATCH(D1:D10,D1:D10,0)))))}
I am now looking to do something slightly different. I still want to find the most common word or number in a range, however I now have 2 lists: the first is a list of 'positive' words/numbers and the second is a list of 'negative' words/numbers.
To illustrate using an example: the colour green appears in the 'positive' list 4 times and the colour blue appears twice in the 'positive list', but green appears 3 times in the 'negative' list and blue does not appear at all in the 'negative' list. Using the above formula on the first list would return green as the most common word. However I now want it to take into account that green is not the most common word given the combined lists (i.e. 4 positives - 3 negatives = 1 green, and 2 positives - 0 negatives = 2 blue).
In the below image, using the formula under each list shows green to be the most common word. I would like to combine these lists and cancel out any instances where the colour appears on both instances - so 3 of the greens on the positive list would be cancelled out with the 3 greens on the negative list, leaving only one left.
In essence, I suppose I am trying to create a tally or ledger of some kind where rather than numbers that add or subtract I have words whose frequency is added or subtracted.
Thanks for the help, and apologies if I haven't been too clear in the task!
This should work:
=IF(SUMPRODUCT((MMULT(COUNTIF(OFFSET(B2:B11,,{0,1}),B2:B11),{1;-1})=MAX(MMULT(COUNTIF(OFFSET(B2:B11,,{0,1}),B2:B11),{1;-1})))/COUNTIF(B2:B11,B2:B11&""))>1,"No Favourite",INDEX(B2:B11,MATCH(MAX(MMULT(COUNTIF(OFFSET(B2:B11,,{0,1}),B2:B11),{1;-1})),MMULT(COUNTIF(OFFSET(B2:B11,,{0,1}),B2:B11),{1;-1}),0)))
And for non-contiguous, dynamically-defined ranges, assumed to be stored as Defined Names Positive and Negative, array formula**:
=IF(SUM((COUNTIF(Positive,Positive)-COUNTIF(Negative,Positive)=MAX(COUNTIF(Positive,Positive)-COUNTIF(Negative,Positive)))/COUNTIF(Positive,Positive&""))>1,"No Favourite",INDEX(Positive,MATCH(MAX(COUNTIF(Positive,Positive)-COUNTIF(Negative,Positive)),COUNTIF(Positive,Positive)-COUNTIF(Negative,Positive),0)))
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
First list your candidates in column D starting at D2
Then in E2 enter:
=COUNTIF(B$2:B$12,D2)-COUNTIF(C$2:C$12,D2)
and copy down.
Finally in F2 enter:
=INDEX(D:D,MATCH(MAX(E:E),E:E,0))
With your data:

Resources