Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how to update date in listbox
404040
<p>i have created a report with date as parameter as of now i have to update a date for next month automatically</p><p>its possible in normal jsp.. as like below</p><p> </p><p> </p><p> </p><div><select name="trandate" id="trandate" onchange="refresh()" class="FIELD" ></div><div> <%</div><div> String PrevoiusWeekDates[]=gMt.getPreviousDates(30);</div><div> </div><div> if(PrevoiusWeekDates != null)</div><div> {</div><div> for(int i=0; i<PrevoiusWeekDates.length; i++)</div><div> {</div><div> if(PrevoiusWeekDates
!= null)</div><div> {</div><div> //out.println("<option value='"+PrevoiusWeekDates
+"' >"+PrevoiusWeekDates
+"</option>");</div><div> %></div><div> <option value="<%=PrevoiusWeekDates
%>"<%if(PrevoiusWeekDates
.equals(trandate)){ %>selected <% } %> ><%=PrevoiusWeekDates
%></option></div><div> <%</div><div> </div><div> }</div><div> }</div><div> }</div><div> %></div><div> </select></div><p> </p><p>how to do in birt report? </p>
Find more posts tagged with
Comments
micajblock
<p>What version of BIRT. I do not remember the exact version it started, but now default parameter values can be expressions.</p>
404040
<p>my version is 4.3....is its possible means just provide sample-db </p>
micajblock
<p>The use the expression builder in the default value in the parameter definition UI.</p>
404040
<p>by default value how to write expression as like above is there some code..</p>
micajblock
<p>what are you trying to accomplish with your code?</p>
404040
<div>Hi,i have tried this code in java...i dono where to be initialize this code .in birt report..this code working as my excepted ...is there any way to achieve in birt report itself.. </div><div><pre class="_prettyXprint">package Sample;import java.io.PrintStream;import java.text.SimpleDateFormat;import java.util.Calendar; public class FutureDates { public static String[] getAdvanceDates(int NoOfDays) { Calendar cal = Calendar.getInstance(); String[] arrDays = new String[NoOfDays]; for (int i = 0; i < NoOfDays; i++) { String Mon = cal.getTime().toString().substring(4, 7); arrDays[i] = (cal.get(5) + "-" + Mon + "-" + cal.get(1)); cal.add(5, 1); } cal.add(2, 1); return arrDays; } public static void main(String[] args) { for (int i = 0; i < FutureDates.getAdvanceDates(8).length; i++) { System.out.println("present 7 Dates: "+FutureDates.getAdvanceDates(8)[i]+"n"); } Calendar cala = Calendar.getInstance(); cala.add(7, 8); System.out.println("Next Date updating"+cala.getTime()+"n"); String[] arrDays = new String[7]; for (int i = 0; i < 7; i++) { String Mon = cala.getTime().toString().substring(4, 7); arrDays[i] = (cala.get(5) + "-" + Mon + "-" + cala.get(1)); cala.add(5, 1); System.out.println("Future 7 Dates: "+arrDays[i]+"n"); } System.out.println("Date : "+cala.getTime()); }}</pre></div><div>OUTPUT IS:</div><div> </div><div> </div><div><div>present 7 Dates: 29-Oct-2013</div><div> </div><div>present 7 Dates: 30-Oct-2013</div><div> </div><div>present 7 Dates: 31-Oct-2013</div><div> </div><div>present 7 Dates: 1-Nov-2013</div><div> </div><div>present 7 Dates: 2-Nov-2013</div><div> </div><div>present 7 Dates: 3-Nov-2013</div><div> </div><div>present 7 Dates: 4-Nov-2013</div><div> </div><div>present 7 Dates: 5-Nov-2013</div><div> </div><div>Next Date updatingWed Nov 06 15:58:04 IST 2013</div><div> </div><div>Future 7 Dates: 6-Nov-2013</div><div> </div><div>Future 7 Dates: 7-Nov-2013</div><div> </div><div>Future 7 Dates: 8-Nov-2013</div><div> </div><div>Future 7 Dates: 9-Nov-2013</div><div> </div><div>Future 7 Dates: 10-Nov-2013</div><div> </div><div>Future 7 Dates: 11-Nov-2013</div><div> </div><div>Future 7 Dates: 12-Nov-2013</div><div> </div><div>Date : Wed Nov 13 15:58:04 IST 2013</div><div> </div></div>
micajblock
<p>This is just code. Are you just trying to output this in a report? Are you trying to use these dates as a list for a parameter? If it is for a parameter do you want the parameter to be a date or a string?</p>
404040
<p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:13.63636302947998px;]Are you just trying to output this in a report?[/color]</p><p> </p><p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:13.63636302947998px;]yes[/color]</p><p> </p><p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;]Are you trying to use these dates as a list for a parameter?[/color]</p><p> </p><p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;]yes[/color]</p><p> </p><p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;]If it is for a parameter do you want the parameter to be a date or a string?[/color]</p><p> </p><p>[color=rgb(0,0,0);font-family:helvetica, arial, sans-serif;]As a Date [/color]</p><p> </p><p>where to initialize this in report?????? .....if u can use this code and provide solution for me........</p>
micajblock
<p>What version of BIRT are you using?</p>
bgbaird
<p>I don't know if it helps any, but check this thread:</p><p> </p><p><a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/forum/index.php?/topic/30523-how-do-i-get-result-set-to-include-data-for-an-enddate-parameter/'>http://www.birt-exchange.org/forum/index.php?/topic/30523-how-do-i-get-result-set-to-include-data-for-an-enddate-parameter/</a></p><p> </p><p>Brian</p>
;
404040
<p>my version is Eclipse Kepler Release 4.3</p>
micajblock
<p>I thought I posted the solution. Attached is an example that uses a scripted data source for the pick list. Hope this helps.</p>