Can a subreport select records based on values in the main report record?

Post Author: calvin
CA Forum: General
Perhaps my understanding of a subreport is incorrect as this is the first time I've used one, but it seems to me that the subreport should be able to use the values from the main report record in its (the subreport's) operations-but my subreport doesn't seem to be working that way.In my main report, I select a set of records from a 'request' table. I have a subreport in the detail section so the subreport is processed for each of the request records. That works, but I'm simply getting the same data reported multiple times. It's as if the subreport only uses the last request record rather than the current one. Stating it this way I can see that the problem might be evaluation time-it's processing the request records first, then processing the subreport, and only then printing everything. If this is correct then putting WhilePrintingRecords on the subreport should work-but the only way I know of to do that is in a formula. Can I call the subreport from a formula? Or am I totally off-track?Thanks.

Post Author: foghat
CA Forum: General
Have you established a link(s) between your main report and subreport?When viewing the main report, click edit --> subreport links and link the 2 based on whatever values from the main report you want.

Similar Messages

  • How can i transfer a field value in the main report to its sub-report?

    <p><font face="Arial" size="2">How can i transfer a field value in the main report to its sub-report?</font></p><p><font face="Arial" size="2">Please eloberate with example if possible!</font></p><p><font face="Arial" size="2">Thanks...</font></p><p> </p>

    <p>You can do a couple of things - one would be to pass the information using the data linking expert.  Right click on the subreport, choose &#39;Change Subreport Links&#39; and select the field(s) you are wanting to pass to the subreport.  CRW will build parameters and a record selection formula for you in the subreport, and if that&#39;s what you want, then great.  But you can also remove the selection formula from the subreport and work with the parameter fields in the subreport however you would like.</p><p>Alternatively, you can look to passing Shared variables back and forth from the main and subreport.  this link talks about the method to do this: http://diamond.businessobjects.com/node/251</p><p> </p>

  • Refreshing subreport data on change of group in the main report

    I have created three comma delimited strings in a subreports and then introduced them to the main report. The subreports are simple with no groups. I have one subreport for Authors, one for Departments and one for Schools. This is ok if I filter the data down to one publication. If I remove the filter then I get every instance of each of the subreports. ie all authors in a comma delimited string, all departments and all schools.
    I have two groups in the main report, Publication Year (Group #1) and Publication Title (Group #2). This is where I have the problem. The data coming from the subreports show all instances as mentioned above. I want the subreports data to refresh each time the group changes. I need it to only show the necessary comma delimited string for each publication, not every instance.

    Hi Abhilash,
    The logic has worked correctly but the performance is really poor. Is this because I have there subreports doing similar funcitons? Is this a topic for another discussion?
    Also, when I try to export the report to xls data only it starts the export but then a msg comes up on the screen relating to the second formula you gave me for comma delimited strings for schools:
    SAP Crystal Reports
    String length is less than 0 or not an integer.
    This relates to the third line in the code:
    Left(schools, len(schools)-2);
    It then aborts the export. Is this a topic for another discussion also?
    Thanks

  • Linking Subreports based on group in the main report

    Hello,
    I have a main report that groups by department, month, and then employee name.  I put a subreport in at the month and name level (it brings back statistics for a particular employee for the chosen month).  The subreport is based on a completely different set of data.  I want the subreport to pull just the data for the individual month and employee into that employees monthly section.  How do I link the subreport?  It seems like it should be pretty straightforward, but I can't get it to work.  Do I need to set up groups in the subreport?  I am a beginner and appreciate your help.
    Thanks,
    Al

    How I would do it is as follows
    Create a Formula Field and choose the group name e.g.
    GroupName ({migsol_oppact.COMPANY})
    Then link the sub report using that Formula Field

  • Filter child report based on filters in the parent report

    My requirement is as follows:
    I have two reports, parent and child. Parent report just shows Account Name, Time Spent on Account and it's percentage, so when you click on Account Name, child report is displayed filtered based Account Name and it shows the breakdown in time-spent i.e. different Project Types. So I am filtering Parent reports using Column Prompts(namely Date Range, Task Status, Project Status). So far this works fine. Now when I drill down on Account Name, child report displaying total time spent which I don't need. Child report should get filtered based filter values in the Parent report.
    Can someone please help me out of this situation.
    Thanks in Advance.

    Hey,
    This is tricky to trouble shoot. Firstly ensure all of your child report columns are set to 'Is Prompted' through the filter and try again. If this doesn't work then open your parent report and save another copy (also make sure things are 'Is Prompted' in your new copy and make sure your Intitial parent report navigation points to your new parent report). Drill from the initial parent report to the new one you just created, if this works and filters then build out your new parent report with all the fields you need to eventually become your new child report.
    Thanks
    Oli @ Innoveer

  • Data Passing from a Subreport to the Main Report

    <p>Hello,</p><p>I have been able to pass data from a subreport to a main report using shared variables. The Complete Reference: CR XI (p. 313) states that you should be able to now suppress the subreport to prevent it from showing on the main report, however this is not working. I want to get the data from the subreport and then further manipulate it in the main report, and I do not want the subreport shown on the main report. I tried suppressing/hiding the section where the subreport is placed as well as suppressing the subreport itself. The formula values on the main report become null when I do this though. Is it possible to keep the subreport off the main report?</p><p>Thanks.</p>

    Search forums, this has been answered multiple times.

  • Excluding records based on values

    Hi all;
    I have this datasource where there let's say there are several records with fields company code, costcenter, cost element, fiscal year, closing date etc. I need to select all records from that table excepts the ones which has the values on closing date. what I mean is I am not supposed to extract the records which has values on the closing date....how should I handle this scenarios...?

    hi:
    If the data source is a generic based on VIEW, you can add this in the selection Conditions:
    Closing Date EQ " ".
    NOTE: Use the FIELD name for CLosing Date.
    Ram C.
    Message was edited by: Ram Chamarthy
    Message was edited by: Ram Chamarthy

  • Get data in a subreport based on a shared variable from the main report.

    Goodd morning,
    My question/problem is how to manage this scenario.
    I am transfering 2 shared variables (pereiod from /period To, ) from the main report to a subreport and now  i would like to get data in this subreport based on these 2 variables...
    The problem is that i can not find the shared one in select expert icon...
    Could anyone point me to solve this issue?
    Thks for any help.
    Jose Marin
    Crystal Report XI SR3

    Hello Jos,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Passing different (multi-) values for parameters to drill-through report, based on clicked subtotal in main report

    In Report Builder 3.0, I have made a main report in which the user can filter the underlying dataset using three parameters (all multi-value). The report shows totals grouped by these three parameters, as well as a grand total. What I want is to click
    on a total, which then opens the drill-through report for the corresponding records. I have achieved this for the grand total; the action in the corresponding text box passes all selected values of the parameters to the drill-through report.
    What I cannot figure out is how to make this work right when clicking on a subtotal. When I use the same expression as for the grand total, the same values for the parameters are passed, instead of the subset that apply to the corresponding text box in the
    main report. I expected this to work, because Report Builder /does/ correctly calculate the SUMs for the different levels, even though the expressions are the same.
    My question is: how do I pass different drill-through (multi-) values for parameters, corresponding to the respective subtotals in the main report?
    (FYI: I am using Microsoft SQL Server 2008 R2 and Report Builder 3.0 .)

    Hello Katherine,
    Thanks once more for your quick reply.
    I was aware of the textbox action "Go to report", and how to pass parameters in general. My question concerned how to determine the scope of the passed multi-value parameters (to the values that apply to the respective group/subtotal). The article you linked
    to is informative, but not a solution to my problem.
    A colleague of mine came up with a pragmatic solution: instead of trying to determine the scope of the parameter values, now I "look to the left in the results table". The two screenshots below should illustrate this. (Screenshots are in Dutch. Specific information
    is pixelated.)
    Unfortunately, I am not able to post images. Once my account is verified, I will edit them in. For now, I hope the text speaks for itself enough.
    [Screenshot: Drill-through parameters - 01: Report Builder tablix with subtotals]
    [Screenshot: Drill-through parameters - 02: Textbox properties (selected in screenshot 01) - Action - Go to report]
    The first screenshot shows the tablix in the Report Builder. The second screenshot shows the properties of the textbox selected in the first.
    Notice that I do not pass parameters for the first two columns, but the actual values. I only pass the parameter (containing /all/ user-selected values) for the third column. In the textbox below the selected one, I pass the actual values for the first column,
    and parameters for the last two. In the textbox above the selected one, I pass the actual values for all three columns.
    The only (cosmetic) flaw this approach has is that in the drill-through report, the list of selected parameters might show values that do not occur in the (corresponding part of the) results, and only for those parameters for which the main report passes (all
    user-selected) parameter values, and not the actual values in the results. The results are correct, though.
    If there is a way to directly determine the scope of multi-value parameters for passing to a drill-through report, I would still like know. But for now, this seems to work.

  • Passing selection screen values to the next report using CALL TRANSACTION

    Hi experts,
    I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.
    I want to display in the next report the selections that the user previously selected.
    First report:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
    PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
    PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
    SELECTION-SCREEN END OF BLOCK b1.
    CALL TRANSACTION 'ZKKBC_PKO_2'.
    Anyone can help me?
    Thanks,
    Lawrence

    Hi experts,
    What i did is this:
    Using SET PARAMETER
    in the first report
    SET PARAMETER ID 'WRK' FIELD COMP.
    SET PARAMETER ID 'VPE' FIELD PERIOD.
    SET PARAMETER ID 'GJR' FIELD YEAR.
    CALL TRANSACTION 'ZKKBC_PKO_2'.
    Second Report
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: WRK     LIKE AFRU-WERKS.
    PARAMETERS: VPE     LIKE COEP-PERIO.
    PARAMETERS: GJR     LIKE COEP-GJAHR.
    SELECTION-SCREEN END OF BLOCK blk1.
    Using SUBMIT
    First Report
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
    PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
    PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
    SELECTION-SCREEN END OF BLOCK b1.
    SUBMIT ZCO_PRDCOST_ACTUAL_2 VIA SELECTION-SCREEN USING SELECTION-SETS OF PROGRAM 'ZCO_PRDCOST_ACTUAL_1' AND RETURN.
    Second Report:
    GET PARAMETER ID 'WRK' FIELD comp.
    GET PARAMETER ID 'VPE' FIELD COEP-PERIO.
    GET PARAMETER ID 'GJR' FIELD YEAR.
    Either this 2 ways i still cannot get the first report selection values on the 2nd report. Can someone help me see if my codes is correcT?

  • How to use a subreport field as selection criteria for the main report

    Dear All,
       I created a report with one subreport and im comparing information from both reports but i need to apply selection criteria in the main report using one of the fields in the subreport, the problem is that the subreport field doesnt appear in the select expert screen. By any chance, someone knows how make a subreport field be used by the select expert.
    Thanks,
    Martha Medrano

    Dear Dom,
       I created the subreport table called IIM (748 items) in sql in the main report as you suggested with the below code:
    SELECT "IIM"."IPROD", "IIM"."IDESC", "IIM"."IID"
    FROM   "S102F360"."BPCS405CDF"."IIM" "IIM"
    WHERE   NOT ("IIM"."IDESC" LIKE 'GEN%' OR "IIM"."IDESC" LIKE 'OBS%') AND "IIM"."IID"<>'IZ' AND "IIM"."IPROD" LIKE '3%'
    and i have another table called ITEM_MASTER (3221 items):
    SELECT "ITEM_MASTER"."ITEM_ID", "ITEM_MASTER"."DESCRIPTION"
    FROM   "WHSPRO"."dbo"."ITEM_MASTER" "ITEM_MASTER"
    ORDER BY "ITEM_MASTER"."ITEM_ID"
    and im trying to display all items in the ITEM_MASTER table that are not in the IIM file but i haven't been able to accomplish this, i am using as primary the ITEM_MASTER table with 'Inner Join' as Join Type,  and '!=" as Link Type. Do you have any ideas on how can i display the requested items.
    Thanks for your help

  • Calling multiple sub-reports based on the values in a column in the main report

    All,
    Say, I have a main report with 4 parameters and 8 columns in it's tablix, there is 1 column in this main report that can have 3 values, say A,B,C. If the user clicks on "A", he will be directed to Subreport A, clicks on "B", he will be
    directed to Subreport B and if he clicks on "C", then he'll be taken to Subreport C. All works fine when I call subreport A and B from that column, because both of them have the 4 parameters that we can map back to the parameters of the main report
    in the "Go To Report" section.
    Now, for Subreport C, I'll need to map all those 4 parameters + I will also need to map the parameters in my Subreport C to the FIELDS in the main report. Subreport C has 8 parameters, so 4 of them get mapped to the parameters of the main report and
    the other 4 get mapped to the fields in the main report.
    Now, when I call the Subreport C from my main report, that runs fine, but, I get an error when I try to call my other subreports A and B. The error says "Parameters in the subreport are not defined", probably because it tries to map the fields
    in the main report to the non-existing parameters in mu Subreport A and B.
    Any ideas/suggestions/workarounds would help a lot. Also, if someone can point me to a link where multiple subreports are being called from the column of a main report would be a great help too.

    One simple solution would be to add the additional 4 parameters to subreports A and B. Just don't use them.
    I assume you are calling the subrebort using Go to report action property of the tablix cell control. Try switching to Go to URL. Then use expression builder to dynamically create your url:
    ="http://YourReportServer/Reports/Pages/Reports.aspx?ItemPath=%2fYour%2fReport%2fPath%2fReport"+Fields!Column1.Value+"&Parameter1Name="+Parameters!Param1.Value+"&Parameter2Name="+Parameters!Param2.Value+"&Parameter3Name="+Parameters!Param3.Value+"&Parameter4Name="+Parameters!Param4.Value+IIf(Fields!Column1.Value="C","&Param5="+Fields!F1.Value+""&Param6="+Fields!F2.Value+""&Param7="+Fields!F3.Value+""&Param8="+Fields!F41.Value,"")
    Now this is a rather long formula which is why I prefer just adding the other 4 parameters to all of the subreports but this expression opens the report from the url and only when Column1 field is "C" does it also pass the additional 4 parameters.
    "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.

  • Value in the subreport used by the main report?

    How do I make so that a value in the sub-report can be used by the main report? Is there a way to make the subreport values "global"?
    I am working from an older version of Crystal. Please let me know if this is self-explanatory in the newer versions.
    Esther

    Hi,
    You can create a shared variable and assign the value to that in the sub report and same can be used in main report.
    For more info on how to use shared variables, please check this under section Shared variables.
    Thanks,
    Raghavendra

  • Supress details in subreport based on date ranges in main report

    I am using Crystal XI R2 and am working with Human Resources Data.
    The main report is grouped on and generates a list of temporary teaching positions like this:
    Smith, John
         FTE_____Start Date_______End Date
          .3 ______09/01/2007______10/20/2007
          .2 ______10/05/2007 ______04/15/2008
          .2 ______04/01/2008 ______06/30/2008
    The subreport (generated from a different source, but linked to main report on ) generates a list of days the employee worked as a Teacher on Call:
         TOC Date______ Portion of Day Worked
         09/05/2007______1.0
         09/19/2007______0.6
         10/08/2007______0.4
         10/09/2007______1.0
          04/08/2008______0.6
          04/18/2008______1.0
    Employees are granted seniority for TOC days worked, EXCEPT when they are already employed in a Teaching position >=.4 FTE  (because they are already granted full seniority for that period), so I need to be able to suppress records that fall within date ranges listed in the Main Report where the combine FTE is >=.4.     
    I believe this question has two parts:
    1. how do I evaluate the date ranges to combine overlapping periods?  Results would look like this... (I don't need to be able to see this, but I'm assuming I'd have to create a date range with the results in order to answer question #2 - but I haven't worked much with ranges.)
        FTE_____Start Date______End Date
          .3______09/01/2007______10/04/2007
          .5______10/05/2007______10/20/2007 
          .2______10/21/2007______03/31/2008
          .4______04/01/2008______04/15/2008
          .2______04/16/2008______06/30/2008
    2. how do I supress the TOC dates in the Subreport that fall within the start and end dates of all the employee's positions >= 0.4 FTE ?  Supreport results for this example would look like this...
         TOC Date______ Portion of Day Worked
         09/05/2007______1.0
         09/19/2007______0.6
         04/18/2008______1.0
    (I will sum the "portion" values and mulitply them by a constant variable to complete the seniority calculation.)
    Thank you in advance for any assistance you may be able to provide!

    Thanks for your help Graham, I have continued to work with this and I took the BO Crystal III course.  Your suggestions gave me a sense of  direction.
    I was not able to share a date range array with the subreport (kept getting error messages saying "call BO" , but I WAS able to share the startdate array and the enddate array.  I also shared the fte values array. 
    I had wanted to use a loop  to check
    if TOCdate in startarray[x] to endarray[x]
    then ftearray[x]
    and  sum the new range of fte[x] values so that I could suppress any TOCdates where fte was >=0.4.   But I couldn't quite get there, I kept coming up with formulas that displayed only the first value or the last or zero.
    So I used the following formula for each index (returnindex value had to be changed for each case), then added them all together.
    shared datevar array startArray;
    shared datevar array endArray;
    shared numbervar array FTEArray;
    local numbervar arraylength:= ubound(startArray);
    local numbervar i;
    local numbervar returnindex :=-1;
    If arraylength >=1 then
    if not({AAATDDET.Date} in startarray[1]to endarray[1])then
    0 else
    if {AAATDDET.Date} in startarray[1]to endarray[1] then
    (returnIndex:= i;);
    i:=i+1;
    if returnindex =0 then
    ftearray[1]

  • How to suppress records with vzero value in a union report in OBIEE?

    Hi
    I have a Union report ,Rep1 union Rep 2,with a cloumn A in rep1 and a dummy column in place of column A in rep 2.
    I want to restrict the records where A= 0 in the union report.
    How to go abouth this.
    Thanks in advance !!

    hi,
    In report1 let the column be as it is ,why are you changing the f(x) to case statement.Did you check is data there in that column of report1.
    In the union report make tat dummy column as 0 or 1 accordingly as per your requirement.So it would retrieve all the values of column of report1.
    Check the join conditions established and play with the joins like give a full outer join and check if the data is coming including 0's if so then you can pply filter on that column saying column not equal to 0,so the remaining values gets populated.
    Cheers,
    KK
    Edited by: Kranthi.K on May 18, 2011 2:03 AM

Maybe you are looking for

  • Wifi issues after 3.1.2 upgrade

    Just upgraded my iphone 3g to the laest software and since then, whilst the phone connects to the network (no chnages to the neywork have been made) it loses connectivity randomly, and when acessing an app that uses the wifi, it just drops out to 3G

  • PLEASE HELP - Ipod Showing In My Comp But Not Itunes Etc

    Hi there Can someone PLEASE help me! I am at my wits end with my Ipod. A few weeks ago I was in the middle of listening to a song and my ipod crashed then switched itself off. Ever since then I haven't been able to get it to connect to Itunes or the

  • Conditional Formula in Customer Statements

    Hi Experts, I would like to be able to show various different office addresses in the header of my customer statements. The addresses are dependent on GroupCode of the BP.  ALL the statements are printed by the same user, so I cannot use different st

  • Connectivity problem with an FM transmitter & bulky case

    Does anyone else have this problem? I want the protection with a case (I have the Speck Toughskin because it protects the best), yet I also want a nice FM transmitter (I have the Griffin Roadtrip, which is extremely crisp & clear). However, when I pu

  • .Mac renewed today, and NOW I can't publish to iWeb.

    I am a long time .Mac user, and saw last night that I had Zero days left to renew. I was still able to upload my site. I renewed .Mac today, and NOW I get a message when uploading my iWeb stuff to sign in to .Mac...Which I already am. The moment I op