Summary field of subreport used in main report formula calculation

I have a summary field in a subreport that I want to use in a calculation of a percentage using a second summary field in the main report as the denominator.  How do I do this in a new formula?

Thank You Ian Waterman,...
Couple of questions:
Where you say "... in subreport
@ eval
whileprinting records;
shared number x:=your summary
Am I correct that this is to be a new formula created in the subreport design?
What should I put for the "x" in the formula?
Should the "your summary" be:  "DistinctCount of Activated_Survey.Seq.Incident"  which I have showing in the Report Footer of the subreport?
Where in the subreport should I place the formula?  Can it be hidden?
Where you say "In subreport header..."
@reset
whileprintingrecords;
shared number x:=0
Am I correct that this is to be a new formula created in the subreport design?
What should I put for the "x" in the formula?
Where in the subreport should I place the formula?  Can it also be hidden?
Where you say "In the main report in section after subreport..."
I have the subreport sitting up in the main Report Header as I only want the subreport summary field showing. 
In the subreport, I have the Report Header and Details section hidden.
@calc
whileprintingrecords;
(shared number x / main report summary) * 100
Am I correct that this is to be a new formula in the main report?
However, what I need to have happen is that the main report summary field of: "Count of Answered_Survey.Seq.Incident" needs to be divided by the subreport summary field of "DistinctCount of Activated_Survey.Seq.Incident" * 100.
What do I modify in the formula?
Thanks.

