[jQuery] JSP Calling Crystal Report Having Stored Procedure

2009-06-23 Thread RUQUIA TABASSUM
Hi i am calling a crystal report from jsp where the crystal report is
designed using stored procedure but the report does not get displayed and
shows errors
my jsp file is

Code:
%@ page import=com.crystaldecisions.report.web.viewer.* %

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

%@ page import=com.crystaldecisions.reports.sdk.ReportClientDocument %

%@ page import = java.util.* %

%
try{

Object reportSource = session.getAttribute(reportSource);

if (reportSource == null)

{

String report = Report4.rpt;

ReportClientDocument reportClientDoc = new ReportClientDocument();

reportClientDoc.open(report, 0);

reportSource = reportClientDoc.getReportSource();

session.setAttribute(reportSource, reportSource);

}


CrystalReportViewer viewer = new CrystalReportViewer();

viewer.setReportSource(reportSource);

viewer.setEnableParameterPrompt(false);



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

{

viewer.refresh();

session.setAttribute(refreshed, true);

}


viewer.setOwnPage(true);

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

}
catch(Exception e)
{
e.printStackTrace();
}
%

error:
com.crystaldecisions.report.web.viewer.CrystalReportViewer
Unexpected Query Engine error


the Report4.jsp connects to the database using oracle Native connection. the
Report runs perfectly well when i open it directly from crystal report
viewer.
Any help appreciated.


[jQuery] Re: Jquery Calling Servlet

2009-01-11 Thread RUQUIA TABASSUM
How do i direct my servlet to a new window using JQuery  i am not able
to understand as i am new to JQuery, can you please suggest me how do i do
this i tried doing

window.opener.location.href=
$.post(../reports/BillIDPropIDExcelExport,{csvstring:
$(#vname1).val(),count:$(#vname2).val(),propType:$(#vname3).val(),instValue:$(#vname4).val()},function(data){
alert(data);document.body.style.cursor=default; });



this gives me errors window.opener.location is null or not an object

Can you please suggest me how do i direct my servlet out put to new window
using AJAX.









On Sat, Jan 10, 2009 at 1:19 PM, jQuery Lover ilovejqu...@gmail.com wrote:


 Create a new window and direct it to your servlet url then onload.close();

 Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



 On Thu, Jan 8, 2009 at 7:08 PM, ruquia ruquiatabas...@gmail.com wrote:
 
  Hi i am calling a servlet using JQuery and my servlets create an excel
  file at runtime and provides the option for the user to open save or
  cancel the file created
 
  JQuery code is
 
  $.post(../reports/BillIDPropIDExcelExport,{csvstring: $
  (#vname1).val(),count:$(#vname2).val(),propType:$(#vname3).val
  (),instValue:$(#vname4).val()},function(data){
 alert(data);document.body.style.cursor=default; });
 
 
 
  and my servlets that creates the file at runtime is
 
   try
 {
 HSSFWorkbook wb  = new HSSFWorkbook();
 HSSFSheet sheet = wb.createSheet(Customer Details
 Connection
  Fee);
 
  HSSFDataFormat format = wb.createDataFormat();
  HSSFCellStyle cstyle;
 
  cstyle =  wb.createCellStyle();
 
 cstyle.setDataFormat(format.getFormat(#,###,###.00));
 
 
 
 
 HSSFRow row = sheet.createRow((short)0);
 HSSFCell c0=row.createCell((short)0);
 HSSFCell c1=row.createCell((short)1);
 HSSFCell c2=row.createCell((short)2);
 
 
 
 
 
 c0.setCellValue(CHAR_PREM_ID);
 c1.setCellValue(SA_TYPE_CD);
 c2.setCellValue(UOM_CD);
 
 
 
   c0.setCellStyle(style);
   c1.setCellStyle(style);
   c2.setCellStyle(style);
 
 
 
 
 String
 acplotnumber=,finalcsvstring=,finalacplotnumber1=;
 
 String csvstring=request.getParameter(csvstring);
 System.out.println(csvstring);
 String count=request.getParameter(count);
 System.out.println(count);
 String instValue1=request.getParameter(instValue);
 String propType1=request.getParameter(propType);
 
 
 if(propType1.length()==4)
 propType='CONBASE','CONGROW';
 else
 propType='+propType1+';
 
 d= new OracleDatabaseConnectionPROD();
 connection=d.connect();
 //System.out.println(OracleDatabaseConnectionPROD);
 
 
 
  stmt = connection.createStatement();
  connection.setAutoCommit(false);
 
 {
 
 rs=stmt.executeQuery(SELECT A.CHAR_PREM_ID, SA_TYPE_CD,
 F.UOM_CD,
  C.BILL_ID, SUM(CALC_AMT) as CALC_AMOUNT from Customers);
 
 
 
 while(rs.next())
 {
 
 String CHAR_PREM_ID=rs.getString(1);
 String SA_TYPE_CD=rs.getString(2);
 String UOM_CD=rs.getString(3);
 String BILL_ID=rs.getString(4);
 float CALC_AMOUNT=rs.getFloat(5);
 
 
 
 HSSFCellStyle style1 = wb.createCellStyle();
 HSSFFont font1 = wb.createFont();
 font1.setFontHeightInPoints((short)8);
 style1.setFont(font1);
 
 
 row = sheet.createRow((short)j);
 
 // bold
 
 
 HSSFCell cell0 =row.createCell((short)0);
 HSSFCell cell1 =row.createCell((short)1);
 HSSFCell cell2 =row.createCell((short)2);
 
 cell0.setCellValue(CHAR_PREM_ID);
 cell1.setCellValue(SA_TYPE_CD);
 cell2.setCellValue(UOM_CD);
 
 
 
 cell0.setCellStyle(style1);
 cell1.setCellStyle(style1);
 
 
 
 j++;
 
 }
 //FileOutputStream fileOut = new
 FileOutputStream(fname
  +ExtractBillID+dateFormat+.xls);
 //wb.write(fileOut);
 //fileOut.close();
 String filename=ExtractBillID+dateFormat+.xls;

[jQuery] Re: Jquery Calling Servlet

2009-01-11 Thread RUQUIA TABASSUM
Here i need to use AJAX because  the servlet called is appended with input
parameters that contains 1 to 5 charectars and when i directly call
the servlet  instead of making ajax call the url is not completely formed
and the servlet is not invoked.

direct call:-

window.opener.location.href=../reports/BillIDPropIDExcelExport?csvstring=+csvstring+count=+count+proptypeValue=+proptypeValue+dbenvi=+dbenvi;

here csvstring contains 5 charectars and because of this the servlet is
not being invoked and the url is not properly formed.


thats the reason i need to use AJAX , now after using ajax i am struck here
at this point where i cant show the output of servlet to the user, that is
the open save and cancel dialogue box.
please help me in this issue.