Using a subreport to obtain a single value

I have a report with multiple subreports displayed on it, for example:
Main Report
   Revenues SubReport
   Expenses SubReport
   Other SubReport
I need a number from the Expenses SubReport to display on the main report before the Expenses SubReport is printed. To handle this, I added a suppressed copy of the Expenses SubReport in the header of the main report and am using a shared variable to retrieve the value. (I can't simply execute the Expenses SubReport stored procedure to do this from within the main report stored procedure as its already executing a stored procedure itself and SQL Server won't allow and EXEC of a stored procedure with an EXEC in it already). I've added a filter to the subreport as as to retrieve only the single summary line that contains the number I need.
This approach generally works very well. However, there are some cases where the value returned is a zero. If I adjusted the layout of the hidden subreport a bit the value will appear. Why is this? How can I guarantee that the number will appear correctly every time?
Thanks
Carl

looks like Abhilash beat me to the answer again
hi Carl,
i'm assuming that these subs are in the report header. given this assumption, ensure that the hidden subreport is in it's own section. you can use the Format Subreport > Subreport tab option to Suppress Blank Subreport. you can also go to the section expert for where the subeport is and check Suppress Blank Section.
now ensure that the shared variable formula is in a section below where the hidden expenses subreport is. this will ensure that there are no evaluation time issues with bringing the variable back.
-jamie

