Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing RAS problem

Status
Not open for further replies.

ajoce

Programmer
Aug 4, 2003
14
PH
I have a RAS in CE 10 and an already created rpt that connects to a database. I intend to create a java application (having a main method) that sends a parameter value to the rpt file, then immediately save it as a pdf file. i dont intent to view it on a browser. is this possible? i have been reading the tutorial, and all of samples use the web as a display/output for the report.

if its possible, can someone show me a simple code how to go about this? a thousand thanks.
 
Here is a sample page from the Java SDK examples set ( this from 8.5, you can search the Business objects site for the current Java SDK ), that shows how to export a PDF file...

Code:
<%@ page import = "com.crystaldecisions.report.web.viewer.*,
                com.crystaldecisions.sdk.occa.report.exportoptions.*,
                com.crystaldecisions.sdk.plugin.desktop.common.*"
%>
<%@ include file="logon.jsp" %>
<%
    ReportExportControl exporter = new ReportExportControl(); //ReportExportControl is used to initialize viewer
    ExportOptions exportOptions = new ExportOptions(); //use ExportOptions object to set Format
    ReportExportFormat exportFormat = ReportExportFormat.PDF; //set Format to PDF
    
    try{
        iStore = (IInfoStore) es.getService("", "InfoStore");
	oInfoObjects = (IInfoObjects) iStore.query("Select * from CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE = 0 And SI_NAME='Consolidated Balance Sheet'");
	oInfoObject = (IInfoObject) oInfoObjects.get(0);
	
        //use the ReportSource to initialize the viewer
        //pass in the InfoObject and the EnterpriseSession 
        exporter.setReportSourceClassFactoryName("com.crystaldecisions.sdk.occa.report.application.reportsourcefactory.PSReportSourceFactory");
        exporter.setEnterpriseLogon(es);
        exporter.setReportSource(oInfoObject);

        //Set the Export Format to PDF
        exportOptions.setExportFormatType(exportFormat);
        exporter.setExportOptions(exportOptions);

        //view the exported report in PDF format
        exporter.processHttpRequest(request, response, getServletConfig().getServletContext(), null);

    }
    catch(SDKException e)
    {
         out.println(e.getMessage());
    }
    
%>


Hope it helps point the way..


[profile]
 
it helps a lot. thanks =) i notice that the code is done in jsp. can this code run in a simple java class? let say it is coded in a java class, but the class is called by a stateless bean, is this possible?

thanks again =)
 
another question, if its ok. i am using websphere as my development environment. i created a bean, added a simple method :

public void test(){
ReportClientDocument rcd = new ReportClientDocument();
}

i dont have compile time error. i imported all necessary packages needed. thats com.crystaldecisions.sdk.occa.report.application.*, and .* and .lib.*;

when i test my bean, it gives me an error :

Non-application exception occurred while processing method "test" on bean "BeanId(RASEAR#RASEJB.jar#RAS, null)". Exception data: java.lang.NoClassDefFoundError: com/crystaldecisions/sdk/occa/report/application/ReportClientDocument

huh? how come. i dont have a compile time error. so i have the necessary classes needed. then when i run the bean, i encounter a NoClassDefFound error? anybody know how i can resolve this? thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top