Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: The report you requested requires further informat Post Reply Post New Topic
Author Message
malli
Newbie
Newbie


Joined: 13 Apr 2009
Location: India
Online Status: Offline
Posts: 3
Quote malli Replybullet Topic: The report you requested requires further informat
     Posted: 18 May 2009 at 12:04am
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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 May 2009 at 7:08am

I would try tracking down the parameter and making sure that it is set.  I don't program in java, so I can't really tell you what has gone wrong.

try querying the parameter  before running the report to make sure that it is set.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum