Skip to Content
0
Former Member
Jan 07, 2014 at 10:41 PM

Exporting the crystal report to a pdf without the browser(Stand alone java program)

164 Views


Hi,

We have a project where we want to run a crystal report which is present inside the business objects and export this to a pdf without any user action. In other terms without any browser getting involved. Our Business objects is BOXIR3 server.

I need to run the report and export it without

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

as I wouldn't have a request or a response object as this doesn't involve a browser.

Process which we follow to run the report currently.

1) We connect to our BO server using the

CrystalEnterprise.getSessionMgr().logon( ) method.

2) Use the cmsQuery option to search for the crystal report and retrieve the desired object using

IReportSourceFactory factoryPS = (IReportSourceFactory) enterpriseSession.getService("PSReportFactory");

Object reportSource = factoryPS.openReportSource((oInfoObject), Locale.ENGLISH);

3) After this I am able to retrieve the parameters that are needed and set the parameters which is needed dynamically using the

IReportParameter param = (IReportParameter) theReport.getReportParameters().get(i);

// from the parameters read out of the IReport object

ParameterField pf = param.getParameterField();

ParameterFieldDiscreteValue pfdv = new ParameterFieldDiscreteValue();

Question : How do I run this report now without the CrystalreportViewer and export the report. Because my project is not a web project and I want to have it as a stand alone java project.

Any answer\directions will be truly helpful.