Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DateTimeSpan.addDate() Throws exception
Krelek1000
I am wondering if anyone has had this issue. I am on BIRT 2.1.2.
I am building a report that looks at a Frequency and adds 1.25 times the frequency to a date. So here is a little idea of what I am doing:
Under Fetch statement:
Freq = 7;
Freq *= 1.25;
TargComp = DateTimeSpan.addDate((Beginning Date),0,0,Freq);
When the report finishs I get the following issue:
+ Unhandled exception when handling script...
By commenting out each line, I was able to find that the DateTimeSpan is causing the exception in the report. I have tried debuggin but cannot figure out what is wrong. Does anyone know of a different way to add "Freq" days to a date field? Or is this a common occurance and it shouldn't be worried about?
Thanks
Krelek1000
Find more posts tagged with
Comments
mwilliams
Hi Krelek1000,
What determines the frequency? Is it always 7? You're wanting to add 1.25 times the frequency to your date field coming in from the dataSource?
Krelek1000
Michael,
Basically there is a field on the database that determines it called Frequency. There is another called FreqUnit which determines what the the number of Days to multiply to the Frequency. Weeks, Months, Days, Years. So Determining the Frequnit (1,7,30, or 365) I take that number and multiply it by the Frequency. If the result is < 7 then I round the number up to 7 and then multiply it by 1.25.
The problem is that the report doesn't throw the exception until the end of the report. The report runs fine in BIRT but for some reason or another, BIRT doesn't like that one line. The DateTimeSpan that is. I commented everything out and found that the one line throws the exception in BIRT 2.1.2. Unfortunately, I cannot upgrade BIRT right now due to the system requiring that specific BIRT report version.
Is there another way to add a the number of days to a report that I can try?
Thanks
Ben