Hi ,

I am using crystal reports x1 , java 6 and jboss5. I had developed one rpt design file, that file will take one parameter. While running that rpt file from servlet I am getting "The report you requested requires further information" statement and one text field. Once I click on that button after entering that value, it is showing required out put.

My code is placing bellow




ReportClientDocument reportClientDocument = new ReportClientDocument();
CrystalReportViewer viewer = new CrystalReportViewer();
ReportExportControl exportControl = null;

ServletContext cxt = req.getSession().getServletContext();
String fileName = "C:/Documents and Settings/Administrator/Desktop/lib-so/ix_sample2.rpt";
String repoName = "users_report1.pdf";

try
{
String realPath = fileName;
reportClientDocument.open(realPath, 0);
viewer.refresh();
viewer.setReportSource(reportClientDocument.getReportSource());
}
catch(Exception e)
{
System.out.println("inside catch block...");
e.printStackTrace();
}

DatabaseController databaseController=null;
try
{
databaseController = reportClientDocument.getDatabaseController();
}
catch (ReportSDKException e)
{
e.printStackTrace();
}

//database connection

ITable table = databaseController.getDatabase().getTables().getTable(0);
ITable oldtable = table;

table.setQualifiedName("sp2m.dbo." + table.getName());
IConnectionInfo connectionInfo = table.getConnectionInfo();

PropertyBag propertyBag = new PropertyBag();


propertyBag.put("Trusted_Connection", "false");
propertyBag.put("Server Name", "testsvr2"); //Optional property.
String CONNECTION_STRING="Use JDBC=b(true);Connection URL=s(jdbc:microsoft:sqlserver://testsvr2:1433); /Database Class Name=s(com.microsoft.jdbc.sqlserver.SQLServerDriver);Server=s(testsvr2); /User ID=s(sa);Password=cispl;Database=s(sp2m);Trusted_Connection=b(false); /JDBC Connection String=s(!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://testsvr2:1433; / DatabaseName={database};user={userid};password={password}!)";
propertyBag.put("Connection String", CONNECTION_STRING);
propertyBag.put("Database Name", "sp2m");
propertyBag.put("Server Type", "JDBC (JNDI)");
String URI="!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://testsvr2:1433;DatabaseName={database};user={userid};password={password}!";
propertyBag.put("URI", URI);
propertyBag.put("Use JDBC", "true");
propertyBag.put("Database DLL", "crdb_jdbc.dll");

System.out.println("is this setlocation");
connectionInfo.setAttributes(propertyBag);

connectionInfo.setUserName("sa");
connectionInfo.setPassword("cispl");
connectionInfo.setKind(ConnectionInfoKind.SQL);

table.setConnectionInfo(connectionInfo);
try {
databaseController.setTableLocationEx(oldtable,table);
} catch (ReportSDKException e) {
e.printStackTrace();
}

//database details over



IReportSource reportSource = reportClientDocument.getReportSource();
Fields oFields = new Fields();
ParameterField portfolio = new ParameterField();
portfolio.setName("Portfolio");


Values oValues = new Values();
ParameterFieldDiscreteValue oParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();


oParameterFieldDiscreteValue.setValue(new Integer(16));
oValues.add(oParameterFieldDiscreteValue);
portfolio.setCurrentValues(oValues);
portfolio.setReportName(fileName);
oFields.add(portfolio);



ConnectionInfos connectionInfos =new ConnectionInfos();
connectionInfos.add(connectionInfo);
viewer.setDatabaseLogonInfos(connectionInfos);
viewer.setName("malli");
viewer.setOwnPage(false);
viewer.setEnableParameterPrompt(true);
viewer.setParameterFields(oFields);

viewer.setHasExportButton(true);

try {
viewer.processHttpRequest(req, res, cxt, res.getWriter());
viewer.dispose();
}
catch (ReportSDKExceptionBase e) {
e.printStackTrace();
}



please help me in this.

regards,
Mallikarjuna