<< Previous Topic | Next Topic >>Return to Index  

Code for displaying parametrized report using CR9 & RAS9

November 11 2002 at 1:23 AM
 

 
Hi Pooja,
I am a software developer working in java platform.
I need your help.Can you send me code through which we can display parametrized report using only Crystal Report 9.0 and RAS 9.0.
thanks,
regards,
Arvind

 
 Respond to this message   
AuthorReply

How export

November 11 2002, 3:39 AM 

Approximately so:

String par1 = request.getParameter( "par1" );
//
// Initialize server connect
//
ReportAppSession app = new ReportAppSession();
app.setReportAppServer( "admin" );
app.initialize();

ReportClientDocument clientDoc = (ReportClientDocument)app.createService( "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument" );
clientDoc.open( "MyReport.rpt", OpenReportOptions._openAsReadOnly );
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(clientDoc.getReportSource());

viewer.setDisplayPage( true );

String strContent = null;
strContent = viewer.getHtmlContent( request, response, pageContext.getServletContext());

//
// Read parameters
//
Fields fields = viewer.getParameterFields();
ParameterField fld = (ParameterField)fields.getField( 0 );
Values values = fld.getDefaultValues();
ParameterFieldDiscreteValue val = new ParameterFieldDiscreteValue();
val.setValue( par1 );
values.add( 0, val );
fld.setCurrentValues( values );

viewer.setParameterFields( fields );
viewer.processHttpRequest( request, response, pageContext.getServletContext(), pageContext.getOut() );

viewer.dispose();
clientDoc.close();

And all.

My question:
how export report ? Example in RAS SDK 9 not working ! There is a mistake: "OutputStream already retrieved"
What to do ?

Mr. Buba

 
 Respond to this message   

re: My Problem Solved!

November 13 2002, 9:15 AM 

Hello Pooja Mohan !

I'm use Oracle Container for Java (OC4J) as Application Server and I tried to use JavaViewer in JSP. he conclusion of the report in a browser passes normally, but by pressing button "Export" or "Print" happen invocation same JSP with some parameters. It to lead to to a mistake "OutStream already retrived". If to use servlet that will be all OK.

Instead of JSP I use servlets and all works for me.




 
 Respond to this message   
Current Topic - Code for displaying parametrized report using CR9 & RAS9
  << Previous Topic | Next Topic >>Return to Index  
Find more forums on Computers and InternetCreate your own forum at Network54
 Copyright © 1999-2010 Network54. All rights reserved.   Terms of Use   Privacy Statement  
Crystal Report Related Queries And Issues