Home » Developer & Programmer » Reports & Discoverer » Report generating wrong data in Windows7
Report generating wrong data in Windows7 [message #553654] Mon, 07 May 2012 10:44 Go to next message
Spada
Messages: 14
Registered: March 2012
Junior Member

Hi!

I am actually having problems with a report that is generating wrong data in Windows 7 only. I have the same report working correctly on many Windows XP Computers.

May I have some suggestion on what's going on?

Re: Report generating wrong data in Windows7 [message #553657 is a reply to message #553654] Mon, 07 May 2012 11:00 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Don't use Windows 7?

Seriously, how do you expect any useful answer when you don't provide ANY useful information? All we know is that some report - when ran on Windows 7 - returns values different from the same report on XP. What kind of "wrong data" are we talking about? Does this report accept parameters? If so, which ones and what are their data types? How do you run these reports - from Reports Builder or on the Web (in one of internet browsers)? What Reports version do you use? Are you aware of the fact that only a small subset of Oracle software is certified with Windows 7 (at the time being)? Etc. etc. Be creative and provide as much information as possible (you don't need to specify colour of your eyes, though).
Re: Report generating wrong data in Windows7 [message #553663 is a reply to message #553657] Mon, 07 May 2012 13:12 Go to previous messageGo to next message
Spada
Messages: 14
Registered: March 2012
Junior Member

This report has 2 inputs the account number and a range of dates the first one is a character and the others are date types. It was made in Reports 6i. I am running this report using the Report Builder.

This report shows the total amount of money for the account number which is returned by a stored procedure in the database. This value is set to a number type user parameter which I use as source for the object in the body of the report.

But in Windows 7 the report shows this total as zero. Executing the procedure directly in the database the value is totally different.

[Updated on: Mon, 07 May 2012 13:14]

Report message to a moderator

Re: Report generating wrong data in Windows7 [message #553675 is a reply to message #553663] Mon, 07 May 2012 14:40 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
When DATE values are in then game, different situations are possible. What is the date format you are using? Does it match the one used in a procedure? Does a procedure, by any chance, has a WHEN OTHERS exception handler which returns 0? If so, try to remove it (WHEN OTHERS, I mean) and run the report again. What is the outcome?
Re: Report generating wrong data in Windows7 [message #553681 is a reply to message #553675] Mon, 07 May 2012 16:17 Go to previous messageGo to next message
Spada
Messages: 14
Registered: March 2012
Junior Member

I tried what you asked and nothing really changed I have a When Others and a No Data Found in the store procedure, commented both and the same kept happening. Also I have one when others right after the call of the procedure in the report but doing the same its still showing zero.
Re: Report generating wrong data in Windows7 [message #553691 is a reply to message #553681] Tue, 08 May 2012 00:10 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a table:
create table test
  (param_1 varchar2(30),   -- or, even better, datatype of a "real" first parameter of your stored procedure
   param_2 varchar2(20)    --    - " -         - " -                seconde      - " -
  );
(include more parameters if your procedure accepts it). Then create a procedure:
create or replace procedure prc_log (par_1 in varchar2, par_2 in varchar2)
  is
  pragma autonomous_transaction;
begin
  insert into test (param_1, param_2) values (par_1, par_2);
  commit;
end;

Now include call of the newly created procedure at the beginning of your stored procedure:
create or replace procedure your_proc (par_1 in <datatype>, par_2 in <datatype>, ...) is
begin
  prc_test (par_1, par_2);  -- include datatype conversion (TO_CHAR), if necessary
  
  <the rest of your code>
end;

Run the report. The PRC_TEST will insert parameters' values into the TEST table. Go to SQL*Plus and check what's being passed to the stored procedure. Does it reveal anything new / strange?
Re: Report generating wrong data in Windows7 [message #553847 is a reply to message #553691] Tue, 08 May 2012 17:41 Go to previous messageGo to next message
Spada
Messages: 14
Registered: March 2012
Junior Member

I did the test with the debug table and its inserting some weird values for example im entering the dates from 01-11-2011 to 30-11-2011 (DD-MM-YYYY) it's inserting the month always as 10 instead of 11 and the year is inserting as a random value (first test inserted year 100, second test was year 4700). Im actually checking the report to find where this value is changing.
Re: Report generating wrong data in Windows7 [message #555126 is a reply to message #553847] Mon, 21 May 2012 09:47 Go to previous messageGo to next message
Spada
Messages: 14
Registered: March 2012
Junior Member

Hi everyone!

I actually would like to check this case again since I had to change my priority. To extract the year and month from the report's date parameter I am using the next query:

SELECT TO_NUMBER (TO_CHAR (:s_date, 'YYYY')),
TO_NUMBER (TO_CHAR (ADD_MONTHS (:s_date, -1), 'MM'))
INTO s_year, s_month
FROM DUAL;

Actually this is what giving me some trouble cause before sending the year to the stored procedure I have a debug table which is showing me that the year is a ramdom number not the year that should be. Example I got year 9011,4121,0 when I was doing test with a 2011 date. The month isnt giving any problem at all.

I can't understand why this wont work in Windows7 cause it's just basic way to extract the year.
Re: Report generating wrong data in Windows7 [message #555154 is a reply to message #555126] Mon, 21 May 2012 15:32 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, if S_DATE parameter's datatype is DATE, then yes - that would be one way to extract year from it. Though, you don't need SELECT - simple
s_year := to_number(to_char(:s_date, 'yyyy'));
would do it.

Where do you use the above SELECT statement? Any PL/SQL? If so, display S_DATE's value using the SRW.MESSAGE built-in. What is the result?
Re: Report generating wrong data in Windows7 [message #555541 is a reply to message #555154] Thu, 24 May 2012 16:55 Go to previous message
Spada
Messages: 14
Registered: March 2012
Junior Member

Hi!

I changed the code query to set the year in the variable the way you suggested and it worked. Somehow using INTO in a from DUAL query was giving some problem in Windows7.

Thank you very much.
Previous Topic: How to solve this prolem
Next Topic: Skips one extra page after the last page using ORARRP
Goto Forum:
  


Current Time: Tue Sep 30 05:16:17 CDT 2014

Total time taken to generate the page: 0.12855 seconds