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)
how show custom error message to user in birt report
sarmistha_birt
I have the following input parameters in the report
1. Begin Date
2. End Date
I want to restrict the user to show only one month data.
That I am able to achieve.
But in case the duration is more than 1 month now it is showing birt exception that validation for begin date failed.
Instead I want to show a custom message that "you are allowed to view only one month data".
How can this be done? I have tried using javascript alert but it is not working.
Kindly help.
Find more posts tagged with
Comments
BRM
<p>Why not just get the Begin date and compute the end date? That way the user doesn't have to enter it and so there is no need for the error checking. If you have to have both parameters then you might look into cascading parameters which allow parameters to be dependent on other parameters. You could get the Begin date and then compute the range of allowable end dates and so eliminate the possibility for error on the part of the user. </p>
sarmistha_birt
Hi,
Is there a way to display custom error message using javascript alert?
sarmistha_birt
In our case, user will have the flexibility to enter any date as begin date and end date but the max allowed duration between begin date and end date is 1 month.
So I am looking for a way if a java script alert can be shown if user selects a end date which is more than 1 month from the begin date.
Kindly help.
sarmistha_birt
<p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">Dear Experts,[/color][/font]</span></p><p> </p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">I have a report with “Begin Date†and “End Date†as input parameter. I want to restrict the user to view only 1 month data. I have used the following code in the “validate†script of end_date input parameter.[/color][/color][/font][/font]</span></span></p><p> </p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"><span style="font-size:medium;"><strong>[font="tahoma, sans-serif;"][color=#000000;]if[/color][/color]</strong>[/font][font="tahoma, sans-serif;"][color=#000000;](DateTimeSpan.months(params["begin_date"],params["end_date"]) == 0){[/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"><span style="font-size:medium;"><strong>[font="tahoma, sans-serif;"][color=#000000;]true[/color][/color]</strong>[/font][font="tahoma, sans-serif;"][color=#000000;];[/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">}<strong>else</strong>{[/color][/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"><span style="font-size:medium;"><strong>[font="tahoma, sans-serif;"][color=#000000;]false[/color][/color]</strong>[/font][font="tahoma, sans-serif;"][color=#000000;];[/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">}[/color][/color][/font][/font]</span></span></p><p> </p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">This works but it does not tell user that he is allowed to view only 1 month data. I want to show the following custom message:[/color][/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"> [/color][/font]</span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">"Max allowed duration for the report is 1 month only".[/color][/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"> [/color][/font]</span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">How can i achieve this? Kindly help.[/color][/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;"> [/color][/font]</span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">Thanks & Regards,[/color][/color][/font][/font]</span></span></p><p>[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">[font="tahoma, sans-serif;"][color=#000000;]<span style="font-size:medium;">Sarmistha[/color][/color][/font][/font]</span></span></p>
Sai krishna
<blockquote class="ipsBlockquote" data-author="sarmistha_birt" data-cid="125471" data-time="1391601535">
<div>
<p>I have the following input parameters in the report 1. Begin Date 2. End Date I want to restrict the user to show only one month data. That I am able to achieve. But in case the duration is more than 1 month now it is showing birt exception that validation for begin date failed. Instead I want to show a custom message that "you are allowed to view only one month data". How can this be done? I have tried using javascript alert but it is not working. Kindly help.</p>
</div>
</blockquote>
<p>Hi Sarmistha,</p>
<p> </p>
<p>I too have to display the custimized error instead of default error. Did you find any solution for your problem? If so could you please share your solution to me also.</p>
<p> </p>
<p>Thanks in Advance,</p>
<p> </p>
<p>-Sai</p>