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

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

commented: Thank you for sharing solution +16
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.