logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Kuldeep  
#1 Posted : Monday, September 7, 2015 12:25:45 PM(UTC)
Kuldeep

Rank: Newbie

Groups: Registered
Joined: 9/7/2015(UTC)
Posts: 4
India
Location: Pune

Thanks: 1 times
Hello,

I am doing a feasibility study of using Seal reports for our project as reporting tool. I am struggling to find a way, where i can pass the value to a column in oracle which is a DATE type.

1. I have dragged the date column in the 'Restrictions and Aggregation' section
2. In the Definition section i have selected Operator as 'Between'
3. In the Restriction values section i have tried all the combinations ..i need to filter the data on current date i.e Sysdate in oracle.

When i type in Sysdate and tab out i get an error message that => Property value in is invalid. Invalid numeric value Sysdate.

Tried to work around the error by going to Advance section and change the dataype from Default to Date & time.
I have tried using Today from the dropdown when of Value 1 Keyword.

This allows me to go ahead ..but when i run the report ..i get an error Ora -01843 Not a Valid Month.

please help ..to resolve this problem,...thanks

--
Regards,
Kuldeep
epf  
#2 Posted : Monday, September 7, 2015 1:19:45 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Hello, first, you should use keywords for date restrictions:
Now, Today, ThisWeek, ThisMonth and ThisYear allow to transform dynamically your restriction when the report is executed.

Then you should have a date format issue:
Once your restrictions set, click on the [View SQL] button to see what is going on.

It is often due to a bad configuration of your Connection:
Click on you connection in the tree view, and check that the Database Type property is set to Oracle
Check also the Date Time format property (yyyy-MM-dd HH:mm:ss by default) that allows to control how is formatted the date restriction in the SQL generated...

Thanks to let us know if you get the solution.
Kuldeep  
#3 Posted : Tuesday, September 8, 2015 8:53:30 AM(UTC)
Kuldeep

Rank: Newbie

Groups: Registered
Joined: 9/7/2015(UTC)
Posts: 4
India
Location: Pune

Thanks: 1 times
Thank you very much for your quick response.

I have followed the steps provided by you and have moved a bit further. I still have couple of questions for which I would need your help.

1. I have selected a Date datatype Column in the Restrictions section. For this restriction I have set Prompt Restriction as Prompt at Execution.
2. When i run the report, I am prompted for the Date value ...which i am able to pick from the Calander control.
3. When i select the required date and when the date is displayed on the box(area from where its picked to filter the data in the table) I see that the date format is mm/DD/yyyy.

Please suggest how can i change it to dd/mm/yyyy or any other format.

My other problem is with the ora error i get while running the report...
1. I can see in the SQL view...that the restricted field is shown as 1=1..looks like a palce holder for runtime value substitution
2. Due to this when the value is picked at runtime...the Where clause becomes as follows:
Date_col = ('08/09/2015 00:00:00')
3. Due to this i get an oracle error that ORA:01843 : not a valid month

This proble will go off if the WHERE clause is replaced as follows:
Date_col = to_date('08/09/2015 00:00:00', 'dd/mm/yyyy hh:mi:ss')

Please suggest how i can make Seal report to actaully have a date value prefixed with the TO_DATE oracle fuction.

If there is another way of filtering data based on oracle dates ..please suggest that..I am ok with any solution.

Thanks in advance.

regards
Kuldeep
epf  
#4 Posted : Tuesday, September 8, 2015 12:24:49 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Did you check your connection configuration (where you have defined your connection string) ?
If you set your Database Type to 'Oracle' in your connection, the Date Time format is normally set to 'yyyy-mm-dd hh24:mi:ss',
so you should see this format in the SQL generated.

Is your restriction a real Date type ? You should not force the datatype column in the restriction, it should works automatically....

Try first to make a simple sample on a small table having a date column.

Actually, I made a small test:
When you create automatically your source, the column type is set to Text instead of Date&Time for a DATE type in Oracle.
So just change the column type in your column in your data source and it works fine.
This may be enhanced in a future version...

Edited by user Tuesday, September 8, 2015 12:49:19 PM(UTC)  | Reason: Not specified

Kuldeep  
#5 Posted : Tuesday, September 8, 2015 1:24:25 PM(UTC)
Kuldeep

Rank: Newbie

Groups: Registered
Joined: 9/7/2015(UTC)
Posts: 4
India
Location: Pune

Thanks: 1 times
Thanks again ....

I have tried a simple report with Date datatype in the Restriction field...and as per your instruction it works fine...

I have realized that the column i am using is actually a Timestamp datatype.

In the connection section i have Oracle and date format as mentioned by you as 'yyyy-mm-dd hh24:mi:ss.

any clue ...on what needs to be done for timestamp data type column ..coz i am getting problem ..when using Keyword Today and fetching teh records.

I have tried what you have mentioned in your test too....there too i have set column data type as Date & Time.

regards
epf  
#6 Posted : Tuesday, September 8, 2015 2:20:08 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Yes I see, you have to convert your TimeStamp into a Date:
In your column definition, change the Name of you column from
'YOURCOLUMNNAME'
to
'to_date(to_char(YOURCOLUMNNAME, 'dd-mon-yy'))'

and set the Date Type to 'Date & Time'

It should do the work.
thanks 1 user thanked epf for this useful post.
Kuldeep on 9/8/2015(UTC)
Kuldeep  
#7 Posted : Tuesday, September 8, 2015 4:45:54 PM(UTC)
Kuldeep

Rank: Newbie

Groups: Registered
Joined: 9/7/2015(UTC)
Posts: 4
India
Location: Pune

Thanks: 1 times
Perfect solution ...i am now having a hang of the way Seal reports works..
Thanks for the solution.

Something which i have noticed and would like to bring to your notice too...
When we select a date from the calander control to populate the value for date on which we want to filter the rows...then as we pick the date ..its displayed in mm/dd/yyyy format ..and after the report is fetched ...it changes the format thats defined in the report manager.

Thanks again for the solution on how to filter data on a oracle timestamp column

regards
kuldeep
Sudhanshu  
#8 Posted : Monday, October 19, 2015 10:36:25 AM(UTC)
Sudhanshu

Rank: Newbie

Groups: Registered
Joined: 10/19/2015(UTC)
Posts: 1
India
Location: Mumbai

Hi,
I am using Oracle as DB, whenever I navigate to different report, all the mapping between Columns and Enum to restrict data will destroy.
epf  
#9 Posted : Monday, October 19, 2015 12:18:26 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Hi, can you make a new post ?
Your question is not clear at all, can you explain it again ?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.