Date ranges in sub reports

I have a Crystal XI report pulling physician information by type of case (MS-DRG) for 6 months of discharges.  The report looks at cases and average length of stay for each physicians top 5 MS-DRGs.  I built a sub report to pull cases and average length of stay for ALL OTHER physicians for the same 5 MS-DRGs.  The goal is for each physician to be able to benchmark their average length of stay with other physicians in the same hospital.  This report will be accessed at the hospitals through Crystal Enterprise InfoView.  In InfoView, I can only see one set of filters instead of one for the main report and one for the sub report, so the end-users can't change the sub report select criteria.  Therefore, I need the parameters passed from the main report.  I can get everything to work except the discharge date range since the link creates and equal link.  We store our dates in number fields in the format YYYYMMDD.
How can I get the sub report to run for the same date range as the main report?

1.  I linked on the hospital ID field, but no date field because I don't want an equal join, I want a range of dates.
2.  Yes, I want the main report and the sub report to use the same range of dates.
3.  I didn't create additional parameters in the sub report or main report.  The only parameters being used are those created from the linking of the hospital ID. 
Thanks.

Similar Messages

  • Exporting to Excel data only using sub reports in Crytal 9

    Post Author: pmstar
    CA Forum: Exporting
    I am using Crystal 9 verision.
    I have .rpt file that used 4 sub reports .In the main report I placed all the sub reports in the(detail section) row  and using the data for some caluculation in the main report to generate report fields.I placed the main report fields in next row( in detail section).However when i export the report .Its generating 5 empty rows  and 3 rows with 0. I have pretty much followed the solution from the article "c2017620" published in BO.
    Since i used the sub reports only to get some value for main report calculations .Is there any workaround for the following issue
    1.I do not want to print the subreport data when exported to excel data only.
    2.how can i get rid of the blank rows
    We have a lot of reports which has the same issue and we need to get the reports to work in Excel Data only .The reports works perfect when used in PDF format but its mandatory that we need to give the reports to the client using Data only.
    If possible, when responding with your recommendations, please include detailed steps.  It would be very helpful.Thanks in advance,
    PM

    Post Author: swat
    CA Forum: Exporting
    Hi,
    Of what i gather from ur scenario...this is what i did in one of my reports.
    I had to use two subreports and they had to occupy one cell each, in line with other fields.
    To obtain that,all the fields required in the subreport i put them into a text box.Therein restricting the fields to the txt box only...
    Then import that sub-report as it is.
    It worked for me....
    try out...
    All this only if've understood u right...

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

  • Obtaining data within a date range in XL Reporter

    Dear All,
    I'm currently working on BS in XL reporter.
    I was trying to extracting data in a date range, setting PER( Code >= @MthFrom Or Code <= @MthTo ) in report default tab.
    However, the result is shown as all data as of current date. E.g. Selection criteria: >=200808, <=200809, the result is shown as from Begining to 200810.
    Please kindly advise.
    Thank you.
    Regards,
    Julie
    Edited by: Julie Wan on Oct 1, 2008 1:10 PM

    Dear Gordon,
    Thank you for your reply.
    However my case is different to your given link.
    In my case, there is a result coming out, but not within the correct range i selected. It shows all instead.
    I tried to set the period range in report default tab,  in column tab of a expanding column, and in cell tab of an individual cell, but none have worked. E.g. PER( Code >= @MthFrom or Code <= @MthTo )
    Regards,
    Julie

  • Specifying a Date Range for Interactive Reports

    Hi All,
    I'm currently working on Oracle Application Express 11. We have created an application with a standard reports page. On this page there are the following items:
    HTML Region 1: (Parameters)
    Start Date: (Date Picker)
    End Date: (Date Picker)
    Amount: (Displays Read-Only Amount)
    HTML Region 2: (Specify Report)
    Violation Reports (link 1)
    Correct Reports (link 2)
    Fault Reports (link 3)
    All Reports (link 4)
    I would like to know if it's possible that I could enforce the following scenarios on a user:
    If a user clicks a link without specifying a date range, then an error message is displayed prompting the user to specify Start Date & End Date.
    If a user specifies a Start Date that is outside the table's date range, then an error message is displayed prompting the user to enter a valid Start Date. For instance, if the first ever date on the database table is 17/JUL/97 then if a user specifies 16/JUL/97 as his/her Start Date then an error message will be displayed prompting the user to specify a start date from 17/JUL/97 onwards.
    Is this possible? Please advice!
    THANK YOU IN ADVANCE
    Kamo

    Hi Kamo,
    In order for the dates to be used on the reports (which is what I assume you are trying to do?), the user must submit the page to get the dates into the session. Given that, you could have Validation on your page that checks the criteria you need when the page is submitted. You could also have your Region 2 conditional on the dates not being NULL - that way, the user can not click on a link until both dates have been entered and submitted.
    Andy

  • Using Parameter Date Range Values in Report

    Post Author: rsteeg
    CA Forum: General
    i would like to include the selected start and end dates on my report to display the range of the report.  I cannot recall how to do it.  Can any one help?  I am using CR X.

    Post Author: Crystal Fire
    CA Forum: General
    "All Dates Between "+ ToText(Minimum({?Your Date Field}),"M/d/yyyy")" and "ToText(Maximum({?Your Date Field}),"M/d/yyyy")

  • Concatenate data in a Sub-report then copy in the Main report

    Hello,
    I'm using Crystal Report XI R2, I succeed to retrieve data as decribe in SAP Note 1212454 - How to Share Subreport Data with the Main Report
    But when I hide section A, my values in section B are empty
    So my answer is, how to retrieve dataset from the subreport group Footer Group concatenated and show it as a Header group data in the Main Report

    I'm currently trying was is explained in:
    1218324 - How to suppress a subreport but still evaluate and pass a shared variable
    Symptom
    In Crystal Reports (CR), subreports are frequently used to calculate and pass data to the main report. In many instances the business requirement is that the subreports not be visible to the end users. However, suppressing the subreport object or suppressing the section of the main report in which the subreport is located causes the shared variables to display incorrect data when passed to the main report.
    How can you suppress a subreport but still pass a shared variable with the correct data?
    Resolution
    In Crystal Reports 9 and later, you can suppress a subreport but still pass a shared variable with the correct data to the main report by following the steps below:
    In the Subreport
    1. Remove all conditional suppression formatting formulas.
    2. Delete all drawing objects such as boxes, lines, etc.
    3. Suppress all remaining subreport objects such as database fields, formulas, etc.
    4. For all sections that contain no objects, select the 'Suppress' option in the Section Expert.
    5. For all sections that contain suppressed objects, select the 'Suppress Blank Section' option in the Section Expert.
    In the Main Report
    1. Select the 'Suppress Blank Subreport' option in the subreport Format Editor.
    2. Remove all borders from the subreport object in the subreport 'Format Editor'.
    3. Select the 'Suppress Blank Section' option in the 'Section Expert' for the section containing the subreport.
    Background Information
    When working with subreports, the 'Suppress Blank Section' option forces CR to evaluate the subreport contained within the section to determine if the final subreport output is blank. The 'Suppress' option allows CR to bypass the subreport completely, because the section is suppressed. By forcing Crystal Reports to evaluate the suppressed shared variable formulas in the subreport, the data can be correctly passed from the subreport to the main report even though the subreport is not visible to the end user.

  • Multi-date range within single report

    I'm hoping you all find this a very basic question.  I have two columns of data which I want to review for 2 different time periods on the same report.  In this case I am looking at individuals scores in two performance metrics for the prior 6 weeks and then for the current week.  I would like to have the 4 culumns total displayed side by side for each individual.  I hope I am making sense.  Can anyone give me some guidance on this?
    Nevermind, My late night brain forgot about dual-query reports and I was able to do just what I wanted.
    Edited by: Sarah Negovetich on Aug 7, 2008 11:28 PM

    Yet another method...
    <cfset start_date = DateFormat('01/01/2007',
    'mm/dd/yyyy')>
    <cfset end_date = DateFormat('09/30/2009',
    'mm/dd/yyyy')>
    <cfset start_year = DatePart('yyyy', start_date)>
    <cfset end_year = DatePart('yyyy', end_date)>
    <cfset schoolyear_start = '09/01/'>
    <cfset schoolyear_end = '06/30/'>
    <cfset count = 0>
    <cfloop index="rec" from="#start_year#"
    to="#end_year#">
    <cfset tmp_start = DateFormat('#schoolyear_start##rec#',
    'mm/dd/yyyy')>
    <cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
    'mm/dd/yyyy')>
    <cfif DateCompare(tmp_start,start_date) gt -1 and
    DateCompare(tmp_end, end_date) eq -1>
    <cfset count = count + 1>
    </cfif>
    </cfloop>
    <cfoutput>
    <br>There are #count# school year periods between
    #start_date# and #end_date#
    </cfoutput>

  • Devolped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

  • Devloped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    Hi,
    You can develop simple reports using Report Painter.
    You may be also interested in:
    Check report SAPMF05A for credit memo
    See the following Std reports on Payment Advices execute the Tcodes:
    S_ALR_87009888
    S_ALR_87009889
    S_ALR_87009890
    S_ALR_87009891
    S_ALR_87009892
    S_ALR_87009893
    S_ALR_87009978
    S_ALR_87009979
    S_ALR_87009980
    S_ALR_87009981
    S_ALR_87009982
    S_ALR_87009983
    S_ALR_87010056
    S_ALR_87010057
    S_ALR_87010058
    S_ALR_87010059
    S_ALR_87010060
    S_ALR_87010061
    S_ALR_87010066
    S_ALR_87010067
    S_ALR_87012106
    S_ALR_87012107
    S_ALR_87012108
    S_ALR_87012109
    S_ALR_87012110
    S_ALR_87012111
    S_ALR_87012116
    S_ALR_87012117
    S_ALR_87012200
    S_ALR_87012201
    S_ALR_87012202
    S_ALR_870122
    S_ALR_87012204
    S_ALR_87012205
    S_ALR_87012350
    S_ALR_87012351
    S_ALR_87012352
    S_ALR_87012353
    S_ALR_87012354
    S_ALR_87012355
    sample ALV report:
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
                            " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                            "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
      select * from marav
      into corresponding fields of table imat
      where
      matnr in s_matnr.
    end-of-selection.
    Now, we start with ALV
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    The only problem one might have is that the report and table names
    need to be in capital letters. (I had it )
    Store report name
    i_repid = sy-repid.
    Create Fieldcatalogue from internal table
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
                I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM       = i_repid
                I_STRUCTURE_NAME         = 'marav'
                I_DEFAULT                = 'X'
                I_SAVE                   = 'A'
           TABLES
                T_OUTTAB                 = imat.
      IF SY-SUBRC <> 0.
        WRITE: 'SY-SUBRC: ', SY-SUBRC .
      ENDIF.
    Hope this will help.
    Regards,
    Naveen.

  • Extract Data in sub report to main report

    Post Author: Karl1975
    CA Forum: Formula
    Hi I have written both a main and sub report in V10 that shows grouped data by Name with a total count on each Name:-
    EG:-
    Name                               Numbers
    Tim Smith                         10
    John Smith                        15
    I need to extract the data from the sub report that matches each of the Name into the Main report.  So I can calculate a ratio.
    EG
    Name                               Numbers              (Numbers from Sub Report)
    Tim Smith                         10                       10
    John Smith                        15                       12
    Is this possible?
    Many thanks.

    Post Author: sharonmtowler
    CA Forum: Formula
    you can use shared variables to pass the data from the sub to the main. in the knowledge base you can find instructions on creating these.
    make sure you do not surpress the value in the sub or it wont pass through. place the variable in the main below the sub report.

  • Report that Forces a User to Input a Date Range

    Greetings,
    I am generating a work times report and would like to force the user to select a date range when the report first opens. This would pull only the data for the specified range from my database.
    I prefer drop down lists or calendars, but am wondering if this is possible.
    I guess one other important element is that I would like to "dumb down" the interface, so the user of the report does not have access to all of the features of the program.  Basically I only want them to have read privileges.
    I'm new to CR, so would appreciate any guidance.
    Thanks
    Peter

    Here is what the Help system has to say about the read only feature:
    You can make a report, section, area, or object read-only so it can't be formatted.
    When you set this option, choices in the Format Editor become inactive.
    The formatting options that are usually available on the toolbars or shortcut menus are also suppressed for the report or object.
    Note:    This feature is for your convenience in protecting report formatting; it is not intended to be used as report security.
    Also, if you want the user to be prompted for parameter values each time they open the report, take the check mark out of the
    "Save Data with Report" option.
    Jason

  • Main/Sub Report Passing Parameter

    This is a twist on the general passing parameter question:
    1. The main report is a detail report based on a stored procedure.
    2. The sub report is also based on a stored procedure. This SP calculates the values that will be introduced into a 'table' drawn on the report canvas. The SP consists of a CTE which is a 'reduced' version of the Detail SP used in the main report - to ensure that all the same records are being retrieved between the main and sub reports. Another select, following the CTE, sums the values and makes them available to the Sub Report.
    The client has requested the availability to view records where an Activity Date falls within the last full week, the last month, this month, and YTD. The report is available both through Infoview as well as a scheduled version. The client wants to make a selection as to time period through Infoview.
    Most other users will be using a printed copy of the 'general' report.
    I thought to use the SAVED DATA in SELECTION REPORTS and use Crystal functions to handle this. The SAVED DATA and an optional parameter allowed the user (in Infoview) to change the parameters. This works fine in the main report.
    HOWEVER, the sub report needs to update the totals for the groups of properties that are aggregated in the sub report's summary Stored Procedure. Since the time range will, on changing in the Main Report, reflect different counts,  I need to be able to tell the sub report what the main report is doing.
    The Main report has an Optional Parm ({?Account Open}) which allows the selection of a data range
    The SAVED DATA selection uses the values from the parm:
    if not hasvalue({?Account Open}) then 1=1
        else if hasvalue({?Account Open}) and {?Account Open}=0 then 1=1
        else if hasvalue({?Account Open}) and {?Account Open}=1 then {Account_open_date_newest}in LastFullWeek
        else if hasvalue({?Account Open}) and {?Account Open}=2 then {Account_open_date_newest}in LastFullMonth
        else if hasvalue({?Account Open}) and {?Account Open}=3 then {Account_open_date_newest}in Yeartodate
        else if hasvalue({?Account Open}) and {?Account Open}=4 then {Account_open_date_newest}in CDateTime (CurrentDate-(DayOfWeek(CurrentDate)+1),CTime(00,00,00)) to CDateTime (CurrentDate+(7-(DayOfWeek(CurrentDate))),CTime(23,59,59))
        else 1=0;
    My problem in passing the optional param selection made by the user down to the sub report in order to update the counts.
    Any help would be gratefully appreciated! I have included a snap of the Table from tyhe subreport and a snap of the optional parm from the Main Report

    Jamie -
    Thank you for your reply. I've spent the morning working on the two directions you had provided me with.
    Cross tabs: I took one report, created a cross tab for it, and, as expected, it worked as desired. The issue I'm having is where to place it on the report canvas. If I'm correct, the only place where it can be placed is in a header or footer - the sub report is currently residing in Page Header D (there's a lot of suppression and reveals in these reports). The cross tab does not want to be placed there. It's currently living in the Report Header... further, the cross tab occupies page 1; the remainder of the report starts on page two. Not what needs to happen. The current business specification for the report is: Page 1 includes a page header which includes (through iterations a-e) logo, print date info, the sub report showing the summary a series of group headers which in effect creates an index into the various business units. By clicking on a business unit, any groups under it are exposed. By clicking on the sub group, customer data is exposed. As you go to the 'next page', the Summary sub-report is eliminated and the groups under the Business Unit are shown. All of these dynamics are based on section suppression and unhiding based on the user's interaction, which why the placement of the Summary data is important. If you have any hints on managing the cross tab and its placement, I would be eager to hear them.... (btw - the number of rows in the cross-tab can range from 0 to 12. That dynamism is not a problem with the sub report - would it be for the cross tab?)
    Parameter Passing: I took one of the reports and (1) ensured that the sub report had the exact  same parameter (called Account Open) as the Main Report. (2) ensured that the Saved Data filters in both reports were the same. (In order to do that I had to update the stored proc for the sub report to include an account date field). (3) I then went to link the two reports selecting the Account Open parameter in both the containing and the Fields to Link To list boxes (see the graphic LINK.JOG. This produced no useful result - the Summary showed ALL records- the container report properly showed the count for last full month (see SUMMARY.JPG) (4) I then tried to link a field from the sub report to the Parameter, but only 4 of the six fields from the stored proc's select were displayed. (Prior to this Select there is a CTE which collects the data with a ROW OVER.. PARTITION function):
    SELECT
    customer_business_unit_name,
    account_open_date_newest,
    sum (CASE WHEN currentrisk =1 THEN 1 Else 0 End) lowcount ,
    sum (CASE WHEN currentrisk =2  THEN 1 Else 0 End) midcount ,
    sum (CASE WHEN currentrisk =3 THEN 1 Else 0 End) highcount,
    sum (CASE WHEN currentrisk =0 THEN 1 Else 0 End) unknown
    FROM    records
    WHERE   rn = 1
    group by customer_business_unit_name,account_open_date_newest
    Only the COUNT fields show up in the Fields box (see the graphic LINKS CHECKED.JPG).
    Where have I gone wrong??
    Again, thank you for your earlier reply.

  • How to disappear the sub Report if the values are null from db..

    hi.
    i have one requirement ie.
    i put two sub reports at report footer section..
    sub report values are coming from the data base
    Some times  there is no values in data base at sub report two
    plz have a look on below image..it becomes empty.
    can i disappear the sub report if there is no values..
    I need your valuable suggestions..

    Hi
    In your sub reports, you also have to suppress the values (report labels,headings etc) using a formula.
    Go in Report Menu--Section Expert--Suppress -- Formula editor and write the follwoing :
    if Count({Yoursubreportfield)}) > 0 then false else true
    This will suppress your headers and footers or any other secitons which has static information.
    Now in the main report go in section expert and check 'Suppress Blank Sections'
    Also check you have applied New Page before or After for any of your sections.
    --Praveen G

  • Data doesnt show when report is run but shows in preview mode or exported to PDF

    I have  tablix and sub reports in that tablix.. When I run the report and go to the second page i dont see any data from the sub report... but if i export it to pdf i do see data in that spot...
    What should i do to fix it? the page size for this report has been set for legal I have tried messing with the page size and removed the margins for the sub report...
    Any help will be appreciated.
    Thanks
    Karen

    Hi Karen,
    As per my understanding, I think this issue can be caused by Interactive Size. InteractiveSize is used by the HTML rendering extension to provide the equivalent of Page Size. Because the HTML rendering extension dynamically resizes a report to accommodate
    drilldown, drillthrough, and show/hide features, the report server uses different properties to support pagination on dynamic pages. So please check the InteractiveSize of the report, make sure it uses the same size as PageSize.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for