Fixed number of detail rows

Hi all,
I have "shipment form" that I need to replicate in reporting services - see image.
FYI, there is more header info below the "shipment details" section...
My issue, is fixing the number of detail lines, my data can have between 1 and 5 detail lines & I would like to use a table rather than lists / textboxes etc.
Is there any way I can fix the detail lines lines to 5 i.e. i need the shipment detail section to be the same size - regardless of the number of rows.
I think one solution is do it in the query (return empty detail columns when they don't exist) - but I'm guessing there is a correct way to do it in the report.
Any assistance greatly appreciated.
Thanks in advance.

Hi Clay,
I am not sure if it's the cleanest option, but it works :-)
In the query of the shipment details, add the following (assuming your query has just five output columns):
UNION ALL
SELECT '', '', '', '', ''
UNION ALL
SELECT '', '', '', '', ''
UNION ALL
SELECT '', '', '', '', ''
UNION ALL
SELECT '', '', '', '', ''
ORDER BY ColumnName DESC
This will add blank lines to your query. Now you have to tell the tablix that it should not display more than 5 rows. Right-click on the details icon on the left of the details row and select "Row visibility". Select the option "Show or hide based on an
expression" and type the following in the expression box:
=Iif(RowNumber(Nothing) <= 5, False, True)
The added blank lines and this visibility expression should always create 5 rows.
Hope this helps!
- If a post answers your question, please click "Mark As Answer" on that post!

Similar Messages

  • Select a fixed number of random rows

    Hi,
    I just would like to select a fixed number of random rows from a table. That is, I would like to get 5 rows, without specifying the row_id, and the selected rows should "always" be different. Just as picking 5 balls out of a big box (which is filled with many balls).
    Is there a way to easily put it into one sql statement or do I have to write a workaround in the programming language I use?
    Thanks a lot in advance,
    CQ

    AskTom has a discussion on this:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:6075151195522
    Note that it requires that you
    1) Generate a random number for every row in the table
    2) Sort the table by those random numbers
    which is a significant performance hit if the table is large.
    Justin

  • New detail rows not showing

    Hi,
    Here's a little background on my problem. We have a simple master-detail hierarchy. Both have a ViewObject. The problem lies in the fact that our detail VO has a filter using a bind variable. The bind variable value is determined (most of the time) at the VO execution time: bindParametersForCollection is overriden and passes a value for the bind variable if it is null. In our specific case the variable represents the username of the authenticated user.
    The main complexity lies in the UI. We present all the masters and their children in a single table in edit mode. We are using a tree binding with an accessor from the master node to the child node.
    Example
    Row 1: Master 1 Column 1 | Master 1 Column 2 | Master 1 Detail 1 Column 1 | Master 1 Detail 1 Column 2
                                                 | Master 1 Detail 2 Column 1 | Master 1 Detail 2 Column 2
                                                 | Master 1 Detail 3 Column 1 | Master 1 Detail 3 Column 2
    Row 2: Master 2 Column 1 | Master 2 Column 2 | Master 2 Detail 1 Column 1 | Master 2 Detail 1 Column 2
                                                 | Master 2 Detail 2 Column 1 | Master 2 Detail 2 Column 2
                                                 | Master 2 Detail 3 Column 1 | Master 2 Detail 3 Column 2
    Row 3: Master 3 Column 1 | Master 3 Column 2 | Master 3 Detail 1 Column 1 | Master 3 Detail 1 Column 2
                                                 | Master 3 Detail 2 Column 1 | Master 3 Detail 2 Column 2
                                                 | Master 3 Detail 3 Column 1 | Master 3 Detail 3 Column 2Everything works until we try to create new rows. In our use case, whenever we create a new master row, we also create a fixed number of detail rows. The number of detail rows depends on the context. Whenever we do this, the details rows do not show up in the UI.
    In my experimentations, I found that the problem was caused by the bind variable on the detail VO. Tracing the detail VO query execution I came to the conclusion that unposted rows where rejected from the QueryCollection when there’s a bind variable. The debugger shows that in VO#executeQueryForCollection the QueryCollection#mUnpostedRows list is empty when there’s a bind variable while it is not when there’re no bind variable.
    This is a major issue in our case, so I would like to know if you consider this as a bug (in my opinion it is). If yes, when can we expect a fix or workaround? Otherwise we’ll have to get around this problem by either finding a way to remove the bind variable OR do everything manually in a managed bean (which I would prefer not to have to do).
    I have reproduced the problem in a SRDemo test case. Test case has been sent to Steve Muench.
    Thanx!
    Olivier

    This looks very similar to Bug# 6412612 "New Row Lost After Executequery In Vo W/ Bind Variable In Where Clause", reported in the Tech Preview #2 release, and fixed in Tech Preview #3 (due out before the end of December 2007). Will try confirming with an in-house TP3 build that this fix fixes your testcase, too.

  • Dynamically modifying the number of Form detail rows

    Hi,
    A challenge for you all!
    I am building a product details system in Portal forms.
    One of the screens is a Product Ingredients form with Product as the master block and ingredients as the Detail block. There can be between 1 and 20 ingredients in any 1 product and as these all have to sum to a volume percentage of 100% the client would like to see all ingredients for a product on 1 screen and not have to do Next/Previous to see them all.
    As you increase detail rows on a master detail form the performance of the form decreases dramatically so I would like to minimise the number of detail rows displayed for each product to maximise performance.
    To this end I wish to dynamically modify the number of detail rows displayed to match the number of ingredients on a product as that product is queried.
    I can handle figuring out how many rows I want to set the page to but have not been able to figure out how to change the number of detail rows displayed at run time.
    Anyone know how (or if!) this is possible ?
    All help gratefully recieved
    Andy

    The rownum pseudo-column hold the number of the row but it doesn't work like you expect. It is assigned before sorting for example and it is not absolute. SQL conceptually deals with sets and sets have no inherent order. See http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    If you want to have an absolute number in a row you will need to maintain it yourself with PLSQL code.

  • No. of Detail Rows

    Hi,
    A challenge for you all!
    I am building a product details system in Portal forms.
    One of the screens is a Product Ingredients form with Product as the master block and ingredients as the Detail block. There can be between 1 and 20 ingredients in any 1 product and as these all have to sum to a volume percentage of 100% the client would like to see all ingredients for a product on 1 screen and not have to do Next/Previous to see them all.
    As you increase detail rows on a master detail form the performance of the form decreases dramatically so I would like to minimise the number of detail rows displayed for each product to maximise performance.
    To this end I wish to dynamically modify the number of detail rows displayed to match the number of ingredients on a product as that product is queried.
    I can handle figuring out how many rows I want to set the page to but have not been able to figure out how to change the number of detail rows displayed at run time.
    Anyone know how (or if!) this is possible ?
    All help gratefully recieved
    Andy

    Hi,
    You can only specify the number of details rows at design time. There is no option to change it at run time.
    Thanks,
    Sharmila

  • Master detail forms..increase the detail rows by clicking a button

    hi all,
    i have a problem, in my master detail form i have set the details rows as 8. can i give an option to the user such as a button, on clicking which he can increase the number of detail rows by say 2 or 3.
    can any one help me out on this???
    Thanks in Advance
    Rajesh

    Hi Rajesh,
    This is not posible in the current model of the portal forms , the no of detail rows can be set only at the design time.
    rahul

  • Create spreadsheet file with a fixed number of rows

    What is the most straight forward way to create a series of spreadsheet files each with a new file name and fixed number of rows.  We have a data acquisition process that creates a new 1D array every 2 seconds.  We'd like to build a series of spreadsheet files each having two hours or 3600 rows of data.  Is there a best way to do this in LV9?
    john

    Use the low-level FileI/O Vis with Write to Text File.vi where you open a new file with every N iteration like this:
    You just have to convert your 1D Array to string before.
    If you would like to have a new file every N hours you should create a FGV which checks the elapsed time using Get Date/Time in Seconds.vi, which is more appropriate for longtime applications.
    Christian

  • How to show  a fixed number of rows in JTable

    Hi,
    I have to show only a fixed number of rows in the table .
    After scrolling number of rows must not be changed.

    I don't understand the question.
    The number of visible rows is dependent on the size of the scroll pane.
    Scrolling does not change the number of rows that are visible.

  • How to display a fixed number of rows in a page when using CL_GUI_ALV_GRID

    Hy experts
    How to display a fixed number of rows in a page when using CL_GUI_ALV_GRID?? lets say 500 ?? because my display table it may contain in some cases 10.000 and evidently I can t see all of them..
    I have a button in my toolbar witch triggers this event
    (display 500 records ) but I don t have the logic to do this only with methods of CL_GUI_ALV_GRID.
    can you tell me a standard method of CL_GUI_ALV_GRID witch can help me do this?? any hint will be good..
    Till now I was used to add a column to my structure witch represents a flag that is a number corresponding to every 500 records (a batch containing 500 records )
    first       500 - flag -> 1
    second  500 - flag -> 2
    etc..but I m convinced that exists a way of doing this more easy..without damaging my structure..
    thanx in advance..don t be shy..reply if you have any hints..

    Hi,
    if method SET_FILTER_CRITERIA doesn´t help, I think that you must work with 2 internal tables, a counter and a loop for filtering the records to be displayed:
    case counter.
      when 1.
         loop at int_table1 from 1 to 500.      "<-- your table with all records
           move int_table1 to int_table2
        endloop.
      when 2.
         loop at int_table1 from 501 to 1000.     
           move int_table1 to int_table2
        endloop.
    etc, etc.
    Call grid-->SET_TABLE_FOR_FIRST_DISPLAY
       exporting
         IT_OUTTAB = int_table2                "<-- instead of your currently table int_table1

  • Fixed number of rows in ADF table

    Can we specify fixed number of rows for ADF table so even no rows displayed it will still show 10 empty rows.

    the rangesize property determines how many rows will be displayed and controls paging. If there are no rows to begin with (if I understand the question correctly) rangesize won't have any effect.

  • Fixed number of rows

    hi,
    all.
    i wnt to dispaly only fixed no of row in output but there  mayee to more record in internal table .how can i do that
    suppose i want to dispaly only 10 record in output but there maye be more that 10 record in inetrnal table,we will
    not fixe in selection query,how we will do that.

    Hi,
    Use a counter and move the fixed number of records to another internal table and display it.
    loop at itab.
    count = count + 1.
    move-corresponding itab to itab1.
    append itab1.
    if count > 10.
    exit.
    endif.
    endloop.
    Now use itab1 to display the output.
    Regards,
    Vikranth

  • How to display fixed number of rows on rtf file

    Hi everyone,
    I have the following requirement. The pdf output should have fixed number of 33 lines in a group by. The rows in group by can vary for each group . For eg: If a group has 3 rows , the pdf output should print 3 lines and 30 empty lines, and if group has 2 lines, the out put should print 31 emty lines.
    can anyone please help me with this requirement?
    Thanks
    Sunny

    Take a look at this blog post: http://blogs.oracle.com/xmlpublisher/entry/anatomy_of_a_template_i_fixed
    Thanks,
    Bipuser

  • How to Efficiently Sample a Fixed Number of Rows

    Good afternoon. I need to select a specific number of random rows from a table, and while I believe my logic is right it's taking too long, 30 minutes for a routine data size. Hopefully someone here can show me a more efficient query. I've seen the SAMPLE function, but it just randomly selects rows on a one-by-one basis, without a guaranteed total count.
    This is the idea:
    INSERT INTO Tmp_Table (Value, Sequence) SELECT Value FROM Perm_Table, DBMS_RANDOM.VALUE;
    SELECT Value FROM Tmp_Table WHERE ROWNUM <= 1234 ORDER BY Sequence;I'd need to put the ORDER BY in a subselect for ROWNUM to work correctly, but anyway that's just an illustration. My actual need is a little more complicated. I have many sets of data; each set has many rows; and for each set I need to return a specific (different) number of rows. Perhaps project A has three rows in this table, and I want to keep two of them; project B has two rows, and I want to keep one of them. So I need to identify, for each row, whether it's valid for that project. This is what my data looks like:
    Project Person  Sequence Position Keeper
    A       Bill    1234     1        Yes
    A       Fred    5678     3        No
    A       George  1927     2        Yes
    B       April   5784     2        No
    B       Janice  2691     1        YesI populate Sequence with random values, then calculate the position of each person within their project, and finally discard people who's Position is greater than Max_Targets for the Project. Fred and April have the highest random numbers, so they're cut. It's not the case that I'm just trimming one person from each project; the actual percentage kept will range from zero to 100.
    Populating the list with random values is not time-consuming, but calculating Position is. This is my code:
    UPDATE Tmp_Targets T1
    SET Position =
      SELECT
       COUNT(*)
      FROM
       Perm_Targets PT1
       INNER JOIN Perm_Targets PT2 ON PT1.Project = PT2.Project
       INNER JOIN Tmp_Targets T2 ON PT2.Target = T2.Target
      WHERE
           T1.Target = PT1.Target
       AND T2.Sequence <= T1.Sequence
      );The Target fields are PKs, and the Project and Sequence fields are indexed. Is there a better way to approach this? I could write a cursor that pulls out project codes and performs the above operations for each project in turn; that would be logically simpler and possibly faster. Has anyone here addressed a similar problem before? I'd appreciate any ideas.
    This is on 9.2, in case it matters. Thank you,
    Jonathan

    You've not given any indication of how max targets for a given project is determined, so for my example I'm using the ceiling of 1/2 of the number of records in each project which gives the same number of yes and no responses per project as you had:
    with dta as (
      select 'A' project, 'Bill' person from dual union all
      select 'A', 'Fred' from dual union all
      select 'A', 'George' from dual union all
      select 'B', 'April' from dual union all
      select 'B', 'Janice' from dual
    ), t1 as (
      select project
           , person
           , row_number() over (partition by project order by dbms_random.value) ord
           , count(*) over (partition by project) cnt
           , rownum rn
        from dta
    select project
         , person
         , ord
         , cnt
         , case when ord <= ceil(cnt/2) then 'Yes' else 'No' end keep
      from t1
      order by rn
    PROJECT PERSON ORD                    CNT                    KEEP
    A       Bill   2                      3                      Yes 
    A       Fred   3                      3                      No  
    A       George 1                      3                      Yes 
    B       April  1                      2                      Yes 
    B       Janice 2                      2                      No  
    5 rows selectedIn this example I use an analytic function to assign a random ordering for each record within a project in the middle query, in the final output query I am determining the yes no status based on the order within a project and the count of records in the project. If you had a table of projects indicating the thresh hold you could join to that and use the thresh hold in place of the ceil(cnt/2) portion of my inequality in the case statement.

  • Unable to setup fixed number of report columns based on a dynamic query

    Hi guys, I need to find a way to replicate below output. Unfortunately it cannot be done using the column group feature due the fact it will create not so many rows as I need. In the below case it would create
    only four columns. I need 10 columns. Basically for 100 m 6 columns would remain blank . 8 for 200 m .I'm using SRSS 2008R2
    Query results:
    Race Name Ranking
    100m Andrew 1
    100m Rachel 2
    100m Chris  3
    100m  Drew 4
    200m John 1
    200m  Billy 2
    Report output should look like:
    Race    1 2    3 4 5 6 7 8 9  10
    100m  Andrew Rachel Chris Drew
    200m John Billy
    Any suggestions?

    As I understand, you want a fixed number (10) of columns and you want them whether or not there are 10 rows returned by your dataset for a given race.
    What is your dataset?
    What if your dataset returns 15 races of a given type? Do you want 15 columns then?
    Assuming your dataset is TSQL, you can use a matrix in your report if you tweak your dataset query. First, you need to add a "default" set of data that guarantees your 10 columns. This can be done with a set of UNION statements:
    UNION
    SELECT '100m' AS Race, '' AS Name, 1 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 2 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 3 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 4 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 5 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 6 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 7 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 8 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 9 AS Ranking
    UNION
    SELECT '100m' AS Race, '' AS Name, 10 AS Ranking
    This gives you the 10 columns. In the matrix, set row group to Race and column group to Ranking. Set the intersecting detail cell to:
    =Max(Fields!Name.Value)
    This will give you 10 columns unless you have more than 10 rows returned for a given race.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Displaying page total on a page with fixed number of lines

    Hi ,
    My requirement is to have a fixed number of rows per page (say 20) and to have a page total beneath the table containing the data.I am using a RTF template.The columns in the table are
    Order
    Amount
    Page Total : 3000
    For including a page-break after 20 lines, i have added the following code.
    For - each ______________
    <?if:position() mod 20 =0?> <xsl:attribute name="break-before">page</xsl:attribute> <?end if?>
    end - for_______________
    This limits the no of rows per page to 20.
    I have tried 2 ways to display the page total but both don't seem to work Can someone please point what i am missing here?
    1) Using add and show-page-total
    I added the code (<?add-page-total:at;'Amount'?> to the Amount data column in the template and then used the <?show-page-total:at?> in the page total data column to display the total. But this doesnt work.It doesnt display any value.
    2) Using Variables:
    I declared a variable (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', 0)?>) before the table. Then, i used the (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', xdoxslt:get_variable($_XDOCTX,'RTotalVar') +Amount)?>) in the Amount data column to calculate the sum. I then used <?if:position() mod 20 =0?> <?xdoxslt:get_variable($_XDOCTX, 'RTotalVar')?><?end if?> in the data column of the page total. But this doesnt work.  The variable loses its value when it is displayed outside the table. Why is it so? How can i declare a global variable? I am not sure why the variable loses it value when taken out of the table. I would want it hold the value through out the document. Is my understanding correct?
    Kindly help me with this issue.
    Thanks,
    Vidhya

    Hi
    I have the same issue. could anyone provide the link or template. I searched in the forums but couldnt find related to this post.
    please help
    Thanks

Maybe you are looking for