1

I am trying to pass multiple values to a crystal report using java and jsp pages. I can get it working using single values but I need to pass multiple values that are comma delimited or something along that line. I pass a toDate a fromDate and userName. I need multiple userNames to be able to filter though by all the user names(works with jsut one user right now). I guess im not sure how the default crystal reports prompt saves multiple variables because i cannot mimic it.

example: (user1, user2, user3) instead of just (user1).

Thanks for your time.

From the search.jsp page i get values and send them to eReport.jsp to generate the report

String fromDate = request.getParameter( "fromDate" );
session.setAttribute( "fromDate", fromDate );
String toDate = request.getParameter( "toDate" );
session.setAttribute( "toDate", toDate );
String userName = request.getParameter( "user" );

From search.jsp it sends the values to the eReport.rpt
which just prepares the variables for generation.

//gets session variables
String startDate = (String)session.getAttribute("fromDate");										 				
String endDate = (String)session.getAttribute("toDate");
String userName = (String)session.getAttribute("userName");			

missing code....


	// fromDate
	    ParameterField parFromDate = new ParameterField();  
	    parFromDate.setReportName("");
	    parFromDate.setName("fromDate");
		Values valsFromDate = new Values();
		ParameterFieldDiscreteValue valFromDate = new ParameterFieldDiscreteValue();  
		valFromDate.setValue(fromDate);
		//valFromDate.setValue("2011-1-1");
		valsFromDate.add(valFromDate);
		parFromDate.setCurrentValues(valsFromDate);
	    fields.add(parFromDate);
	    //out.println("parFromDate: " + parFromDate.toString()); 


etc for all variables...

Picture to show what i am trying to accomplish

Edited by brynFlew: Needs changing

1
Contributor
1
Reply
3
Views
6 Years
Discussion Span
Last Post by brynFlew
1

Well, i figured all i had to do was pass a wildcard or a * into the report and it would select all the records.

Votes + Comments
Thank you for sharing solution
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.