Compare Date Parameters on Report Viewer

Visual Studio 2010 (VB.NET)
Crystal Reports 2010
I have two date parameters in my report viewer (Start and End dates). When the user clicks the "Apply" button in the parameter panel is there any way to display a dialog box if the Start date is after the End date?
I don't see any event for the "Apply" button, just the "Refresh" button (the ReportRefresh event).

I actually got a hack job workaround to get this to work without having to write my own parameter panel or edit any of my 150+ reports:
At the form load I can loop through the controls in the crystal viewer until I find the toolbar that holds the "Apply" button and add an event handler to it's ButtonClick event.
I am using VB.NET:
'Because there is no event handler for the "Apply" button in the parameter panel,
'loop through the controls until we find the toolbar that holds that button. We can then
'add an event handler to the button click event so we can check if the "Apply" button is clicked.
For Each ctl As Control In CurrentCrystalReportViewer.Controls
    If ctl.Name = "InteractiveParameterPanel" Then
        'This control is the parameter panel
        For Each subCtl As Control In ctl.Controls
            If TypeOf subCtl Is Windows.Forms.ToolBar Then
                'This controls is the toolbar that holds the "Apply" and "Delete" parameter buttons
                Dim parmTool As ToolBar = subCtl
                'add event handle so we can catch when a button is clicked
                AddHandler parmTool.ButtonClick, AddressOf ParmToolBar_ButtonClick
                Exit For
            End If
        Next
    End If
Next
When the "Apply" button is clicked this event will then be called:
Private Sub ParmToolBar_ButtonClick(ByVal sender As Object, ByVal e As ToolBarButtonClickEventArgs)
        If e.Button.Text = "Apply" Then
            'check if there are date parameters
            If CurrentCrystalReportViewer.ParameterFieldInfo.Count > 0 Then
                  'loop through and find the start and end date parameters to compare the dates.
            End If
        End If
End Sub