Similar Messages

  • Missing Parameter Values while using Change SubReport links

    Hi,
    I am using Change SubReport Links to pass data from Main Report to the SubReport. The report works fine at design time when I preview it, but at runtime I get "Missing Parameter Values" error.
    As I have used Chanage SubReport Links do I still need to pass the parameter to the SubReport from the code.
    cr.Export gives this error.
    Below is the code
    ExportOptions crExportOptions;
            DiskFileDestinationOptions crDiskFileDestinationOptions;
            string Fname = string.Empty;
            string strReportName = string.Empty;
            ReportDocument cr = new ReportDocument();
            string strReportPath = Request.PhysicalApplicationPath.ToString() + @"Members\Reports\UnPaidReceipt.rpt";
            if (!System.IO.File.Exists(strReportPath))
                throw (new Exception("Unable to locate report file:\n" + strReportPath));
            cr.Load(strReportPath);
            MtollBLL Unpaid = new MtollBLL();
            cr.SetDataSource(Unpaid.GetUnpaidPayments().DefaultView.Table);
            // Set the Crytal Report Viewer control's source to the report document.
            CrystalReportViewer1.ReportSource = cr;
            MtollBLL Violation= new MtollBLL();
            cr.Subreports[0].SetDataSource(Violation.GetReportViolation().DefaultView.Table);
            // cr.PrintToPrinter(1, False, 0, 0)
            Response.Write( cr.Subreports[0].DataDefinition.ParameterFields.Count);
            Fname = Request.PhysicalApplicationPath.ToString() + Session.SessionID.ToString() + ".pdf";
            crDiskFileDestinationOptions = new DiskFileDestinationOptions();
            crDiskFileDestinationOptions.DiskFileName = Fname;
            crExportOptions = cr.ExportOptions;
            crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
            crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
            crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
            cr.VerifyDatabase();
            cr.Subreports[0].VerifyDatabase();
            cr.Export();//' The following code writes the pdf file to the Clientu2019s browser
    Please Advise.

    Please post your SDK development questions to the Developers forum

  • The range can't be used as a single value.

    Sorry all, a bit new to spreadsheets
    I am creating a budget spreadsheet in Numbers to learn how it all works
    I have a costing for Oil use; 12 monthly columns that are added together to produce a total for the year.
    However there is a standing charge to be added to this for the oil tank and that is £60 per year.
    So I started with a formula that states simply:
    SUM(B6:M6)
    This returns my yearly oil consumption cost but when I amend it to add the standing charge of £60p.a. like this
    SUM(B6:M6)+60
    I get the syntax error message "The range B6:M6 can't be used as a single value"
    I am sure there must be an easy work around for this but I haven't found it yet.
    Anyone got any thoughts ?

    Hmmm - this is quite a bit to take in !
    OK let me ask you about another instance.
    I have a column and at the top I have my Income for that month and below I have expenses incurred during that month.
    What I am aiming to do is out put the profit i.e. Income minys expenses.
    If I do this:
    I get an error
    But if I do this
    I get a result but obviously it shows my Profit as a negative number.
    That's why I find it strange.
    Simply reversing the order of the values stops the formula working.
    In one case the "range" (B3:B8) is producing a number value, and in the other it isn't.

  • Unexpected behaviour in case of single value selection by using share point excel service

    If multiple values are passed to pivot table filter using share point excel service, filter is showing “multiple” text on filter. If user expands the filter, the passed values are showing as checked ones.
    Example: ‘India’ and ‘US’ values are passed ‘Country’ filter of pivot table using excel services. Filter is showing ‘multiple’ text on filter and if user expands the filter, ‘India’ and ‘US’ values are showing as checked ones.
    If single value (India) is passed to pivot table filter using share point excel service, filter is showing value text (India) on filter. If user expands the filter, all values are showing as checked ones.
    Ideally it should show ‘India’ as checked one.

    If multiple values are passed to pivot table filter using share point excel service, filter is showing “multiple” text on filter. If user expands the filter, the passed values are showing as checked ones.
    Example: ‘India’ and ‘US’ values are passed ‘Country’ filter of pivot table using excel services. Filter is showing ‘multiple’ text on filter and if user expands the filter, ‘India’ and ‘US’ values are showing as checked ones.
    If single value (India) is passed to pivot table filter using share point excel service, filter is showing value text (India) on filter. If user expands the filter, all values are showing as checked ones.
    Ideally it should show ‘India’ as checked one.

  • Variable multiple single value filled with customer exit used in FOX form.

    Hi guys, I definitly need your help in the following scenario:
    I have variable (multiple single value) filled in a customer exit and use it in web template. There it is used in the drop down box for selecting a special date in the analysis item. And there comes the first question:Why the results from the customer exit are written in the way "date1; date2; date3" in one line? They should appear line by line in rows. How can I influence that? I tried both data binding types, "variable" and "characteristic".
    Now a button raises a planning function with a fox formula which should write the selected date (from the drop down box) in a customer table using "call function".
    I always get the error, that I need to restrict the variable to "single value". Why do I have to do that and if necessary how can I do that? Other planning functions without the fox formula also work properly with using the selection from the drop down box.
    I appreciate you help.
    Kind regards, Anja.

    Hi Vamsi.,
    Try this code.
    WHEN 'PREVIOUS_YEAR_1'.
    IF I_STEP = 2. "after the popup of user entry
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZCURRENT_YEAR_PERIOD'.
    break-point.
    IF SY-SUBRC EQ 0.
    WA_YEAR = LOC_VAR_RANGE-LOW+0(4). "Year
    WA_MONTH = LOC_VAR_RANGE-LOW+5(3). "Period
    WA_YEAR = WA_YEAR - 1.
    CONCATENATE WA_YEAR wa_month INTO WA_FISC_PERD .
    CONCATENATE WA_YEAR WA_MONTH1 INTO L_S_RANGE-HIGH .
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    endif.
    Assing points if it helps you.
    -- Selva

  • Several single value selection in InfoPackage Data selection using Routine

    Hi,
    I am trying to extract data from a table(containing Ticket data) in R/3 using Generic extractor with table. As the table is not supporting the delta functionality i have to do daily full load for more than 5 lak records.
    I dont want all the tickets from R/3, i just need the tickets which are open. Unfortunately there is no field in R/3 table which indicates Ticket status. But in BW i have a DSO where i can get the tickets along with their status.
    Now what i want to do is:
    in the Infopackage i want to give the dataselection for ticket, whose status is open which will be calculated in ABAP code by lookup to the DSO. Is this possible?
    I know that in ABAP routine for Data selection we can give single values and range values. but here i just want to give several single values. That means if suppose i have 4 tickets T1,T2,T3,T4 in the DSO and if T1 and T4 are open tickets, then i have to get the data from R/3 just for T1 and T4.
    in the above case if we use range then the low and high values in the range will be T1 and T4 respectively and the data pulled from R/3 will be from T1 - T4 ie all T1,T2,T3 & T4. but i need just T1 and T4.
    Please share your ideas. also please send the code as i am not an ABAPer.
    If Several single value selection is not possible at least send the code for the range values.
    Thanks,
    Cnu.

    you can write a code like this in the ABAP routine in data selection in front of ticket characteristic
    types: Begin of s_ticket,
         ticket type <type of ticket characterisitcs>,
          End of s_ticket.
    data: l_idx like sy-tabix,
          wa_ticket type s_ticket,
          it_ticket type standard table of s_ticket,
          l_s_range type rsrdrange.
    You can declare
    read table l_t_range with key
         fieldname = '<your field name for ticket>'.
    l_s_range-infoobject = '<infoobject name>'.
    l_s_range-fieldname = '<field name of ticket cahracteristics>'.
    l_s_range-sign = 'I'.
    l_s_range-option = 'EQ'.
    select * from <ODS active table> into table it_ticket where status = <value for open status>.
    if sy-subrc = 0.
         loop at it_ticket into wa-ticket.
              l_s_range-low = wa_ticket-ticket.
              append l_s_range to l_t_range.
         endloop.
    end if.
    p_subrc = 0.
    you need to modify it as per your requirements, i hope this might help you.

  • How do I create a summary sheet of Group values without using a subreport?

    Hello,
    I have a report (CR 2011 over MySQL) that churns through a lot of data. It presents information in the Details section and the Group Footer section. I want to include a summary sheet as the first page that only shows the Group Footer data. The only way I've figured out how to accomplish this is by putting the same report as a subreport into the Report Header and then suppressing the details section. I don't like this approach because the same data-intensive report is actually running twice now.
    I can't just use the "Hide" feature in the Details Section because when I run the report (from the .NET viewer) none of the details print. To print the details I would have to double-click on each Group Footer which launches a new tab with the details for that particular group only.
    I know how to create shared variables so not sure if that can play a part.
    Thanks in advance for tips in keeping this to one report with a summary page!
    Mark

    Hi Mark,
    What kind of summary functions do you use on the Group Footer? As long as they're basic summaries (no print time functions etc), you could just move them to the Group Header. The Group header can then serve as your 'Summary sheet'.
    If these are printime functions that you're dealing with, then there isn't another way other than using a Subreport to show the Summary sheet. The Subreport itself does not need to be against the same dataset though.
    To speed it up, you could perhaps, create a Stored proc that does all the Summarization and use those columns on the report.
    -Abhilash

  • Copy using Variables with multiple single values in BEX

    Hi,
    I have a requirement wherein on executing the planning function, the system should take the FROM and TO values of 0FISCPER and copy the data accordingly.
    Source variable is 'Single Value'.
    Target variable is 'Multiple Single Value'.
    I tried to give the Command Range as below:
    $A$30:$C$31.
    The button sequence is as below:
    VAR_NAME_1      0         ZFISCPER
    VAR_VALUE_1     0
    VAR_NAME_2      1         ZFISCPER_M
    VAR_VALUE_2     1
    In the Analyzer, I entered the values as
    In A30, VAR_NAME_1     0     =C20
    In A31, VAR_NAME_2     1     =C21:C24
    The values that I entered are as below:
    C20 =   2007001 - Source value
    C21 =   2007002 - Target values
    C22 =   2007003
    C23 =   2007004
    C24 =   2007005.
    The problem that Im facing is the system is unable to identify the multiple values that I enter for Target Fiscper and it displays as :#VALUE!
    How to enter multiple single values and reference them accordingly?
    Rgds,
    Shyam

    Hi,
    I have tried to enter multiple single values as below:
    VAR_VALUE_1     0     000  - Source
    VAR_VALUE_1     1     003  -  Target
    VAR_VALUE_2     1     010
    VAR_VALUE_3     1     080
    VAR_VALUE_4     1     099
    When I tried to execute the planning function, the system copies the data from version 000 to ALL versions irrespective of values entered above.ie:
    1
    2
    3
    10
    80
    99
    100
    110
    Rgds
    Shyam

  • Performance Problems by using a subreport with a SAP BW Query

    Hello Experts,
    we have the following scenario:
    - Crystal Reports Report (CRR) on top of a SAP BW Query
    - SAP BW Query contains a member structure with Month, Year, Prior Year and total
    If I now put some details of a dataset in the main report (e.g. key is project number) and the structure and the characteristic structure in a subreport (linked e.g. by the key project number), the CRR takes like 7,5 hours to display completely. If I don´t use a subreport it takes less then 10 minutes to display (in the preview section of Crystal Reports).
    Is such a significant difference in run time normal ? I have to mention that the used query is quite complex (but this is unavoidable). And it seems also unavoidable to use the subreport to get the desired result in terms of formatting:
    - if I don´t use the subreport and more than one characteristic for the details, the structure which is supposed to display the values for each projects like this
    Month
    Year
    Prior Year
    Total
    gets 'dissolved' - first, Month is listed for each project, than Year is listed for each project, etc. This is only avoidable if use only one characteristic and its attributes, but no other characteristics (that are no attribute to the first one). But of course this is not what the customer wants...
    - so my only solution up to now is to list the desired details in the main report and then next to them the structure and the key figure data in the subreport, so that the structure is listed as in the query - but then as mentioned the performance is awful !
    Many thanks in advance for your help !
    Frank

    Hi Frank
    Have you tried using a join in the main report rather than using the subreport linked on the Project Key Code.
    Try joining the query in the main report with the query in the subreport as a single query in the main report.
    Let me know your observations.
    Regards
    Nikhil

  • Calculate single value as ranked number function does not apply in CR

    Hi everybody,
    I built up a query with the SAP BEx Query designer. For one key figure I enabled the function "Calculate single values" as ranked list. So the query has the following result.
    Instead of...
    Score
    1220
    2032
    2390
    2389
    ...I got...
    Score
    1
    2
    4
    3
    Unfortunately when importing the query to Crystal Reports Crystal is just importing the key figure itself - the ranked list does not exist... so the output is the same as in the first example.
    I tried to rebuild the formula with crystal means using the Rank function but I failed...
    Can anybody provide a workaround for me?
    Is there another way as using the formula workbench?
    Best regards,
    Sebastian

    Hi Ingo and everybody,
    I used now the following function using the Nth largest function:
    If nthlargest(1, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "1"
    else if nthlargest(2, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "2"
    else if nthlargest(3, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "3"
    else if nthlargest(4, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "4"
    else if nthlargest(20, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "20"
    The formula is not very handsome and will fail, if the number of records exceeds...
    Are there any alternatives?
    And: Is there a possibility to change the field name, because those clumsy field names cause that the whole formula is almost unreadable. Or is the only way to build subreports?
    Regards,
    Sebastian

  • How to store a single value embedded in several loops

    I have a situation where I have 3 while loops embedded inside one another and I need to pass a single value obtained from the first iteration of the central loop.  I have thought of a few ways to do this, but I'm not sure which is the best or most efficient.  The two ideas I have are to either use shift registers (which can get messy with 3 loops) to store the value, or to write to a local variable only once and then read it out later.  Right now I'm using a combination of shift registers and auto-indexing, and finding the first value after the loops have completed.  It works, but it doesn't seem very elegant.  I'd love to hear some new suggestions or some thoughts about using local variables vs. shift registers.
    Any help would be appreciated.
    Ken

    halvorka wrote:
    The two ideas I have are to either use shift registers (which can get messy with 3 loops) to store the value,
    Not really that messy . let's assume that the innermost loop sees all iteration (i.e. is not inside a case structure), all you need in an unintialized shift register in the innermost loop as e.g. shown in the figure.
    Message Edited by altenbach on 08-30-2007 01:57 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FirstInnermost.png ‏7 KB

  • Error that "specify a value for variable posting period (single value entry

    hi
    My query is running testing fine in RSECADMIN under some username..but when i try and open it using analyzer (under same username) it gives me error that "specify a value for variable posting period (single value entry, mandatry)" it does'nt even asks to enter variable values and gives this error message.
    However the same query appears to be working fine under different username.
    plz advise.

    Hi Abhinav,
    Just do one thing compare the Roles of two different users for which Query is getting executed and not.
    Check the Object S_RFC.
    Compare the Objects detail for Both the Users.
    Please Assign points if useful.
    Regards,
    Rajdeep.

  • How to hide a single value node hierarchy in the query designer

    Hi,
    I would like to perform a calculation  in the infocube. It concern  a count "Nb of different customers" with the following hierarchy : Country / region / City.
    This KF would be read at the same time by city, region and country, and  certain customers exist in 2 different region, and I have to count them only once by country.
    To do this, I added a new record (at the country level when loading infocube) to deduct a number of customers in doubloons.
    This line added contain only a country code and the number of cutomers in doubloons (- 23 when I have 23 cutomers in doublons) with revrese sign.
    Now, I would like to use this value (-23) to have a right Nb of different customers by country, without showing the not assigned line in the report hierarchy.
    How can I hide, in the query designer or the WAD, a single value node from hierarchy (NOT assigned) but take in account the value (-23) at the country level ?
    Is there another solution (more simple) to perform this in the infocube ?
    For information,
    1) The infocube is loaded once per month, and the KF (Nb of different customers" is also performed by month.
    2) I can't perform this in the report (performance problem with calculated KF).
    thx.

    Hi,
    the short answer is "you can't", the longer is: The ADF Faces tree component is stamped for better performance. This stamping means that nodes are not rendered as JSF objects but copies of an existing component (just with a changed value). For this reason the nodes don't issue their own query for data and thus cannot be refreshed individually
    Frank

  • How can we Restict the Char single value Variables with , , =

    Hi Experts,
    How can we Restict the Char value Variables with <, >, <=  (without selecting Inverval or only passing single value)
    For Example
    We have a standard Query 0FIAR_C03_Q1005, in this
    New Selection
    "1 - 15 Days, Posting Date<=Key Date, Clearing Date>Key Date"
    This is restricted  with the
    Clearing(0CLEAR_DATE)
    <Clearing key date(0P_KEYD3)  It is a single value SAP Exit Varible
    PostingDate(0PSTNG_DATE)
      <= Posting keydate(0P_KEYD3)  It is a single value SAP Exit Varible
    When seeing these 0P_KEYD3, 0P_KEYD3 variables in the New selection screen they looks like  >0P_KEYD3, <=0PSTNG_DATE
    if you define any custom variables these are looks like =ZV_DATE.
    to enable < , >, <= symbols for variables what we need to do.
    In other way
    Say we created one variable ZV_DATE single value, processing type as customer exit.
    for this we populated current day,
    Now Requirement is we need to display the all the records which are <= current date,
    instead of passing low and high values, i want to restrict the calday <=ZV_DATE
    New selection
    0calday
      <=ZV_DATE
    How can we achive this, this is how the business content report having the restrictions
    Please sugget me.
    Thanks
    Chandra
    Edited by: Chandra Gandla on Jun 18, 2010 11:01 AM
    Edited by: Chandra Gandla on Jun 18, 2010 11:01 AM

    Ok,
    In the InfoObject 0calday in the query designer under the filter area, under characteristic restrictions right-click over that InfoObject (0calday).
    In the next window (select Values for [0CALDAY]  Calendar Day in the dropdown box for "Show" choose Value Ranges. Under the word "Between"  dropdown box select "Less than or equal to"
    Below that word click on the button of the dropdown box Select from list.
    In the new window select instead of History Variables and double-click on your variable ZV_DATE.
    Click on the right blue arrow to move it to the right.
    And there you go.
    Tip: It exists a SAP standard variable named 0DAT which is exactly the current date (don't need to use ZV_DATE variable).
    Diogo.

  • SQL to match a single value in a field with comma-delimited text

    I have a column that can contain none, one or many recordIDs
    (from another table) stored as comma-delimited text strings (i.e.,
    a list). I need to retrieve all records that match a single value
    within that list.
    For example, if I want to match all values that equal
    recordID 3, and I use ... WHERE MyColumn IN ('3') ... , I will get
    all records that have EXACTLY 3 as the value of MyColumn, but not
    any MyColumn records whose values include 3, if they are instances
    such as "3,17" or the like.
    Also using the LIKE operator -- as WHERE MyColumn LIKE '%3%'
    -- will get me unwanted records with values such as 35 or 13 ...
    Can I use some sort of intervening ColdFusion list processing
    to output only the desired records?

    Normalize your database so that your data becomes
    accessible.

Maybe you are looking for