Welcome to the Axosoft Community, Sign in | Register | Help
in Search

Access to filter parameters for display on report header?

Last post 06-13-2007, 9:23 AM by Dan Suceava. 4 replies.
Sort Posts: Previous Next
  •  05-16-2007, 8:01 AM 11674

    Access to filter parameters for display on report header?

    I am trying to create a work log report that will display some of the filter criteria I selected within the OnTime interface. Specifically, I need to show the FromDate and the ToDate. I see these are parms of the sps_worklogreport procedure, but I cannot find a way to access what values were selected. Is there a way to do this?

     

    Thanks. 

  •  05-16-2007, 5:23 PM 11684 in reply to 11674

    Re: Access to filter parameters for display on report header?

    You should be able to copy the current built in work log report and look at the report code on how certain fields are called from the OnTime database. This should give you enough information on how create a new work log report.  If that doesn’t work, than you may need to create a custom report from the “Others Reports” section in the OnTime report designer.

    Thank you,


    Dragan Marceta
    www.Axosoft.com
  •  05-18-2007, 6:09 AM 11711 in reply to 11684

    Re: Access to filter parameters for display on report header?

    Yes, I'm able to do both of those tasks, but it doesn't solve my problem. I am trying to display the "From Date" and "To Date" from the custom date filter in the OnTime GUI. I need to show what date range was used to filter the data on the report and I cannot access any variables/values that seem to contain the passed in parms. There is a global variable for the selected project and the report title, for example, but nothing else that I can find.

    ActiveReports even has a "parameters" collection, but it does not seem to be populated.

     

    Is there a way to access the dates that the report is filtering by? 

  •  06-12-2007, 11:55 PM 11952 in reply to 11711

    Re: Access to filter parameters for display on report header?

    Hi, I am trying to do exactly what Greg is/was trying to do so any help that you can provide would be greatly appreciated.

    e.g.

    For a worklog report that uses the following stored procedure (spS_WorkLog_WithNames) how can I access the parameters @FromDate and @ToDate and include those on the report? I need to be able to print the period that the worklow report is for to make it useful.

    In the Help file the listed Global Variables are shown as

    • rptTitle
    • rptSelectedProject
    • rptPrintHTMLDetails
    • rptSelectedGroupField

    ALTER  procedure [dbo].[spS_WorkLog_WithNames]
    (
        @ItemTypeId int = null,
        @ItemId int = null,
        @FilterByProjectSelection bit = 1,
        @ProjectId int = null,
        @CustomerId int = null,
        @CustomerContactId int = null,
        @UserId int = null,
        @IncludeInactiveProjects bit = 1,
        @IncludeSubProjects bit = 1,
        @WorkLogTypeId int = null,
        @FromDate datetime = null,
        @ToDate datetime = null,
        @IncludeArchived bit = 0,
        @orderby nvarchar(4000) = N'',
        @page int = 0,
        @rowcount int = 0,
        @debug bit = 0
    )

     If anyone knows of a way to access that or how to print a min or max date on a report then please please reply. I can build a report from scratch using access but I would prefer to have the report as a part of OnTime.

    Cheers,

     

    Chris 

  •  06-13-2007, 9:23 AM 11961 in reply to 11952

    Re: Access to filter parameters for display on report header?

    There is currently no way to access the filter data from the report, we don't pass that into the report.

    To get the min date and the max date out of the dataset and print them on the report you can do the following:

    1. In the script section of the report, declare 2 date variables at the top:
      private System.DateTime minDate = System.DateTime.MaxValue, maxDate = System.DateTime.MinValue;
    2. In the Detail_Format() event handler add code to get the min and max:
      System.DateTime dt = (System.DateTime)rpt.Fields["WorkLogDateTime"].Value;
        if (dt.Year > 1900)
        {
         if (minDate > dt)
          minDate = dt;
         if (maxDate < dt)
          maxDate = dt;
        }
    3. Add two labels to your report footer section
    4. Add code in the ReportFooter_Format() event handler to display the dates:
       ((Label)rpt.Sections["ReportFooter"].Controls["Label14"]).Text = minDate.ToShortDateString();
       ((Label)rpt.Sections["ReportFooter"].Controls["Label15"]).Text = maxDate.ToShortDateString();

     

     


    Dan Suceava
    http://www.axosoft.com
View as RSS news feed in XML

© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software