how to clear the cache ?

Hello all,,,

In my project iam using eclipse for crystsal report for generating reports.

as youall are familar a .jsp page is required to load the crystal report..

My problem is this....

when i run the report first time i can see my .jsp page and user can submit the parameter and based on the users parameter the report is generated..

but when the user runs the report, its not clearing the old generated report,,i mean i cannot see my .jsp page for the user to submit the

parameter...

i tried using session.invalidate and session.removeAttribute and it was showing me the .jsp page for the user to feed the parameter...

but the problem is when the user clicks on the print icon on the report

its not printing its just showing the parameter or .jsp page...

how can i solve this problem?

thanks in advance

regards

jack

[905 byte] By [jackfadda] at [2007-11-27 3:46:54]
# 1

Hello all,,,

In my project iam using eclipse for crystsal report for generating reports.

as youall are familar a .jsp page is required to load the crystal report..

My problem is this....

when i run the report first time i can see my .jsp page and user can submit the parameter and based on the users parameter the report is generated..

but when the user runs the report, its not clearing the old generated report,,i mean i cannot see my .jsp page for the user to submit the

parameter...

i tried using session.invalidate and session.removeAttribute and it was showing me the .jsp page for the user to feed the parameter...

but the problem is when the user clicks on the print icon on the report

its not printing its just showing the parameter or .jsp page...

how can i solve this problem?

the below is my code...

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@ page import="com.crystaldecisions.report.web.viewer.*" %>

<%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>

<%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>PO</title>

</head>

<body>

<%

Object reportSource = session.getAttribute("reportSource");

if (reportSource == null)

{

String report = "CrystalReport2.rpt";

ReportClientDocument reportClientDoc = new ReportClientDocument();

reportClientDoc.open(report, 0);

reportSource = reportClientDoc.getReportSource();

session.setAttribute("reportSource", reportSource);

}

ConnectionInfos connInfos = new ConnectionInfos();

IConnectionInfo connInfo1 = new ConnectionInfo();

connInfo1.setUserName("USER");

connInfo1.setPassword("USER");

connInfos.add(connInfo1);

CrystalReportViewer viewer = new CrystalReportViewer();

viewer.setReportSource(reportSource);

viewer.setEnableLogonPrompt(false);

viewer.setDatabaseLogonInfos(connInfos);

if (session.getAttribute("refreshed") == null)

{

viewer.refresh();

session.setAttribute("refreshed", "true");

}

viewer.setOwnPage(true);

viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);

//session.removeAttribute("refreshed");

//session.invalidate();

%>

</body>

</html

thanks in advance

regards

jack>

jackfadda at 2007-7-12 8:50:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...