Similar Messages

  • Select Row as Data filter between Report viewer webpart

    Hi All,
    i have a requirement in SharePoint 2013 which has 2 SSRS Report Viewer webpart.
    i need to pass data which i select in First webpart to second webpart.
    is this possible how can i achieve this.
    Thanks for your time.
    Regards
    Bhasker
    hi

    Hi Bhasker,
    In my opinion, you can refer to the steps as below:
    1.Get the parameters from one SSRS Report Viewer Web Part:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/454ae44f-0d29-485a-8830-d2fb0e03f250/how-to-pass-parameters-from-report-viewer-to-report-server?forum=sqlreportingservices
    http://msdn.microsoft.com/en-us/library/ff487390.aspx
    2.Pass parameters to another SSRS Report Viewer Web Part:
    http://sharepoint.infoyen.com/2012/08/25/pass-multiple-filter-parameters-to-custom-report-viewer-web-part/
    http://stackoverflow.com/questions/2564178/passing-multiple-parameters-from-custome-webpart-to-reporting-services-report-vi
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • Database query using report parameters in Report Viewer 2008 and CR-XI

    Hi - I have written a report for in-house use on an Access database. The report uses parameters to filter the record selection for reporting. The report operates fine in Crystal XI, but in Crystal Report Viewer 2008, the parameters are not shown and appear to be inaccessible. Is there a way to query the database in CRV2008, as opposed to simply showing the data that was saved from CR-XI in the report? Would I have to use the Crystal Server to do this? Is there a no-cost solution that I could use instead of CRV2008 for such functionality?
    Thanks - Barney

    Hi Barney,
    As noted CRV is for reports with saved data only, no prompting allowed. I'll move this post to the OnDemand forums, possibly they have suggestions a s work around.
    You should call our Sales team and describe your situation, possibly they have a low cost solution for you.
    If you have a .NET or Java developer available you could always write and host your own WEB app that would be simple to use and should not take to much to do.
    We have samples that you could use so most of the work is done for you.
    Thank you
    Don
    CORRECTION: Report Viewer is handled by the Report Design Forum so moving the psot back
    Edited by: Don Williams on Jan 4, 2010 9:42 AM

  • Date Parameters in 2008 Viewer

    Post Author: willywig
    CA Forum: .NET
    Date Parameters in the 2008 viewer (vs2005) are not working, It will not even prompt for them unless i throw another parameter in the report. And when I do put them in there it ignors them. Am I doing something wrong or is this a MAJOR bug in the viewer?

    Post Author: willywig
    CA Forum: .NET
    Hmmm this is not just Date parameters no Parameters will work in a record select, when added through the viewer, making the viewer Useless for running reports that require user parameters.  Do the developers even test things before they release them here

  • Parameters in Report Viewer?

    Post Author: SBurbacher
    CA Forum: General
    Kind of new to Crystal Reports, so this may be a dumb question...I'm using Crystal Reports XI Release 2 and Reports Viewer XI.  I've created a report with parameters that determine record selection.  When I open the report in Report Viewer, it doesn't allow me to select new parameter values like I had hoped.  Is this normal operation, or am I missing something?  If this is normal, what options do I have to allow my end users to take full advantage of selecting parameter values without having to set them up with a full version of Crystal Reports? Thanks!

    Post Author: Ron
    CA Forum: General
    I have instaled Windows 2003 Standard Edition SP1, Crystal Reports Server XI R2 + SP2 + BOXIR2  FixPack2.6. And my CR Server doesn't allow me under Administrator account Edit parameters value from the (2nd way) of my post above - just rise an error "Internal Error. Internal Error Occurred" and i cant do something, so i don't know that i can do insteed of the (1st_way) described above myself. Even the (1st way) works time by time, so sometimes i receive en error on CR Viewer:CrystalReportViewer List of Values failure: fail to get values. [Cause of error: Error in File dis > region > school: Database Connector Error]Unable to retrieve Object.List of Values failure: fail to get values. [Cause of error: Error in File dis > region > school: Database Connector Error] there dis, region and school are my dynamic parameters. My database connection is properly setted - i check it by running the same report with any pre-setted values (all this time Server doesn't prompt me for  new parameters values, it use old values from CR Designer). During publish reports i've tryed any cases, there are: (checked/unchecked)  Save Reports Data, (checked/unchecked)  Use Repository for refresh Data, (checked/unchecked)  Allow user to refresh reports and many other cases. The result is one - it doesn't work properly. So i don't know how to work later if every report require so difficult actions from  creating to publishing and using :(. 

  • OBIEE 10g - Unable to see data in the report view with grand total applied

    Hi,
    We're facing with a strange issue.
    We're working on a report view.
    We're able to see data when Grand total is not applied on the report. The moment Grand Total is applied, it's showing either an empty table with NULL values or "No Results" page.
    Please help.
    Thanks in advance.
    -Rama

    Hi Dpk,
    Thanks for your reply.
    I included it in the instanceconfig.xml, but the issue still exists.
    Couple of Observations
    #1 - We noticed this issue when we drill down to the level which has really sparse data.
    It works fine when we look at the enterprise wide report.
    #2 - Works fine with few dimensional attributes and facts on the report
    When we add a fact that doesn't have any value at that level, the issue starts to appear.
    Thanks in advance.
    -Rama

  • Date Parameters in Report

    Hello,
    I am using the Where property of an Open Report for date parameters.  There are reason i can not use the query criteria process.
    Can I do this with more than one parameter?
    Private Sub EligibilityReportPreview_Click()DoCmd.OpenReport "EligibilityRpt2",acViewPreview,,"effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate"End Sub
    How do add another parameter like
    DoCmd.OpenReport "EligibilityRpt2", acViewPreview, , "effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate"
    Or "termination_date >= LowTerminationDate And termination_date <= HighTerminationDate"
    Gee

    If all names referred to are fields in the record source of the report, you can use
    DoCmd.OpenReport "EligibilityRpt2", acViewPreview, , "effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate Or termination_date >= LowTerminationDate And termination_date <= HighTerminationDate"
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • "Date picker" in report - - View source shows no label for the date picker

    Hi
    In one of my reports, I am using multiple types (textarea/text/date picker/select list)
    I wanted to use a javascript based on the label, but I do not see "<label>" for Date picker in the view source due to which my Javascript fails.
    Snippet of view Source:
    <td class="t3data" ><label for="f08_0001" class="hideMe508">CATEGORY</label><textarea name="f08" rows="4" cols="16" wrap="VIRTUAL" id="f08_0001">EMPLOYEE INDUCTION</textarea></td>
    <td class="t3data" ><span class="lov"><input type="text" name="f11" size="15" maxlength="2000" value="29-FEB-08" style="padding-right:5px;" id="f11_0001" /><script type="text/javascript">
    As you can see above, we have a "label for" for the text area but not for the date picker
    Is there a reason for the same?
    Thanks
    Nitin

    Hi,
    OK - the headers attribute should also help as these will identify the correct cells. You would need to know the html tags used within each cell for each datatype.
    Would using cloneNode help you? It's a method of creating a copy of an entire row in a single instruction
    Andy

  • Passing 2 date parameters in report

    I have to create a report in such a way that ...i have to pass 2 date parameters to get the report..
    For example..
    I get report parameter pagein reports and then I enter the parameter
    Parameter1: 27-MAY-10
    Parameter2: 30_JUN-10
    and then i click RUN REPORT
    can any1 help me out how to pass this parameter in report... i am stuck at this point
    NOTE: I want to use the parameter form feature in report builder....

    @ Sarah
    what you do is to call a refort from a form. i think it is not what Suhail want.
    @ Suhail
    if i understand, you want to pass the parameters from the parameterform your report to the report.
    i think you must create a parameterform and save it als html like this:
    To create a simple Parameter Form in HTML:
    1. In a text editor or HTML editor, create an HTML page that contains a form. The
    form should contain a list of values, a field, and a button. The code for this form
    can look something like the following:
    <form name="form1" method="post" action="*NAME_form.jsp*">
    <h2>Parameter Form</h2>
    <input id="connect" type="hidden" name="userid" value="*hr/hr@db-connect*">
    <input type="hidden" name="destype" value="*cache*">
    <input type="hidden" name="desformat" value="*html*">
    <br> Date_beginn: <input type="text" name="Date Beginn" value="">
    <br> Date_end: <input type="text" name="Date end" value="">
    <input type="submit" name="Submit" value="Run Report">
    </form>
    you can save this code als .html.
    Now you can open the code in the report builder and save it als .jsp.
    you can yet start with the copilation of the report.
    i hope this code will help you.

  • Errors when viewing data with Crystal Report Viewer.

    we receive the following errors when we try to merge a crystal report with data, we are using a crystal  report viewer to display the report.
    Can someone help us with where we might be going wrong?
    Thanks
    Rajesh
    General Information
    Additional Info:
    ExceptionManager.MachineName: CCS104
    ExceptionManager.TimeStamp: 02/10/2008 12:40:31
    ExceptionManager.FullName: Congestion.Framework.ExceptionManagement, Version=33.36.0.0, Culture=neutral, PublicKeyToken=null
    ExceptionManager.AppDomainName: /LM/W3SVC/1/ROOT/BackOfficeTR4-1-128674174088125000
    ExceptionManager.WindowsIdentity: NT AUTHORITY\SYSTEM
    Renewal charges Statement Id : 37171
    Unknown Database Connector Error
    Error in File C:\WINNT\TEMP\{AE9A7C1D-F11A-41CC-B2F7-BC1062DC3A5B}.rpt:
    Unknown Database Connector Error
    Stack Trace :    at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.  (Object 
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)
       at Congestion.Core.PresentationTier.BackOffice.WF_NewReport_P.DownloadPDFStatement(Int64 lngCanId, Int64 lngFasId, String strChargeType)
       at Congestion.Core.PresentationTier.BackOffice.WF_NewReport_P.Page_Load(Object sender, EventArgs e)
    Source : CrystalDecisions.ReportAppServer.DataSetConversion

    Hi,
    Its a best practice to use the code given below in the unload event of the page or the code can also be written in a button press event so that the disposing is ensured manually(If sessions are in use).
    boReportDocument.Close();
    boReportDocument.Dispose();
    GC.Collect();
    Note: boReportDocument is the object of ReportDocument.
    This code disposes the report object after using it.
    Check the issue with [filemon|http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx] utility.
    Amit

  • How to compare dates in Crystal Reports 2008

    Hello,
    I cannot figure out how to compare the dates in the Crystal reports.
    I need all dates that are in the future to be displayed with the green font.
    So in the formula for the font for this texbox I've tried to use different
    formulas like:
    If DateDiff("d", CurrentDate, {DevelopmentTracking_SELECT.Anticipated}) > 1
    Then
         crGreen
    or
    If {DevelopmentTracking_SELECT.Anticipated} > CurrentDate Then
         crGreen
    (where DevelopmentTracking_SELECT is the stored procedure, and Anticipated
    is a date field).
    None of them worked. All dates are treated like they were in the past
    comparing to the CurrentDate. If I reverse these formulas like:
    If {DevelopmentTracking_SELECT.Anticipated} < CurrentDate Then
         crGreen
    then all dates turn to green, otherwise they always stay black.
    What could be a problem here?
    I would appreciate your help.
    Thank you.

    OK, got it, thank you. It worked.
    However, I also need to use another field value which is not on the report, like this:
    If CurrentFieldValue < CurrentDate And {DevelopmentTracking_SELECT.Completed} = False Then
    crRed
    DevelopmentTracking_SELECT.Completed is not on the report.
    Is it possible to use it with the cross-tab?

  • Data missing in reporting views

    Hi,
    As you can see below in the query, I am trying to report on hourly data (say 9:00 am, 10:00 am, 11:am , 12 pm) of current date time...I am finding data only in the CURRENT and DAILY views (whereas the DETAILS and HOURLY views are empty).
    Where do I get the hourly information (not just current hour but for a window of 5-6 hrs from current time) ?
    --25 hour period value for Read and write (Disk I/O)
    --Details view
    SELECT DISTINCT
      A.TARGET_NAME,
      A.TARGET_TYPE,
      A.COLLECTION_TIMESTAMP,
      sum(A.VALUE) AS READ_VALUE,
      sum(B.VALUE) AS WRITE_VALUE
      --A.KEY_VALUE 
    FROM
      OEM_COPY.MGMT$METRIC_DETAILS A,
      OEM_COPY.MGMT$METRIC_DETAILS B 
    WHERE
           A.TARGET_TYPE = B.TARGET_TYPE
       AND A.TARGET_NAME = B.TARGET_NAME
       AND A.TARGET_GUID = B.TARGET_GUID
       AND A.METRIC_LABEL = B.METRIC_LABEL
       AND TO_CHAR(A.collection_timestamp,'MM/DD/YYYY HH24') = TO_CHAR(B.collection_timestamp,'MM/DD/YYYY HH24')
       AND A.KEY_VALUE = B.KEY_VALUE
       AND A.METRIC_LABEL  In  ( 'Database Files'  )
       AND A.METRIC_COLUMN  In  ( 'write_cs'  )
       AND B.METRIC_COLUMN  In  ( 'read_cs'  )
       AND A.TARGET_TYPE  In  ( 'oracle_database'  )
       AND A.TARGET_NAME IN ('phadmdv')  
    GROUP BY
      A.TARGET_NAME,
      A.TARGET_TYPE,
      A.COLLECTION_TIMESTAMP
    ORDER BY
      A.TARGET_NAME,
      A.TARGET_TYPE,
      A.COLLECTION_TIMESTAMP
    --Current value for Read and write (Disk I/O)
    --From hourly table (empty)
    SELECT DISTINCT
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMP,
      sum(C.KEY_VALUE) AS READ_VALUE,
      sum(B.KEY_VALUE) AS WRITE_VALUE
      --A.KEY_VALUE 
    FROM
      OEM_COPY.MGMT$METRIC_HOURLY C,
      OEM_COPY.MGMT$METRIC_HOURLY B 
    WHERE
           C.TARGET_TYPE = B.TARGET_TYPE
       AND C.TARGET_NAME = B.TARGET_NAME
       AND C.TARGET_GUID = B.TARGET_GUID
       AND C.METRIC_LABEL = B.METRIC_LABEL
       AND TO_CHAR(C.ROLLUP_TIMESTAMP,'MM/DD/YYYY HH24') = TO_CHAR(B.ROLLUP_TIMESTAMP,'MM/DD/YYYY HH24')
       AND C.KEY_VALUE = B.KEY_VALUE
       AND C.METRIC_LABEL  In  ( 'Database Files'  )
       AND C.METRIC_COLUMN  In  ( 'write_cs'  )
       AND B.METRIC_COLUMN  In  ( 'read_cs'  )
       AND C.TARGET_TYPE  In  ( 'oracle_database'  )
       AND C.TARGET_NAME IN ('phadmdv')
    GROUP BY
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMP
    ORDER BY
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMP
    --Current value for Read and write (Disk I/O)
    --From daily table (ONLY Daily averages)
    SELECT DISTINCT
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMP,
      sum(C.AVERAGE) AS READ_VALUE,
      sum(B.AVERAGE) AS WRITE_VALUE
      --A.KEY_VALUE 
    FROM
      OEM_COPY.MGMT$METRIC_DAILY C,
      OEM_COPY.MGMT$METRIC_DAILY B 
    WHERE
           C.TARGET_TYPE = B.TARGET_TYPE
       AND C.TARGET_NAME = B.TARGET_NAME
       AND C.TARGET_GUID = B.TARGET_GUID
       AND C.METRIC_LABEL = B.METRIC_LABEL
       AND TO_CHAR(C.ROLLUP_TIMESTAMP,'MM/DD/YYYY HH24') = TO_CHAR(B.ROLLUP_TIMESTAMP,'MM/DD/YYYY HH24')
       AND C.KEY_VALUE = B.KEY_VALUE
       AND C.METRIC_LABEL  In  ( 'Database Files'  )
       AND C.METRIC_COLUMN  In  ( 'write_cs'  )
       AND B.METRIC_COLUMN  In  ( 'read_cs'  )
       AND C.TARGET_TYPE  In  ( 'oracle_database'  )
       AND C.TARGET_NAME IN ('phadmdv')
    GROUP BY
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMP
    ORDER BY
      C.TARGET_NAME,
      C.TARGET_TYPE,
      C.ROLLUP_TIMESTAMPThank you

    I dont understand. what you say
    you say that these query not returns rows and you need to know in what mgmt table is stored the mentioned information

  • Displaying Date Parameters in Report Heading

    Post Author: Jim-1003
    CA Forum: Formula
    Hello,
    I am new to Crystal Reports, and I am trying to improve an existing report definition so that the beginning and end dates selected by the user are displayed as part of the report heading.  I saw something similar in the report samples, but the sample uses custom functions that apply only to that report -- cdFormatDateRange and cdSpecialDateRange.  I have not found any documentation on how those functions were created or how to use them. Any help you can give me would be greatly appreciated!
    Thanks,
    Jim

    Post Author: Jim-1003
    CA Forum: Formula
    After some digging, I did find out more.  First of all, in the options for my Parameter, the option to allow multiple entries was set to true, so I didn't really have a range, but an array of ranges, which confused the editor.
    Second, I finally did find the source code for cdFormatDateRange, which allowed me to reuse it by copying it into the clipboard and pasting it into my report. 

  • Controling Date Parameters using SRW.DO_SQL in Reports!

    Hello Friends,
    I Need to Control the Date Parameters in Reports.
    (Dev/2000 rel2.1) In SRW.Do_SQL package
    For Example:
    'Insert into x
    select * from Y
    where Y.date between f_date and t_date';
    Here: X,Y are two tables
    f_date and t_date are two different date parameters in
    format (dd-mm-yyyy).
    NOTE: Without these two date parameters, the Query is working
    fine. But I need to Use these Parameters. Could You Please find a
    solution for Me. Thanks in advance.
    Regards
    Manoj (India)
    (Dt:18thNov'99)
    null

    Manoj (guest) wrote:
    : Hello Friends,
    : I Need to Control the Date Parameters in Reports.
    : (Dev/2000 rel2.1) In SRW.Do_SQL package
    : For Example:
    : 'Insert into x
    : select * from Y
    : where Y.date between f_date and t_date';
    : Here: X,Y are two tables
    : f_date and t_date are two different date parameters
    in
    : format (dd-mm-yyyy).
    : NOTE: Without these two date parameters, the Query is working
    : fine. But I need to Use these Parameters. Could You Please
    find a
    : solution for Me. Thanks in advance.
    : Regards
    : Manoj (India)
    : (Dt:18thNov'99)
    Hi Manoj
    your goal is to supply all three as dates (y.date, f_date,
    t_date). if some of them are not date but char, varchar, ...
    then use to_date conversion function with proper format mask.
    hope this helps.
    null

  • Report Viewer WP - Sending Parameters from querystring to Report

    Hello All,
    I have a report viewer Web Part in a page and I need to pass page query string value as parameter to this report.
    how could i achieve that??? 

    Hi,
    Please refer to the threads below:
    http://social.technet.microsoft.com/forums/sharepoint/en-US/b60bb5f8-8ce5-4a76-b100-72e4e16ecb69/query-string-url-parameter
    http://social.technet.microsoft.com/Forums/en-US/51b06f71-bd02-4d55-bdff-b96fd6330a09/passing-report-parameters-by-report-viewer?forum=sqlreportingservices 
    In addition, you could ask the question in Power View forum for more sufficient resource and assistance:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=sqlreportingservices
    Regards,
    Rebecca Tu
    TechNet Community Support

Maybe you are looking for