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]

Similar Messages

  • After changing a subreport I loose data in the main report.

    Hi All,
    I have a main report that has two parameter fields and two subreports linked to the parameter fields.  The two subreports access the database and work fine separately.  When I add the two subreports to the main report it works fine.  As soon as I make a change to a subreport it works fine standalone.  But as soon as I update the main report (reimport subreport) the subreport no longer returns data to the main report.  To get the report to work after a change to a subreport I have to delete the subreport from main and then add it back in again.
    Does anyone have any suggestions?
    I am using Crystal Reports 10 and I'm totally at my wits end.  I've been working with Crystal for about 5 years and this is the first time I've seen this.  Maybe I'm missing something small but I just can't seem to find the answer.
    Thanks for any help,
    Jim

    Jim:
    I usually edit my subreports from within the main report.  I right click the subreport and then click edit subreport.  This eliminates the need to reimport the subreport.  I've done a lot of work with subreports and this always works for me.
    I hope this is not too late and helps you out.
    Ralph

  • 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

  • To select from database table based on date range

    hi
    i have a selection screen in which date range is being given
    say eg 23/06/07  to 23/12/08
    based on this date i want to select data from a ztable
    eg i want to select a field amount from table
    and three is a field date range on the table
    for this particular field i want to select all records for amount field  and factual field falling wiithing this date range and sum it
    eg
    based on date range as in selcetion screen
    select amount( field1)  factual ( field2) from ztable into it_ztable where date = ?....
    please give me code for it  and how to sum all values as i will get from the ztable into internal table the two values as fetched from the ztable
    please suggest asap
    regards
    arora

    hi
    i am using
    sELECT field1 field2 FROM Ztable  INto it_matu
                       where DATE GE sl_dat-low    
                        AND  DATE LE sl_dat-high.   
    i am getting data in internal table but
    say i have twelve records now i want to sum it the both the columns into and use that sum final amount to display
    let me know how to use sume in the intrranal tabl do i need to use control statement
    how to use the sum for two columns and take into a serperate variable to display
    regards
    aRora

  • Query to split one row to multiple based on date range

    Hi,
    I need to split single row into multple based on date range defined in a column, start_dt and end_dt
    I have a data
    ID      From date             End_dt                measure
    1        2013-12-01         2013-12-03            1
    1        2013-12-04         2013-12-06            2
    2        2013-12-01         2013-12-02            11
    3        2013-12-03         2013-12-04          22
    I required output as
    ID      Date                      measure
    1        2013-12-01              1
    1        2013-12-02              1
    1        2013-12-03              1
    1        2013-12-04              2
    1        2013-12-05              2
    1        2013-12-06              2
    2        2013-12-01             11
    2        2013-12-02             11
    3        2013-12-03             22
    3        2013-12-04            22
    Please provide me sq, query for the same
    Amit
    Please mark as answer if helpful
    http://fascinatingsql.wordpress.com/

    Have a calendar table for example and then probably using UNION ALL from date  and stat date JOIN the Calendar table
    SELECT ID,From date  FROM tbl
    union all
    SELECT ID,End_dt FROM tbl
    with tmp(plant_date) as
       select cast('20130101' as datetime)
       union all
       select plant_date + 1
         from tmp
        where plant_date < '20131231'
    select*
      from  tmp
    option (maxrecursion 0)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Displaying different sums in the same row based on date ranges

    Say I had a table like this
    DECLARE @t1 TABLE (RowId INT PRIMARY KEY IDENTITY(1,1), BusinessType VARCHAR(100), SalesPerson VARCHAR(100), Category VARCHAR(100), OrderAmount DECIMAL(10,2), OrderDate DATETIME )
    Now I want to get a result that is grouped first by BusinessType, then SalesPerson and include derived columns that are sums based  on different date ranges.
    Month-to-date = from the start of the current month to today
    Month-to-date previous year = from the start of the current month to today 1 year ago
    DECLARE @today DATETIME
    DECLARE @today_prev_year DATETIME
    DECLARE @year_start DATETIME
    DECLARE @year_prev_start DATETIME
    DECLARE @month_start DATETIME
    DECLARE @month_prev_start DATETIME
    SET @today = GETDATE();
    SET @today_prev_year = DATEADD(YEAR,-1,@today)
    SET @year_start = CAST('01/01/' + CAST(DATEPART(YEAR,GETDATE()) AS VARCHAR(10)) AS DATETIME);
    SET @year_prev_start = DATEADD(YEAR,-1,@year_start)
    SET @month_start = DATEADD(month, DATEDIFF(month, 0, @today), 0); --gets the first of the current month
    SET @month_prev_start = DATEADD(YEAR,-1,@month_start); --gets the first of the current month
    SELECT t.BusinessType,t.SalesPerson,t.Category
    SUM(CASE WHEN o.OrderDate > @month_start AND ac.DocumentDate < @today THEN o.OrderAmount ELSE 0 END) AS MTDActualAmount
    SUM(CASE WHEN o.OrderDate > @month_prev_start AND ac.DocumentDate < @today_prev_year THEN o.OrderAmount ELSE 0 END) AS MTDPrevActualAmount
    FROM @t1 t
    Hope this is clear as to what Im trying to do.  Im ultimately going to pull this into an SSRS report, so im wondering if I can do this different SUM values in the report and handle the grouping there.
    Thoughts?

    Based on your example (with a group by added) it should work.
    However, if you incorperated a calendar table (http://social.technet.microsoft.com/wiki/contents/articles/29260.tsql-calendar-functions-and-tables.aspx)
    you could lose all those manually set parameters:
    DECLARE @t1 TABLE (RowId INT PRIMARY KEY IDENTITY(1,1), BusinessType VARCHAR(100), SalesPerson VARCHAR(100), Category VARCHAR(100), OrderAmount DECIMAL(10,2), OrderDate DATETIME, DocumentDate DATETIME)
    INSERT INTO @t1 (BusinessType, SalesPerson, Category, OrderAmount, OrderDate, DocumentDate) VALUES
    ('A','Joe','CatA',10,'2015-01-01','2015-01-01'),('A','Joe','CatB',10,'2015-01-02','2015-01-01'),('A','Joe','CatA',30,'2015-01-03','2015-01-04'),('A','Joe','CatB',40,'2015-01-04','2015-01-01'),('A','Joe','CatA',100,'2015-02-01','2015-02-01'),
    ('A','Joe','CatB',100,'2015-02-02','2015-02-01'),('A','Joe','CatA',300,'2015-02-03','2015-02-04'),('A','Joe','CatB',400,'2015-02-04','2015-02-01'),('A','Bob','CatA',1,'2015-01-01','2015-01-01'),('A','Bob','CatB',1,'2015-01-02','2015-01-01'),
    ('A','Bob','CatA',3,'2015-01-03','2015-01-04'),('A','Bob','CatB',4,'2015-01-04','2015-01-01'),('A','Bob','CatA',10,'2015-02-01','2015-02-01'),('A','Bob','CatB',10,'2015-02-02','2015-02-01'),('A','Bob','CatA',30,'2015-02-03','2015-02-04'),
    ('A','Bob','CatB',40,'2015-02-04','2015-02-01'),('B','Joe','CatA',10,'2015-01-01','2015-01-01'),('B','Joe','CatB',10,'2015-01-02','2015-01-01'),('B','Joe','CatB',40,'2015-01-04','2015-01-01'),
    ('B','Joe','CatA',100,'2015-02-01','2015-02-01'),('B','Joe','CatB',100,'2015-02-02','2015-02-01'),('B','Joe','CatA',300,'2015-02-03','2015-02-04')
    SELECT t.BusinessType,t.SalesPerson,t.Category,
    SUM(CASE WHEN OrderDate >= monthStart AND DocumentDate < today THEN OrderAmount ELSE 0 END) AS MTDActualAmount,
    SUM(CASE WHEN OrderDate BETWEEN prevMonthStart AND prevMonthENd AND DocumentDate >= yearStart THEN OrderAmount ELSE 0 END) AS MTDPrevActualAmount
    FROM @t1 t
    INNER JOIN calendar c
    ON today = CAST(CURRENT_TIMESTAMP AS DATE)
    Group by t.BusinessType,t.SalesPerson,t.Category

  • Restrict Query Data based on Date range and Users

    Hi All,
    I have a few web reports that I need do restrict data based on Users.
    In all the queries i have an infoobject 0CALDAY, and  a User Entry range variable on it. Because of performance issues  I need to restrict the range of dates a User can see. Typically most of users could go to a max date range of 1 month back. But some others would need the ability to see data for much bigger range of dates.
    Pls suggest how should i go about with this. Should I have to enforce this at Variable level(user exit).... but then i might have to maintain a table for the users.. Is there any other way of doing it.
    thanks
    Raj

    Any thoughts ?

  • Moving average price  based on date range, site and article.

    Hi ABAPers,
    I am working on SKU wise sales report. Based on user input of date range ,site and article I fetch data from VBRP table i.e., (billing data from stores) . I have searched a lot to find MAP but dint get convincing solution.
    I tried to get data from MBEW-VERPR but that doesnot give MAP for a given date. I also tried with condition record table and KONP table but not helpful.
    I also got to know about s031 and LIS configuration I am not sure whether functional consultant should do the changes.
    Kindly help me in obtaining the MAP for particular bill date, article and site(store).
    Regards,
    Dep

    You can found the moving average price in MBEW (current) and MBEWH (history table)
    The first goods movement after the period closing program updates the period in MBEW and writes the data of the previous period to table MBEWH
    - If you actually need map on a daily (or less) basis, you will have to calculate it from MBEW, MBEWH, MSEG and BSIM (...)
    - You could also look for the actual cost in MSEG related to records of VBRP.
    Regards,
    Raymond

  • User-filtered report based on date range

    I am struggling with trying to implement a basic search that includes an optional date range for the data. The form looks the way I want it, but I can't seem to get the right syntax in the query. I can't get anything other than "no rows" to show up in the query if I implement a clause selecting records based on the time.
    Here is a working query (without the time):
    select m.AUDIT_ID, m.TIMESTAMP, m.LOC_ID, a.AREA, s.SUBAREA, d.OBSERVATIONS
    from transys.SAFETY_AUDIT_MAIN m, transys.SAFETY_AUDIT_DETAIL d,
    transys.SAFETY_AUDIT_AREA a, transys.SAFETY_AUDIT_SUBAREA s
    where m.AUDIT_ID = d.AUDIT_ID (+)
    and d.AREA_ID = a.AREA_ID
    and d.SUBAREA_ID = s.SUBAREA_ID
    and s.SUBAREA_ID NOT IN (198,199,398,399,498,499,798,799,898,899,999)
    and (instr(upper(a.AREA),upper(nvl(:P210_SEARCH,AREA))) > 0
    or instr(upper(s.SUBAREA),upper(nvl(:P210_SEARCH,SUBAREA))) > 0
    or instr(upper(d.OBSERVATIONS),upper(nvl(:P210_SEARCH,OBSERVATIONS))) > 0)
    I want to compare the m.TIMESTAMP column with page items P210_FROM_DATE and P210_TO_DATE.
    I would also like to add in an optional filter comparing m.LOC_ID to P210_LOCATION, and I can't seem to figure out the "optional" part.
    Any ideas would be helpful.

    The query as I posted it returns 3 values, but it is not syntactically identical to the one APEX is using. I would be happy to get 3 rows in APEX because at least that way I would know I have the date formatting correct, and just needed to tweak the logic. When I execute the query in APEX, however, I get either "there is no data to display" or I get a formatting error - "X is not a valid month" - depending on how I use TO_CHAR and TO_DATE to try and synchronize the various date inputs with the field.
    If it is a query issue (which it may be), I am still suspecting that it is something to do with the formatting of the dates involved. Just as in APEX, it could be something simple, but I suspect it is a mismatch in the formatting somewhere.
    Maybe I'll try making a view of the underlying table and experimenting with the date in the view. That should enable me to see if it is the formatting in the query or the formatting in APEX that is causing the problem. Or it could even eliminate formatting as the problem as well.
    PS. I had a similar struggle trying to implement some triggers against this database that used date values. NLS_TIMESTAMP_FORMAT is set to 'YYYY-MM-DD HH24.MI.SS.FF'. I ended up converting every date that I pulled from the database into a known format with TO_CHAR and then converting it back into a date with TO_DATE. It was the only way to be able to compare the date values without getting these same kinds of errors.

  • Assign values based on data range

    Hi
    I am trying to fix a query that I ahve been left with from a previous developer.
    The basis of it are that I have 2 views, one which is effectively a date calendar with users per date, and the 2nd being values assigned between a 2 date ranges.
    here is sample data
    create table #hours (
    Fee_earner_Code int not null
    ,startdate date not null
    ,enddate date not null
    ,hours decimal (17,2) not null
    insert into #hours values (1132,'2011-06-01','2020-01-01',6.00)
    insert into #hours values (1132,'2011-06-07','2011-06-01',4.00)
    insert into #hours values (1132,'2012-06-09','2011-06-07',12.00)
    insert into #hours values (2345,'2011-06-01','2020-01-01',3.00)
    insert into #hours values (2345,'2011-06-06','2011-06-01',9.00)
    insert into #hours values (2345,'2012-06-10','2011-06-06',5.00)
    create table #dates (Fee_earner_Code int not null
    ,Primary_date date not null
    insert into #dates values (1132,'2011-06-01')
    insert into #dates values (1132,'2011-06-02')
    insert into #dates values (1132,'2011-06-03')
    insert into #dates values (1132,'2011-06-04')
    insert into #dates values (1132,'2011-06-05')
    insert into #dates values (1132,'2011-06-06')
    insert into #dates values (1132,'2011-06-07')
    insert into #dates values (1132,'2011-06-08')
    insert into #dates values (1132,'2011-06-09')
    insert into #dates values (1132,'2011-06-10')
    insert into #dates values (1132,'2011-06-11')
    insert into #dates values (1132,'2011-06-12')
    insert into #dates values (2345,'2011-06-01')
    insert into #dates values (2345,'2011-06-02')
    insert into #dates values (2345,'2011-06-03')
    insert into #dates values (2345,'2011-06-04')
    insert into #dates values (2345,'2011-06-05')
    insert into #dates values (2345,'2011-06-06')
    insert into #dates values (2345,'2011-06-07')
    insert into #dates values (2345,'2011-06-08')
    insert into #dates values (2345,'2011-06-09')
    insert into #dates values (2345,'2011-06-10')
    insert into #dates values (2345,'2011-06-11')
    insert into #dates values (2345,'2011-06-12')
    for the table #hours the end date is alway the previous rows startdate unless it is the 1st row per fee_earner_Code then it is assigned '2020-01-01' (this date can be change as it is just another view)
    I would like to apply the #hours hours value to the appropriate date range in #dates per fee-earner-code
    my expected ouput would be
    1132,2011-06-01,6.00
    1132,2011-06-02,6.00
    1132,2011-06-03,6.00
    1132,2011-06-04,6.00
    1132,2011-06-05,6.00
    1132,2011-06-06,6.00
    1132,2011-06-07,4.00
    1132,2011-06-08,6.00
    1132,2011-06-09,12.00
    1132,2011-06-10,12.00
    1132,2011-06-11,12.00
    1132,2011-06-12,12.00
    2345,2011-06-01,3.00
    2345,2011-06-02,3.00
    2345,2011-06-03,3.00
    2345,2011-06-04,3.00
    2345,2011-06-05,3.00
    2345,2011-06-06,9.00
    2345,2011-06-07,9.00
    2345,2011-06-08,9.00
    2345,2011-06-09,9.00
    2345,2011-06-10,5.00
    2345,2011-06-11,5.00
    2345,2011-06-12,5.00
    Any help would be great

    With SQL Server 2012's Windows functions, this becomes easy. We can use it to fix the data in your hours table:
    DECLARE @hours TABLE (Fee_earner_Code int not null, startdate date not null, enddate date not null, hours decimal (17,2) not null)
    INSERT INTO @hours (Fee_earner_Code, startdate, enddate, hours) VALUES (1132,'2011-06-01','2020-01-01',6.00),(1132,'2011-06-07','2011-06-01',4.00),(1132,'2012-06-09','2011-06-07',12.00),(2345,'2011-06-01','2020-01-01',3.00),(2345,'2011-06-06','2011-06-01',9.00),(2345,'2012-06-10','2011-06-06',5.00)
    DECLARE @dates TABLE (Fee_earner_Code int not null, Primary_date date not null)
    INSERT INTO @dates (Fee_earner_Code, Primary_date) VALUES (1132,'2011-06-01'),(1132,'2011-06-02'),(1132,'2011-06-03'),(1132,'2011-06-04'),(1132,'2011-06-05'),(1132,'2011-06-06'),(1132,'2011-06-07'),(1132,'2011-06-08'),
    (1132,'2011-06-09'),(1132,'2011-06-10'),(1132,'2011-06-11'),(1132,'2011-06-12'),(2345,'2011-06-01'),(2345,'2011-06-02'),(2345,'2011-06-03'),(2345,'2011-06-04'),
    (2345,'2011-06-05'),(2345,'2011-06-06'),(2345,'2011-06-07'),(2345,'2011-06-08'),(2345,'2011-06-09'),(2345,'2011-06-10'),(2345,'2011-06-11'),(2345,'2011-06-12')
    ;WITH fixHours AS (
    SELECT *, DATEADD(DAY,-1,LEAD(startDate) OVER (PARTITION BY Fee_earner_code ORDER BY startDate)) AS realEndDate
    FROM @hours h
    SELECT h.Fee_earner_Code, d.Primary_date, h.hours
    FROM fixHours h
    LEFT OUTER JOIN @dates d
    ON d.Primary_date BETWEEN h.startDate AND realEndDate
    Without it, we need to do a self join to acheive the same end:
    DECLARE @hours TABLE (Fee_earner_Code int not null, startdate date not null, enddate date not null, hours decimal (17,2) not null)
    INSERT INTO @hours (Fee_earner_Code, startdate, enddate, hours) VALUES (1132,'2011-06-01','2020-01-01',6.00),(1132,'2011-06-07','2011-06-01',4.00),(1132,'2012-06-09','2011-06-07',12.00),(2345,'2011-06-01','2020-01-01',3.00),(2345,'2011-06-06','2011-06-01',9.00),(2345,'2012-06-10','2011-06-06',5.00)
    DECLARE @dates TABLE (Fee_earner_Code int not null, Primary_date date not null)
    INSERT INTO @dates (Fee_earner_Code, Primary_date) VALUES (1132,'2011-06-01'),(1132,'2011-06-02'),(1132,'2011-06-03'),(1132,'2011-06-04'),(1132,'2011-06-05'),(1132,'2011-06-06'),(1132,'2011-06-07'),(1132,'2011-06-08'),
    (1132,'2011-06-09'),(1132,'2011-06-10'),(1132,'2011-06-11'),(1132,'2011-06-12'),(2345,'2011-06-01'),(2345,'2011-06-02'),(2345,'2011-06-03'),(2345,'2011-06-04'),
    (2345,'2011-06-05'),(2345,'2011-06-06'),(2345,'2011-06-07'),(2345,'2011-06-08'),(2345,'2011-06-09'),(2345,'2011-06-10'),(2345,'2011-06-11'),(2345,'2011-06-12')
    ;WITH fixHours AS (
    SELECT h.*, DATEADD(DAY,-1,h1.startdate) as realEndDate
    FROM @hours h
    INNER JOIN @hours h1
    ON h.Fee_earner_Code = h1.Fee_earner_Code
    AND h1.startdate = (SELECT MIN(startDate) FROM @hours WHERE h1.Fee_earner_Code = Fee_earner_Code AND h.startdate < startDate)
    SELECT h.Fee_earner_Code, d.Primary_date, h.hours
    FROM fixHours h
    LEFT OUTER JOIN @dates d
    ON d.Primary_date BETWEEN h.startDate AND realEndDate

  • How To Pass Data Between A Main Report and a Subreport

    Hello,
      I'm working with Crystal Reports Professional XI. 
      I have a main report with two date parameters: BeginDate of Date type and EndDate of Data type.  The main report has no details being printed instead it's grouped by a formula field and displays a summary count at the group footer.  I have  a subreport that is not linkable to the main report.  The subreport is grouped differently.  It has no detail records being printed and displays a summary count at the group footer as well.  The two reports are using the same tables with the same linking relationship.
       I created the same two date parameters in the subreport but this isn't right because when I run the report then I get four Date prompts: BeginDate and EndDate parameter from the main report and the BeginDate and EndDate parameter from the subreport.
      I'm not dong something right here.  What do I need to change in the reports so that l have the same record selecton being passed from the main report to the subreport record selection based on the BeginDate parameter and the End Date parameter from the main report?  Right now, the subreport is selecting all the records in the tables specified.
      Have a great day.  Any feedback would be greatly appreciated.
    Thanks,
    Ting

    Hi Jason,
       Thanks for replying to my posting.  It's been awhile since I've worked on Crystal Reports so I'm getting reacquainted with sub-reports again.  
        By linking the main report to the subreport by the BeginDate and BeginEnd parameters, will the date parameters be passed from the main report to the record selection for the subreport?  
       Also by doing your approach when the user is prompted to run the report, will it display on the popup window four date parameters: the BeginDate and EndDate from the main report and underneath that the BeginDate and EndDate from the sub report?  If so I'm trying to avoid that because it would be the same date range that I'm wanting to use for the main report and the subreport.  
        I hope that made sense.
    Thanks,
    Ting

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

  • Not having to refresh the data in the main report but only in the subreport

    Hi SAP,
    I have a report that uses a stored procedure in the main report and uses regular database tables in the subreport.  The data returned from the stored procedure reports information from the month-end database (a cutoff point from the previous month's numbers) while the subreport reports information from the live database.  This report gets run everyday to show the changes in numbers from the live database.  Obviously the numbers from the month-end database remainds static until the next month's cutoff database is created. 
    My problem is that everyday when I run the report, the data needs to refresh from both the stored procedure in the main report and the live database tables in the subreport.  How can I leave the data returned from the stored procedure static or as is without refreshing the stored procedure returned data and just have the subreport data refresh itself?  The stored procedure really puts a strain on the database and I would like to cut-out the time to process the report as well.  Does anyone have any ideas?
    Zack

    Hi Zack,
    Try the following under Report options.
    1. Clear the check box of "Verify Stored Procedures on First Refresh" in the Main report.
    2. Select the check box of "Verify on First Refresh" in  the sub report.
    Hope this helps.

  • How to schedule the webi report based on data changes in the report data

    Hello,
    I want  to schedule a webi report based on data change in a column in the report.
    The scenario is something like below:
    1. If a data of a particular column changes from 2 to 3 than I would like to schedule this report and sent it to users mail box.
    I know how to apply alerts or schedule a report or data tracking for capturing changes in the report but I dont know how to schedule the report only for data changes.
    Anybody done this before.
    Thanks
    Gaurav

    Hi,
    May be these links can help you:
    http://devnet.magicsoftware.com/en/library?book=en/iBOLT/&page=SAP_R_3_Master_Data_Distribution_Defining_Change_Pointers.htm
    SEM-BCS: Load from data stream schedule
    Attribute Change Run

  • SubReport Data in a Main Report Yet Again

    I have been trying and reading posts all day.
    1. The shared variable formula used in the main report will show any/correct value only if its placed atleast 1 section below the one where the sub report exists. (I've Done This)
    2.The formula that is used inside the sub report needs to be physically placed on any of the sections within that sub report(you can suppress it to avoid displaying the value). (I've Done This)
    3. Due to design constraints if you cannot move the sub reports from Report Footer then you can atleast mock them and place respective copies in the Report Header.These can contain just the summary values, thats it. Further, to nullify the display effect you can suppress all the sections of these sub reports and make them so small such that they appear as tiny dots and place them in extreme corners of the Report Header section. (Not sure this would apply since I have met #1 and #2)??
    The blue outline/highlight is the passed total from by first subreport locatd in Group Header 1b. As you can see it is passing 0.
    In the subreport, here is the formula used to get the OrderQty.
    WhilePrintingRecords;
    Shared NumberVar OrderQty;
    OrderQty := OrderQty + {iptrn.ipqord}
    I am using the "three part" formula to to calculate the Qty because when using a sum it sums up all records and I need to to sum by change in item. The subreport is calculating correctly. I have also tried a running sum but this won't pass either and I get messages about not being able to use the formula with itself so gave up that avenue.
    In the main report, here is the formula used to display the OrderQty.
    WhilePrintingRecords;
    Shared NumberVar OrderQty;
    OrderQty
    //@MainFormula
    //Returns the value that was stored in the shared number variable called
    //OrderQty in the subreport
    I think I have this all correct but still getting zero so i am not sure if it has something to do with resetting the value and maybe my linkages are not correct? Any help will be appreciated. I have very little experience with Crystal and less with sub reports.

    Ok, so I used the example sent and I can't really tell you why it worked but it did. The modifications I made were so minor I would never have expected it to work.
    here is one
    Mine
    WhilePrintingRecords;
    Shared NumberVar OrderQty;
    OrderQty := OrderQty + {iptrn.ipqord};
    Yours
    whileprintingrecords;
    shared numbervar OrderQty;
    OrderQty:=OrderQty + {iptrn_.ipqord}
    The only difference I see other than the capitalization is the space after OrderQty :=.  My numbers were working fine on the sub report, they just wouldn't pass to the main report.  I did move the reset to the page header like your example but I don't understand why that even works when it should reset on the item, not the page..??? I also put the details variable in a second detail section like you had in the example. What is the theory behind this?
    I also had a second one that I needed so I set that up exactly as the first one and no go. I had to move the reset into the GH1 and I put the details variable in a second detail section and it too worked.
    I can't say that I understand why......I'm happy it works but it would be nice to know the why so next time I wouldn't struggle with it

Maybe you are looking for

  • What cable do i use to Connect my MBP to a dell monitor

    What cable do i use to connect my rMBP to my Dell monitor

  • Picklist ID appearing in reports, instead of Picklist Value

    I have changed a Picklist Value for a Product Sales Stage field setup by one word so that the original "Bought" remains in the Picklist Id and the Picklist Value was changed to replace Bought with "Quoted". When I run a report on the the Product Sale

  • DVD Player Hangs

    Since Leopard upgrade a DVD that plays fine on a regular player will not play on iMac. It plays for a while then hangs while a message says "skipping over damaged area". Had to power off to get out of DVD Player. Coould not get to force quit.

  • Re: Activation date passed - No broadband

    I've got a sweet situation going that's lost me all faith in BT's ability to deal with my phone and broadband switching. The problem needs a little contextualising, so forgive me laying it out, to avoid any unnecessary assumptions about it.  I was wi

  • Wifi issue post update of 8.3

    i noticed that since I upgtaded to 8.3 my phone 6 very erratically disconnect or doesn't recognise Wifi. Though my other equipments like Laptop, BB works absolutely fine. I twice restored my phone too.