How do you pass a date value to BIRT report via querystring - query-string

I have made a static html page (called start.jsp) containing a form where the user select 2 date ranges and this form has date pickers for those text boxes. When the user submits
the form, it should take them to the BIRT report that I have designed. It SHOULD
pass the 2 parameters that my report needs (start date and end date).
Here is the querystring that gets appended to the URL
birt-viewer/run__report=Business_Activity_Monitoring.rptdesign &FilterStartDate=2000-01-01&FilterEndDate=2009-01-01
I get an invalid date error:
org.eclipse.birt.report.exception.ViewerValidationException: The parameter "FilterStartDate" is invalid. The value "06-08-2010" is invalid with the type "dateTime".
How is it that if I remove the querystring completely, then BIRT will prompt me to enter the
start date and end date (screenshot attached).
I enter the exact same data that the form tries to send and it works!?
This proves that my date string is correctly formatted but yet it will not accept them if they
are sent to the BIRT report via the querystring? Seems like it has a problem with the
fact that its a string in the first place.
I have correctly set up these report parameters in my BIRT report. I have also tried changing them
by specifying the "Format as" value to be a "custom" YYYY-MM-dd but this didnt work.
Is it even possible to send date parameters to a birt report via querystring?
Im guessing the solution will involve converting these strings to dates within the birt report's "script" tab.
but I dont know how to access querystring variables from here or how to set report
parameter variables.
Thanks
-Tommy

Your report parameter probably has a data type of "DateTime". As such your passing of just the date is not sufficient. When you use the OOTB parameter request pages this is accounted for under the covers. Either change your parameter data type to "Date" or append a time signature to your parameter being supplied to the report via your page (i.e. 2009-01-01 00:00:00). Either approach should do the trick.
Good Luck!

The following is the format BIRT appears to use for validation of parameters:
DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"
So if you pass in date/time as it should work
&mydate=2009-11-22 00:00:00.0

If the start date parameter you are passing is 2000-01-01, why is it giving you an error message saying 06-08-2010 is invalid? It looks as though the date parameter is being set elsewhere within the report, either as a default value or possibly within an event script.

Check your date format; remember that MM is used for month and mm for minutes.
Also check this solution, found at the Eclipse Community Forums:
Try this in the URL:
&mydate=22/11/2009&__islocale=mydate
Replace mydate with your parameter
name. The __isLocale parameter
specifies that the parameter has been
localized.

Related

Get Short Date Format/Style/Structure

Suppose my system date is 2014-02-10 & I have published my app on Internet Information System. Now Using DateTime.Now.ToShortDateString method I can get date like 2014-02-10, but how can get pattern/style/structure (e.g yyyy-MM-dd) for date? It should be irrespective of current culture.
IF I change date to 10-Feb-2014, then I should get dd-MMM-yyyy.
What's the solution? Thanks in adv..
Ah, I see. I thought you were saying that you wanted to format a date value but it seems that you're saying that you actually want the format string. In that case, you need to use get an appropriate DateTimeFormatInfo object and get its ShortDatePattern property. You can use System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat or System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat to get that DateTimeFormatInfo.

Google Docs Forms - need Pre-fill Date & Time Entry with current date and current time

Google Forms I need Pre-filled current Date & current Time Entry in date and time fields of my google form. How to do it
My solution is to make the Date field optional. The default is to assume the todays date which is what you get from the timestamp field. In case it needs to be anything else you can enter it manually.
A simple code-free solution is to make separate sections in your form and use the feature that routes users to different sections based on responses. The first section asks whether the form is for the current date/time. If yes, you use the timestamp as the date and time and route the user to the main section with your questions. If not, route them to a section to set the date and time, and then after that route them to the main section.
2023 Solution
-Google Forms has updated how dates are passed through URL parameters.
Instead of passing each component of a date as a separate param, you now pass them using the same syntax as all other fields using the YYYY-MM-DD format for your date value.
Here is an example URL:
`https://docs.google.com/forms/d/e/${formId}/viewform?usp=pp_url&entry.${dateEntryFieldID}=${YEAR}-${MONTH}-${DAY}`

Datetime Parameter In CRM report run invalid

I'm Working with SSRS Report in CRM Then I have problem about DateTime Parameter before run report below.
First, I choose date from Datetime Picker below
Then TextBox show
In fact It's should show Only date But why it's show Date & Time
And after i Choose anything in parameter section Parameter always refresh and I surely I set automatic determine in .rdl file (from my experience its should not refresh)
Second, When I choose first date of month
TextBox show
Its show.
8-Jan-15
So My Question is.
Why Text Box show Invalid value.
Why its always refresh when i choose paremeter.
And How to fix it.
Thank you.
(I think I not happen for .rdl file)
I don't know CRM but in SSRS I would say
This seems to be a bug in CRM with using other date formats: https://community.dynamics.com/crm/f/117/t/138318
Parameters refresh in case other parameters are dependent on the previous parameter.
You can't fix the refresh, you can try changing your system date format but that's not a good fix. You can try this:
http://geekswithblogs.net/naijacoder/archive/2008/06/26/123422.aspx

MS Access report parameter value

How i can open a MS Access report without giving any parameter value? I do not want dialagoue box enter the parameter value, when i click on report button. I did not put any parameter value in any query and any form regarding to this report.
Thank you
Generally this means that your report has a field where its Control Source does not exist in the Report Record Source. Check the the parameter value being requested. It's quite possible that you just mis-keyed something in one of those two places..

Symfony 2.1. How can I display a single_text time field in 12 hour am/pm format?

I have a time field on my form with widget set to 'single_text'.
My US users will want 12 hour am/pm format.
http://symfony.com/doc/current/reference/forms/types/time.html#widget
Although it's not entirely obvious, that accepts an input of 2:15pm but if the form returns because of a validation error on another field or is later opened to edit an existing record then it displays 14:15 which of course is correct but is probably off-putting.
How do I get it to display 2:15pm? I don't see an option to do that.
Well, this turns out to be harder than it should be. The problem is that the Time form type does not allow you to specify a format like the Date form type does and the format it uses is H:i. Yes, 24-hour format :-(
So, the only solution is to build your own form type which uses the h:i format. You can find instructions for how to build your own form type here:
http://symfony.com/doc/2.1/cookbook/form/create_custom_field_type.html
Then you can use the Time form type as the base for your form type and just change the format it uses. The Time form type can be found here:
/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Resources