SOLVED, sorry for message... added
Code: Select all
pageContext.setAttribute("report", report);
and solved the error.
------------------------------------------------------------------------------------------------------------------------------------------------------------
Sorry i deleted the demo and started the implement in the real case, but then give me an error, can you help me?
Error:
Code: Select all
com.stimulsoft.report.StiReport@56ad6cac
StiJDBCDatabase [connectionString=host=localhost;port=3306;database=prosind;user=root, promptUserNameAndPassword=false, url=jdbc:mysql://localhost:3306/prosind, user=root, password=, driver=com.mysql.jdbc.Driver, other={}]
mar 12, 2015 2:57:59 PM com.stimulsoft.webviewer.servlet.StiWebViewerActionServlet processing
GRAVE:
java.lang.NullPointerException
at com.stimulsoft.webviewer.helper.StiParametersClass.getVariables(StiParametersClass.java:489)
at com.stimulsoft.webviewer.StiWebViewer.interactionResult(StiWebViewer.java:792)
at com.stimulsoft.webviewer.StiWebViewer.interactionResult(StiWebViewer.java:766)
at com.stimulsoft.webviewer.servlet.StiWebViewerActionServlet.processing(StiWebViewerActionServlet.java:54)
at com.stimulsoft.webviewer.servlet.StiWebViewerActionServlet.doPost(StiWebViewerActionServlet.java:43)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
JSP PAGE:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@page import="com.stimulsoft.report.dictionary.databases.StiMySqlDatabase"%>
<%@page import="com.stimulsoft.web.servlet.StimulsoftServlet"%>
<%@page import="com.stimulsoft.webviewer.enums.StiShowMenuMode"%>
<%@page import="com.stimulsoft.webviewer.enums.StiPagesViewMode"%>
<%@page import="com.stimulsoft.webviewer.enums.StiPrintDestination"%>
<%@page import="com.stimulsoft.webviewer.StiWebViewerOptions"%>
<%@page import="java.io.File"%>
<%@page import="com.stimulsoft.report.StiSerializeManager"%>
<%@page import="com.stimulsoft.report.StiReport"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://stimulsoft.com/webviewer" prefix="stiwebviewer"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
<title>Stimulsoft Webviewer for Java</title>
<stiwebviewer:resources />
</head>
<body>
<%
try {
StiReport report = StiSerializeManager.deserializeReport(
new File(request.getSession().getServletContext().getRealPath("/reports/empresas.mrt"))
);
StiMySqlDatabase database = new StiMySqlDatabase("prosind", "prosind", "host=localhost;port=3306;database=prosind;user=root");
System.out.println(report);
System.out.println(database);
report.getDictionary().getDatabases().add(new StiMySqlDatabase("prosind", "prosind", "host=localhost;port=3306;database=prosind;user=root;password=;"));
report.Render();
pageContext.setAttribute("report", report);
} catch (NullPointerException e) {
System.out.println(e.getMessage());
}
%>
<h1>Welcome to JAVA WebViewer!</h1>
<stiwebviewer:webviewer report="${report}" />
</body>
</html>
Thanks in advance