gracias radge
Error
The value of this propery cannot be modified.
Código PHP:
<%@page language="java" contentType="text/html; charset=UTF-8"%>
<%@page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"%>
<%@page language="java" import="java.text.DateFormat,java.text.SimpleDateFormat,java.util.Date,java.sql.Timestamp" %>
<%@page import="com.crystaldecisions.sdk.occa.report.data.*"%>
<%@page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>
<%@page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
<%@page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%@page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSource" %>
<%@page import="com.crystaldecisions.reports.sdk.*" %>
<%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<jsp:useBean id="sessio" class="webapplication4.SessionBean1" />
<html>
<head>
<title>titulo</title>
</head>
<body bgcolor="#ffffff">
<div id="report">
<%
try
{
String weblogin="xxxxxx";
Number ano = 2007;
Number mes = 3;
String report = null;
report ="/Report/Informe1.rpt";
JPEReportSourceFactory rptSrcFactory = new JPEReportSourceFactory();
JPEReportSource reportSource = (JPEReportSource) rptSrcFactory.createReportSource(report, request.getLocale());
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
viewer.setHasRefreshButton(true);
Fields fields = new Fields();
ParameterField pfield1=new ParameterField();
ParameterField pfield2=new ParameterField();
ParameterField pfield3=new ParameterField();
pfield1.setName("weblogin");
pfield2.setName("mes");
pfield3.setName("ano");
pfield1.setReportName("");
pfield2.setReportName("");
pfield3.setReportName("");
Values vals1=new Values();
Values vals2=new Values();
Values vals3=new Values();
ParameterFieldDiscreteValue pfieldDV1=new ParameterFieldDiscreteValue();
ParameterFieldDiscreteValue pfieldDV2=new ParameterFieldDiscreteValue();
ParameterFieldDiscreteValue pfieldDV3=new ParameterFieldDiscreteValue();
pfieldDV1.setValue(weblogin);
pfieldDV2.setValue(mes);
pfieldDV3.setValue(ano);
vals1.add(pfieldDV1);
vals2.add(pfieldDV2);
vals3.add(pfieldDV3);
pfield1.setCurrentValues(vals1);
pfield2.setCurrentValues(vals2);
pfield3.setCurrentValues(vals3);
fields.add(pfield1);
fields.add(pfield2);
fields.add(pfield3);
viewer.setParameterFields(fields);
ConnectionInfos newConnInfos = new ConnectionInfos();
IConnectionInfo newConnInfo = new ConnectionInfo();
newConnInfo.setUserName("login");
newConnInfo.setPassword("pazzword");
newConnInfos.add(newConnInfo);
viewer.setDatabaseLogonInfos(newConnInfos);
viewer.setEnableLogonPrompt(false);
viewer.setHasPrintButton(true);
viewer.setOwnPage(true);
viewer.setOwnForm(true);
viewer.refresh();
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),null);
viewer.dispose();
}catch(Exception e)
{
out.println("Error " +e);
}
%>
</div>