1个回答
2013-11-08
展开全部
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*"%>
<%@ page import = "com.crystaldecisions.sdk.plugin.desktop.common.*"%>
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*"%>
<%@ page import = "com.crystaldecisions.sdk.framework.*"%>
<%@ page import = "com.crystaldecisions.sdk.occa.security.*"%>
<%
IInfoStore iStore=null;
IInfoObjects oInfoObjects=null;
IInfoObject oInfoObject=null;
IEnterpriseSession es = null;
String user = request.getParameter("username");
String password = request.getParameter("password");
String apsName = request.getParameter("apsname");
String apsAuthType = request.getParameter("authType");
// Logon and obtain an Enterprise Session
es = CrystalEnterprise.getSessionMgr().logon(user, password, apsName, apsAuthType);
%>
<%
//Grab the InfoStore from the httpsession
iStore = (IInfoStore) es.getService("", "InfoStore");
//Query for the report and make sure that the report is an instance "SI_INSTANCE=0"
oInfoObjects = (IInfoObjects) iStore.query("Select * from CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE=0 And SI_NAME='Consolidated Balance Sheet'" );
//retrieve the latest instance of the report
oInfoObject = (IInfoObject) oInfoObjects.get(0);
out.println(oInfoObject.properties().getProperty("SI_ID"));
//Pass the report and InfoObject to the session for the viewer page.
session.setAttribute( "infoObject", oInfoObject );
session.setAttribute( "enterpriseSession", es );
response.sendRedirect( "viewer.jsp" );
%>
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSourceClassFactoryName("com.crystaldecisions.sdk.occa.report.application.reportsourcefactory.PSReportSourceFactory");
viewer.setReportSource(oInfoObject); //the new instance of the report
viewer.setEnterpriseLogon(es); //pass the current enterprise session object
viewer.setOwnPage(true);
viewer.setName("View Report"); //Name of HTML page containing viewer
//View the report
<%@ page import = "com.crystaldecisions.sdk.plugin.desktop.common.*"%>
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*"%>
<%@ page import = "com.crystaldecisions.sdk.framework.*"%>
<%@ page import = "com.crystaldecisions.sdk.occa.security.*"%>
<%
IInfoStore iStore=null;
IInfoObjects oInfoObjects=null;
IInfoObject oInfoObject=null;
IEnterpriseSession es = null;
String user = request.getParameter("username");
String password = request.getParameter("password");
String apsName = request.getParameter("apsname");
String apsAuthType = request.getParameter("authType");
// Logon and obtain an Enterprise Session
es = CrystalEnterprise.getSessionMgr().logon(user, password, apsName, apsAuthType);
%>
<%
//Grab the InfoStore from the httpsession
iStore = (IInfoStore) es.getService("", "InfoStore");
//Query for the report and make sure that the report is an instance "SI_INSTANCE=0"
oInfoObjects = (IInfoObjects) iStore.query("Select * from CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE=0 And SI_NAME='Consolidated Balance Sheet'" );
//retrieve the latest instance of the report
oInfoObject = (IInfoObject) oInfoObjects.get(0);
out.println(oInfoObject.properties().getProperty("SI_ID"));
//Pass the report and InfoObject to the session for the viewer page.
session.setAttribute( "infoObject", oInfoObject );
session.setAttribute( "enterpriseSession", es );
response.sendRedirect( "viewer.jsp" );
%>
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSourceClassFactoryName("com.crystaldecisions.sdk.occa.report.application.reportsourcefactory.PSReportSourceFactory");
viewer.setReportSource(oInfoObject); //the new instance of the report
viewer.setEnterpriseLogon(es); //pass the current enterprise session object
viewer.setOwnPage(true);
viewer.setName("View Report"); //Name of HTML page containing viewer
//View the report
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询