Similar Messages

  • Using a subreport field in a main report formula.

    Post Author: testing123
    CA Forum: Formula
    Hi.I have a summary of a field {timesheet_log.labour_cost} in a subreport and a field {project.total_po} in the main report and I want to add the two together in a function in the main report. Both fields are linked to a job which is grouped by the jobs' ID.The subreport contains this formula: shared CurrencyVar myTotal;myTotal := Sum ({timesheet_log.labour_cost}); In the main report I have a formula, myTotal, that reads: WhilePrintingRecords;shared CurrencyVar myTotal;myTotal;  As you can see myTotal is a shared variable which contains the total of all the values in {timesheet_log.labour_cost}. However, when I put the formula myTotal in the group footer for each project, it will only change if there is an actual set of values in {timesheet_log.labour_cost}. If there isn't, it will display the last total of {timesheet_log.labour_cost}. We get something like this: Job           Sum{timesheet_log.labour_cost}           {project.total_po} 10050       0   (no value)                                                  100       10051        400    (Value = 400)                                    492210052        400    (no value)                                              32910053      400   (no value)                                    1111110054      2490 (Value = 2490)                                     24210056      6000 (Value = 6000)                            343410057      6000 (no value)                                    99494 Basically what this is saying is that if there are no values at all (ie NULL) in {timesheet_log.labour_cost}, the formula I have made will use the previous value. What I want to do is set the Sum({timesheet_log.labour_cost}) to zero if there are no labour_costs so that basically the value is reset to 0 if there's nothing there.                           

    Post Author: JKitz
    CA Forum: Formula
    Group it by Job Number and then add the following to the group header:  WhilePrintingRecords;shared CurrencyVar myTotal := 0 Then put the information you have above in the group footer with your formula and suppress the detail section.  That way you will zero it out with each new Job Number

  • How to know how many rows including headers and footers does subreport has from Main Report

    Hi, we are sturuggling with subreports. Main report has 3 subreports, each subreport is inplmented in a group header(3 subreports and 3 group headers). We would like to print a group header under subreport as a column header every page, and need a page break when group number is changed. This report exports a MS Excel(97-2003) report file.
    In main report, [New After Page] is checked under Group Header #1d from [Section Expert]
    In each subreport, [Repeat Group Header On Each Page] is checked under the highest group from [Group Expert]
    Here are two issues;
    Since Crystal Reports has more rows than Excel in one page, colmun header in each subreport is being printed in the middle of the page. It should be printed at the top of the page
    When Subreport has many rows and has to be printed in more than 1 page, a page break is automatically inserted before column header. It should be printed right below column header which is Group Header #1
    We have been trying to pass row counts(count of group header because group header is used as the details) using a shared variable from Subreport 1 to Subreport 2 via main report since Subreport2 cannot predict how many rows Subreport 1 has.
    Here is what we are trying but we are getting an error which is "A constant expression is required here" under main report
    - In Sunreport 1
    whileprintingrecords;
    shared numbervar SubGroupCount := DistinctCount({Table.Field});
    - In Mainreport
    shared numbervar SubGroupCount;
    if(pagenumber) = 1
    then (SubGroupCount)
    else 50
    Is there any solutionss or better ways other than above?
    Thank you,
    Main Report: Group Header #1a --> as Page Header
    Run Date: mm/dd/yyyy                                                                 Report Name
    Main Report Group Header #1b --> Subreport 1
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Goup Header #1c --> Subreport 2
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Froup Header #1d --> Subreport 3
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6

    Thank you for your reply and sorry for my complicated explanations. The report has confidential information, so I replaced to some fake data but I believe you can still see what I am trying to do..
    Main Report
    Subreport 2
    Output1
    Output2: the following page
         --> more rows are printed..
    We have two problems;
    1. The column header in Output2 is supposed to be pronted right below the last row in Output2, however, a page break is automatically inserted. But even in the same output document, it works for some group when it has a few rows..
    2. Since Crystal Reports prints more rows in one page than MS Excel does, Column header is not be printed at the top of the page.
    I tried the way you advised me but it did not work..

  • Passing a variable from subreport to the main report

    Hi guys, was unable to google this, so Im urning to you guys:
    I was wondering whether it was possible to do this:
    I have a subreport taking data from a table. In the main report, in the suppres condition of details section containing this subreport, I need to have a variable containing the total count of rows in that table. I know there are shared variables for that, but the problem is, that the variable in the condition is processed sooner than the one in the subreport.
    Any ideas on this?
    Thanks a lot

    To Sharma:
    Hi, unfortunately I can't. The subreport has its specific position in constallation with previous and following sections and must be right there.
    To Raghavendra:
    Hi, that was my first idea, but the problem is as I explained in my first message.
    To both:
    I have a table in subreport. This subreport is in main report positioned in details section "x". and I want to use that shared variable in the suppress condition of section "x". The problem is that the formula in suppress condition is processed sooner than the formula assigning a value to the shared numbervar inside the subreport.
    and thats what im looking for - a workaround for that. btw im using CR 8.5
    thanks again guys

  • 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.

  • List down all subreports in the main report

    Hi All,
    I am developing reports in Crystal XI R2. I am working on the listing all the subreport names in the main report. I tried to use Filename function but it is not showing any report name even in the subreport itself.
    Is it possible with any work around? Please help.
    Regard,
    Ashish

    Hi ashish
    Do you mean you want to have a hyper link of all the subreports from the main report.
    main report
    subreports
    link1
    link2
    link3
    You can just do like this insert->subreport->select the report name and place it whereever you want. You can select many reports like this.
    Is this answers your question?
    Regards
    usama

  • Using a subreport formula in a main report formula

    Hello,
    I am trying to use a formula that is in the subreport and also a formula that is in my main report to come up with a percentage.
    ve researched the forums on the internet and couldn't find anything that directly fit my situation.
    - Formula #1: The SubReport formula is the "sum" of a number variable of {JobRecord.ProjectedIssueDate}. This is for the actual amount of job issued.
    - Formula # 2: The MainReport formula is the "sum" of a number variable of {JobHours.StartDate}. This is for the actual amount of jobs completed.
    Issue: I need to create a formula to take the Formula # 1 and Formula # 2 and get a percentage.
    Example:
    9 Jobs Completed in Main Report / 10 Jobs Projected in Sub Report = 90%
    My main report is grouped as follows for both the main and sub report:
    Grouping #1: Start Date
    Grouping #2: Contractor Code
    Grouping #3: Job Type Code
    I need this formula to work on the Grouping # 3 Level.
    Any takers?

    Also, If you want the Percentage and Sum from the Subreport to show beside each other, here's what you need to do:
    1) Create a new Group header 3b section
    2) Move everything except the Subreport on the Group Header 3b section
    3) Get inside the Subreport and suppress all sections of the Subreport
    4) Back in the Main Report reduce the size of this Subreport and make this no bigger than a dot. Reduce the size of the section so it doesn't take up a lot of space.
    5) Create a formula with this code:
    shared numbervar cnt;
    Drag and drop this formula on the Group header 3b so that this shows the sum from the Subreport.
    -Abhilash

  • How to make a common parameter for two subreports in the main report.

    Hi,
    I have a crystal report which has 2 subreports in it. Both the subreports have the same code and I need to create a parameter for Project Cost in both the subreports for filtering the data.
    When i create the same parameter in both the subreports, i see two parameters with same name on my prompt page while refreshing the report. however I just want 1 parameter on my prompt page and data should get filtered in both the reports.
    Can anyone please suggest something, How can I do that? is there a way for sharing same parameter between two subreports?
    Thanks!
    Neha.

    hi Neha,
    here's how to do this:
    1) create a new parameter with the same name on the main report
    2) right click on your first subreport and choose Change Subreport Links
    3) in the Field to Link To list drag over your new main report parameter
    4) open the Subreport Parameter Field to Use select menu and choose your subreport parameter
    5) repeat steps for the 2nd subreport
    now you'll only get prompted once.
    cheers,
    jamie

  • Summarize data from a subreport in a main report

    Good afternoon,
    I'm trying to summarize data from a subreport with data in a main report and I can't get it to summarize all the data correctly. The reports are linked on order number.
    The main report has 3 groups - customer id, batch, order number (in that order). In the detail section I have product and amount. I have the group footer for group order numbers split into two. Footer A has the subreport.
    The subreport has tax code and amount in the detail and I've created a shared variable:
    WhilePrintingRecords;
    Shared CurrencyVar taxtotal := Sum ({@total tax})
    In my main report I created a formula for the shared variable:
    WhilePrintingRecords;
    Shared CurrencyVar taxtotal; taxtotal
    In Footer B of the order number group I have a summary field that is taking the shared variable and adding it to the product amount and creating a total.
    {@taxtotal1} +Sum ({@ext price}, )
    That is all working fine. Where my problem comes in is on the footer for the Batch group. There are 3 order numbers for 1 batch. I have this summary field in the Batch group footer
    ({@taxtotal1} +Sum ({@ext price}, ))
    But it's not calculating correctly. I need it to take all the product amounts and all the tax amounts and add them together, what it is doing is only adding one of the tax amounts along w/ all the product amounts.
    What am I doing wrong? Any help would be greatly appreciated.
    Jeannette

    Hi Jeanette,
    You need to have the running total accumulate into the Batch group as well.  Right now it's just getting the the Tax Total from the last Order Number. 
    In the formula in Footer B of the Order Number, change your formula to: 
    WhilePrintingRecords;
    Shared CurrencyVar taxtotal;
    CurrencyVar batchTaxTotal;
    batchTaxTotal := batchTaxTotal + taxtotal;
    taxtotal;
    Now in your formula in the Batch footer change it to: 
    WhilePrintingRecords;
    CurrencyVar batchTaxTotal;
    (batchTaxTotal +Sum ({@ext price}, {batch}))
    In the Batch Group Header, you will need to reinitialize the total to 0 for the next batch: 
    WhilePrintingRecords;
    CurrencyVar batchTaxTotal := 0;
    Good luck,
    Brian

  • How to layout a subreport based on main report and another subreport!

    Hello all,
    I got an issue how to capture the value at a run time and loop through group in Crystal Report. My project is complicated (main report and sub report using stored procedure with parameters as datasource and a lot of formula fields pass between main report to sub report, but I try to explain it as simple scenario as following:
    School 1
    Main report layout: (Group by Class)
    ===============================================
    Class A
    Sub report: ( This result from the stored procedure at run time and only having two rows when running stored procedure)
    Boy : 200                  
    Girl : 150
    ================================================
    Class B
    Sub report
    Boy: 50
    Girl: 100
    =================================================
    Class C
    Sub report 
    Boy: 259
    Girl: 80
    Please pay attention on the above layout what I am done on reports. My question is how to produce another report that used the previous values and having the following layout:
    School Summary
    Class  |  Boys  |  Girls  |  Student
    A        |   200    |  150   |     350
    B        |     50    |  100   |     150
    C        |   260    |    80   |     340
    Please give me some ideas how to solve above problem. I know that Crystal Report can use shared variables via formula fields. I am wondering whether or not how to capture the specific value at the run time? Is it posible to make it working in Crystal Report or I have to write a stored procedure in the backend??? Thanks in advance.

    Hi,
    When we look at your report lay out, for each class group you have boys and girls count which is coming from sub report.
    I think you placed the sub report in the Class group and linked with Class.  If that is the case you will get all information in the sub report itself.
    In the sub report, create a running total with shared variables and bring this value to main report to display at the end of the report.
    Eg: To get Class from sub report to main report :
    Whileprintingrecords;
    Shared stringvar class;
    class:=classchar(13);
    Place this formula in your sub report group and create one more formula
    Whileprintingrecords;
    Shared stringvar class;
    class;
    Place this formula in your main report report footer, this will bring your classes into main report. Follow the same process for boys and girls numbers.
    Thanks,
    Sastry

  • Crystal report-can not show all subreport records in main report.

    Hi,
    I have a mian report (summary) which link to a subreport (details). when I preview that subreport, I have 100 records inside. but, when I preview with main report, only first part of records displayed (first 60 of subreport records).
    I took out the link between main and subreport but the result still same.
    Anyone can help? it is weird.....
    Thanks
    Kevin T

    Hi Kevin,
    I am not able to replicate the problem u r facing.I created a report with Group on country and  added a subreport in the Group Footer. My subrepor has more than 270 records. I'm able to see all of them. They are spread across pages.
    Please check whether records are spread across pages or the link between Main Report and Subreport is filtering out some records. Other than these two things I dont see any other reason for records being truncated.
    Hope this helps!

  • How to export subreports along with main reports in crystal reports 2008

    Hi
    I am having serious issues in Crystal Reports 2008. While I was trying to export one of my reports(having 3 subreports) in to a pdf file,well only the main report data is getting exported.
    My subreports are  ON DEMAND SUBREPORTS.
    Kindly help me in resolving this issue.
    Thanks in advance
    Sam_dwh

    Thanks Debi for your answer.
    Well now I am thinking of publishing the reports which I have generated ,so that client need not have to install crystal reports individually in their computers.But I don't have BO portal as such for publishing.
    What will I do?

  • Link subreport to the main report in Crystal

    Hi expert,
    I have a Crystal Report with a row that cointais a Total Field.
    Is possible to add a hypertext link, that open a subreport with all the details?
    Exaple: CardCode: C00001 Account Balance: 14120,50. If i click on the Total of account balance, i open a subreport (linked with the key). Is the same of drill down (perhaps), but I can't use drill down.
    Anybody can help me??
    Regards
    Marco

    Marco,
    try the following:
    make the report into the structure of:
    Group: CardCode
    In the group header delete your group name field, and add your subreport.
    Right click on the subreport, and on format subreport.
    On the subreport tab, there is an option: on demand subreport. Check that in.
    After that you can define a formula ( for example your cardcode ) at On-demand Supreport Caption.
    Hope this helps.
    Regards,
    D

  • Controlling Record Selection for Subreports from the Main Report

    Post Author: Horizon57
    CA Forum: Formula
    Hello - I am generating a standard report template that will be applied to all of my accounts and I am connecting to an Access DB that has multiple tables. Each table corresponds to a single Subreport within my Mainreport and contains the data for all of the accounts. Essentially I would like to be able to write some logic in the Formula section of my Mainreport whereby I can control which account to run the report for based on the Account Name.  I am having sucess with this method when I change the parameters of the formula in each subreport, but how do I modify my code to allow me to control this from the mainreport.  An example of a formula is below. // Account AAA//{Subreport1.Account } = "AAA" and {Subreport2.Account } = "AAA" and {Subreport3.Account } = "AAA" and {Subreport4.Account } = "AAA"// Account BBB//{Subreport1.Account } = "BBB" and {Subreport2.Account } = "BBB" and {Subreport3.Account } = "BBB" and {Subreport4.Account } = "BBB"// Account CCC//{Subreport1.Account } = "CCC" and {Subreport2.Account } = "CCC" and {Subreport3.Account } = "CCC" and {Subreport4.Account } = "CCC" Essentially, I am looking to just uncomment the particular Account I would like to produce the report for and have that filter down to all the subreports. How do i Modify the logic? Is there a better way to approach this?

    Post Author: Horizon57
    CA Forum: Formula
    Thanks for all the responses..... Just to clarify, I am essentially trying to control the record selection of each subreport with a forumula in the mainreport. To this end I am trying to avoid having to modify the formula in each subreport to change accounts each time i need to run a set of reports. I am still not having any luck modifying the subreport links as mentioned above. The only way I have been able to control the data is with formulas in each subreport. If anyone has accomplished what I am attempting, could you post an actual formula from both the subreports and mainreport so I can try to mirror them. Also, if anyone can point me to an example where I can integrate a dialog box to automatically control the record selection (as mentioned above), that would be great. Thanks,Mike

  • Summary fields on chart expert

    Post Author: training2go
    CA Forum: Charts and Graphs
    Hello,
    I noticed that summary fields that are used on the report do not appear on the chart expert as a field that you can select. Did I do something wrong or is this the way the chart expert works in Crystal Reports 2008? Thank you.

    Hi, Anne-Marie;
    You may be running into a common issue that is docuemented here:
    [SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333833393335%7D.do]
    Regards,
    Jonathan
    Edited by: Jonathan Parminter on Mar 16, 2009 8:03 AM

Maybe you are looking for

  • Intel iMac Power / Overheat issue?

    Hi there, I have an Intel iMac from 2006. About 2 years ago it started to just turn itself off randomly as if there was a power failure. When it does, the only way to power it back up is to switch it off at the plug, switch it back on and press the p

  • Is there a way to password protect the access options pannel, in particular the Connection Settings?

    Is there a way that access to the Options panel can be locked by an administrator. In particular I would like to block a user from being able to change the proxy server settings in Tools > Options > Advanced > Network > Connection Settings. I would l

  • Adapter module to insert into DB

    Hello, is it possible to write an adapter module which will insert whole payload into predefined table in DB? Can you please provide me hints, how to do it? Is it possible to use Java JDBC API in it, or do you have any best practices/cookbooks? The r

  • RAID-5 over RAID-1, with encryption

    I'm planning to restructure my fileserver.  It has (well, will have) 8 hard drives for data, each 1.5 TB in size.  I want to create 4 mirrored pairs, and then place each pair in a RAID-5 array, for a total usable space of 4.5 TB.  I want to place enc

  • Install and run blazeds-turnkey-3.2.0-3978 in Tomcat on Linux

    I Installed and ran the  blazeds-turnkey-3.2.0-3978 distrubution in Tomcat 5.0.27 with JVM  1.5.0_22 in my laptop (Window Vista Pro) successfully. Blazeds, ds-consolo, and  samples applications are working fine. I'm not using  Flex Builder for this.