jasperreport server scheduling with today's date - jasper-reports

I'm trying to set up a report using the scheduler with today's date as the input parameter. Is this possible?
I see you can set static value for the input parameter but cannot set it to now() or some variant.

report parameter name is $P{Date}
I've set the default expression to
($P{Date} == null ? new Date() : $P{Date})
And it seems to work.

Sam, in your report, could you create a parameter with a default value of today's date (see Filtering on a Date Range: http://jasperforge.org/plugins/mwiki/index.php/Jasperserver/Filtering_on_a_date_range)? Then make it mandatory so JasperReports Server will choose the default value if no other input is given.

Related

How could i set yesterday value as default value for a numeric parameter in datastage?

I have a numeric datatype parameter in Datastage.
*parameter name: VAR_ETL_DATE
*format:YYYYMMDD
*ex:20210612
How could i set yesterday value as default value for this parameter?
Format:YYYYMMDD (numeric)
*Example: Today:20210824
*When i run a job including VAR_ETL_PARAMETER with default value, The job should run with yesterday value(20210823)
You can't set it in a static sense, because the date of yesterday is a moving target. The best you could do would be to set it in a controlling sequence job that invokes your job.
Use any of the date offset functions to set the value. For example you could use Date() - 1 as the generating expression directly in the Job activity in your sequence.

SSRS Report Date Parameter Default for the current Year

I have an SSRS Report I've created with a "Date/Time" Parameter I have created. I am trying to create a Parameter that Defaults to the Current Year. For example in "2020" I want the Paramater to default to "01/01/2020" when we hit 2021 I want it to default to "01/01/2021" Here is what I have tried. For my default value in the parameter I have the following expression with no success.
=CDate(Year(Now())+"-"+Month(01)+"-"+Day(01))
You can do this using the following expression.
=DateSerial(YEAR(Today()), 1, 1)
You can use CDate but that relies on strings. DateSerial is easier to work with in your scenario.

Microsoft access change the date format from dd/m/yyyy = 28/9/2018 to dd/mm/yyyy = 28/09/2018 and its all data

i want to change the date format of my microsoft access because of im having a problem displaying the data of my program on datagridview and crystal report.because the program is supposed to read the date on dd/mm/yyyy but on my microsoft access it is format on dd/m/yyyy. is possible to change it to dd/mm/yy and all records in my database thanksss.
Date values carry no format. However, a default format - as to your system settings - is applied whenever a date value is displayed to make it human readable.
So, either change your system settings, or apply the format you prefer to the Format property of any control (textbox) where a date value is displayed: dd/mm/yyyy
How the dates are displayed in Crystal Reports is not related to VB.
I agree that whether Crystal Reports supports custom formatting and how is not a VB6 question.
As for a DataGrid, it is fairly simple:
'Reference to: Microsoft Data Formatting Object Library 6.0 (SP6)
Set StdDataFormat = New StdFormat.StdDataFormat
With StdDataFormat
.Type = fmtCustom
.Format = "dd/mm/yyyy"
End With
Set DataGrid1.DataSource = RS
Set DataGrid1.Columns(0).DataFormat = StdDataFormat

How to check if date equals date of datetime property only using query parameters

I have a DateTime property.
I want to check if a date is equal to the date in my property and it has to be done purely in the url query parameters available in OData v4.
This doesn't work :(
GET ~/odata/foo$filter=date(myProperty) eq date(1980-01-01)
Yes I can use greater then or equal but that's is already working as intended. It's equal and not equal that's the problem.
From ABNF rules, Date value is a value with format:
dateValue = year "-" month "-" day
So, I think you shouldn't add date prefix. That's:
GET ~/odata/foo$filter=date(myProperty) eq 1980-01-01
Here's some test cases provided by ODataTeam:
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L169-L171
and
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L208-L212
Besides, there's a simple tutorial you can refer to:
http://odata.github.io/WebApi/#04-04-date-and-timeofday-support
Thanks. Hope it can help.

Sending parameters to report from Java code

I need to send a timestamp value as parameter from java to JR report. I tried the following code but I'm getting a blank report.
My JRXML File:
`
`
The report works fine with normal date parameter but fails to display with Time-stamp value.
My Java code :
`
I tried various values of timestamp Ex: (new java.sql.Timestamp(2013-02-27) but it is not working.
Use:
new SimpleDateFormat("yyyy-MM-dd").parse("2012-01-01");
Simply putting:
new Date(2012-01-01);
would give definitely wrong date, probably EPOCH start date.
Ensure it's MM not mm when parsing your date for month. See SimpleDateFormat javadoc
EDIT
See the image. The date your default values will generate is around 1970.
Hence your Between Condition will get all the values between 1970 to Today.
EDIT : 2
In my opinion You are setting wrong parameter in Table's datasource.
Instead of setting From_Date & To_Date from Fields set them as parameter from the main report itself.
Refer Image.