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. 

Similar Messages

  • Display multiple parameters in report header

    i am attempting to display a multiple parameter selection in my report header
    i user
    join({?parameter},",")
    in the stored proc it is a varchar
    in the formula editor i receive this error
    a string array is required here
    what do i need to do to display the selected parameter values
    i have used this function before with varchars and have had no problems

    i used the following syntax in my sp which produced the correct results. i just placed the parameter in the header without using the join function and it works like a charm.
    ALTER   PROCEDURE [dbo].[Pr_orn_whse_rcpts]          
         (@From_Crt_Dte     datetime ,
          @To_Crt_Dte     datetime,
         @whse          varchar(90))
    AS          
    CREATE TABLE #T_Localwhs
         warehouse varchar(6) null
    DECLARE
         @var     varchar(6),
         @i     numeric,
         @whs     varchar(6),
         @chk     numeric
    SET @i = 1
    SET @var = (charindex(',',@whse))
    IF @var <> 0
         BEGIN
         WHILE (@i < @var)
              BEGIN
                   --SET @var = (CHARINDEX(',',@whse))
                   SET @whs = LTRIM(LEFT(@whse, (@var-1)))
                   INSERT #T_Localwhs (warehouse) VALUES (@whs)
                   SET @whse = RIGHT(@whse, (LEN(@whse)-@var))
                   SET @var = (CHARINDEX(',',@whse))
              END
         INSERT #T_Localwhs (warehouse) VALUES (LTRIM(@whse))
         END
    ELSE
         BEGIN
         INSERT #T_Localwhs (warehouse) VALUES (LTRIM(@whse))
         END
    then you add a nested query to join it to the sp. as below. above your where statement.
    JOIN     
              SELECT DISTINCT
                   Warehouse
              FROM      #T_Localwhs
              ) TW
         ON     in_wthdr_tbl.in_wthdr_frwhs = TW.warehouse
    WHERE

  • Stored Procedure for displaying data in Crystal Reports

    Hi I am new to Oracle & Crystal Reports,so can any one please give me sample stored procedure to display data in Crystal report from Oracle by passing rwo input values.

    from site:-
    Crystal Reports will only support the return of a single refcursor from Oracle. Even the latest and greatest version 10 doesn't allow you to return more than one recordset at a time. You could add one more step to your procedure that would join up the output of the multiple refcursors into a PL/SQL table and then fetch the result set out through a single refcursor. That way you are using temporary space that will be cleaned up as soon as the connection is terminated and will only be returning a single refcursor

  • 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

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

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

  • How to display data in interactive report column without colons (:)

    Dear Apex gurus,
    I'm a newbie and have just created an Apex application from a spreadsheet. I've created a named list of values and used it in a checkbox against a field in the default page 3 Create form.
    When I've selected multiple values in my check box in the form, the data in the interactive report appears as one line with colons separating the selected values like this: Dog:Cat:Bird
    What I would like is to have the data appear in the interactive report column as a multi-line list like this:
    Dog
    Cat
    Bird
    I can work around this by modifying the SQL code in the Region Source of the Region Definition of the report (Default Page 1 interactive report) to replace the colons with <br>
    SELECT replace("PETS_CHOSEN",':','<br>') "PETS_CHOSEN", FROM "MYAPP" Note: this doesn't format properly in the posting. I replace the colon with a html br
    This works, but seems to be a hack to me. I am guessing that I've missed a simple option setting somewhere, but I can't find it.
    The other problem with this solution is that when I export the report to Excel, what is exported is Dog<br>Cat<br>Bird, which is seems worse than colons.
    Thanks,
    - Morgan
    Edited by: mnrussel on 16-Feb-2009 04:13

    Hi Morgan,
    I think you have at least two choices:
    1 - Replace the colons with ', ' (comma and space) - sort of reasonable on screen and in an export
    2 - Create a second page that has the same report but uses the "export: csv" template. Create a manual link to this page to replace the standard Export link. When such report pages are requested, they download immediately instead of displaying. You can, therefore, use commas in this one and &lt;br&gt; tags in the on-screen report version
    Andy
    ps - To display tags in a post, use &amp;lt; for &lt; and &amp;gt; for &gt;

  • Problem in Displaying Data for Localised Reports

    Hi everyone..I am having a problem with crystal Reports. I need Malayalam unicode( INDIAN Language) to be displayed in the reports, this data will be binded from database.
    And the problem is : After applying this unicode font to the labels of my reports, some labels in the reports are going invisible.Also, previously  if I increase the font size beyond 22, I used to get "A Generic error occured in GDI+".  But after changing the textformat property of the field to "crRtfText" from "crstandardText" , I could resolve this Generic Error.
    And, I could also observe that the last char of the fields in the "details" section is repeating.
    This is the code I am using to apply local font to the labels.
    Private Sub assignfont()
    Dim Mfont As New Font("kartika", 20, FontStyle.Regular,GraphicsUnit.Pixel)
    CType(Report.Section8.ReportObjects("Field45"), CrystalDecisions.CrystalReports.Engine.FieldObject).ApplyFont(Mfont) 
    CType(Report.Section8.ReportObjects("Field48"), CrystalDecisions.CrystalReports.Engine.FieldObject).ApplyFont(Mfont)
    End Sub
    And I am calling this function in the form load event of that report.
    Any suggestion on this is greatly appreciated........Thanks in advance..

    Dear MJ,
    thanks for the reply and I am really sorry for my delay. Actually I got vexed waiting for any reply and stopped opening this forum.
    And coming to your suggestion,
    Ya, I tried assigning font at design time also, but nothing worked for me.
    Even a textbox control also cannot show few characters which are said to be complex in malayalam script.
    So, do u feel getting BOBJ support is the only way for this?
    Thanks once again for your interest.
    Regards,
    raj.

  • Display date in Aging report

    Hi,
    In 2007B version the detailed aging report PLD doesn't contain any date field
    I tried to create a date field and linked with variable but it doesn't show any values
    My financial year starts every year with the new numbering series starting with 1.
    Is there any method by which i can bring this date field in 'detailed aging report'
    Thanks in advance
    Md.nazeer Shaikh

    Hi Gordon,
    Thanks for the reply.
    I understand that we can design the report by using the crystal report
    My only concern is sometimes because of only one extra field requirement we need to re-design the whole report eventhough it exists right there in the package
    Regards
    Md.nazeer Shaikh

  • SSRS - Is there a multi thread safe way of displaying information from a DataSet in a Report Header?

     In order to dynamically display data in the Report Header based in the current record of the Dataset, we started using Shared Variables, we initially used ReportItems!SomeTextbox.Value, but we noticed that when SomeTextbox was not rendered in the body
    (usually because a comment section grow to occupy most of the page if not more than one page), then the ReportItem printed a blank/null value.
    So, a method was defined in the Code section of the report that would set the value to the shared variable:
    public shared Params as String
    public shared Function SetValues(Param as String ) as String
    Params = Param
    Return Params 
    End Function
    Which would be called in the detail section of the tablix, then in the header a textbox would hold the following expression:
    =Code.Params
    This worked beautifully since, it now didn't mattered that the body section didn't had the SetValues call, the variable persited and the Header displayed the correct value. Our problem now is that when the report is being called in different threads with
    different data, the variable being shared/static gets modified by all the reports being run at the same time. 
    So far I've tried several things:
    - The variables need to be shared, otherwise the value set in the Body can't be seen by the header.
    - Using Hashtables behaves exactly like the ReportItem option.
    - Using a C# DLL with non static variables to take care of this, didn't work because apparently when the DLL is being called by the Body generates a different instance of the DLL than when it's called from the header.
    So is there a way to deal with this issue in a multi thread safe way?
    Thanks in advance!
     

    Hi Angel,
    Per my understanding that you want to dynamic display the group data in the report header, you have set page break based on the group, so when click to the next page, the report hearder will change according to the value in the group, when you are using
    the shared variables you got the multiple thread safe problem, right?
    I have tested on my local environment and can reproduce the issue, according to the multiple safe problem the better way is to use the harshtable behaves in the custom code,  you have mentioned that you have tryied touse the harshtable but finally got
    the same result as using the ReportItem!TextBox.Value, the problem can be cuased by the logic of the code that not works fine.
    Please reference to the custom code below which works fine and can get all the expect value display on every page:
    Shared ht As System.Collections.Hashtable = New System.Collections.Hashtable
    Public Function SetGroupHeader( ByVal group As Object _
    ,ByRef groupName As String _
    ,ByRef userID As String) As String
    Dim key As String = groupName & userID
    If Not group Is Nothing Then
    Dim g As String = CType(group, String)
    If Not (ht.ContainsKey(key)) Then
    ' must be the first pass so set the current group to group
    ht.Add(key, g)
    Else
    If Not (ht(key).Equals(g)) Then
    ht(key) = g
    End If
    End If
    End If
    Return ht(key)
    End Function
    Using this exprssion in the textbox of the reportheader:
    =Code.SetGroupHeader(ReportItems!Language.Value,"GroupName", User!UserID)
    Links belowe about the hashtable and the mutiple threads safe problem for your reference:
    http://stackoverflow.com/questions/2067537/ssrs-code-shared-variables-and-simultaneous-report-execution
    http://sqlserverbiblog.wordpress.com/2011/10/10/using-custom-code-functions-in-reporting-services-reports/
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How can I include date in report header

    How can I display the current date in my report header? I do not wish to modify the sql statement to include the sysdate.
    Can I add the date in the 'Report and Customization Form Text' or in 'Additional PL/SQL Code'? If so then how?

    Maxine,
    In the last tab of the report wizard,
    you can add the plsql to display the date.
    Alternately,create an unstructured UI template and add the [oracle][oracle] tag
    and insert the plsql in it to display the
    date

  • Report does not display data

    I have a crystal XI report that when run will not display data; if the report should be six pages that is the number of pages that will be generated.  The problem is that the pages show up as blank.  If the blank pages are exported the exported file will contain data, if the report is sent to a printer the report will contain data, but no data is ever displayed on the screen.  This report has been loaded on 15 other computer and runs perfectly. Any help would be greatly appreciated.  By the way if this user logs in remotely and runs this report it will display data.

    A few ideas;
    1) Make sure you are working with [SP 6|https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe].
    You are on SP 2...
    [SP6 msm|https://smpdl.sap-ag.de/~sapidp/012002523100000634032010E/crxir2sp6_rdc_mm.zip]
    2) Try different resolutions
    3) Try to see if there is an updated video driver
    4) Make sure there is a default printer driver installed.
    5) Run [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] see if there are any differences in dlls loading on a box that works and the one that does not (CR and non CR dlls).
    Ludek
    Edited by: Ludek Uher on Feb 22, 2010 10:32 AM

  • 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

  • Date Prompt result in Report Header

    Hi,
    I am hoping someone can help, I am just getting started with BI but already thinking what I need is not possible. I hope someone can prove otherwise.
    I have a dashboard with several reports that when printed goes across 3-5 pages. There is a date prompt that is used to select the business date for which I want the data to show. What I need to show is the date of the data in the report header for every page that the report runs too.
    I have set the result of the date prompt to set a presentation variable and have set the report header to show @{rptDate}. This works when on the dashboard, although shows TIMESTAMP '2011-09-01' which I would like formatted as 1 September 2011, but more importantly when printed to pdf it shows @{rptDate}
    I have considered setting a report which just returns this date, or putting it in a report header, but that does not meet required formatting consistency, but also I then dont know how to repeat this at the top of multiple pages.
    Thanks in advance for any suggestions.
    Simon

    Thanks Deepak. I am using timecreated in the footer already but that is a different date. I require the ability to run the report for historic dates, and show the date the report contains, rather than the date it was run. ie Report header shows 31/08/11 even if it was generated on 2/9/11.

  • From and To Date in the report

    Hello friends,
                   Can we display the From Date and TO Date in the report heading (not in the column) which is entered by the User.

    hi,
        Hey u use Replacement path variable for this.
        in the new selection which u have created while writing the description/name of it use the replacement patgh variable and u will get the user entered dfates.
    eg.
    purchases &Replacement_path_variable&
    then the column heading would be
    purchases Mar 2008.
    regards,
    VJ

Maybe you are looking for