I have this code :
<%
ReportAppSession reportAppSession = new ReportAppSession();
reportAppSession.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
reportAppSession.setReportAppServer("localhost");
reportAppSession.initialize();
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.setReportAppServer(reportAppSession.getReportAppServer());
reportClientDoc.open("C:/Reports/test.rpt",0);
ByteArrayInputStream byteIS = (ByteArrayInputStream)
reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
byte byteArray[] = new byte[byteIS.available()];
File file = new File("c:\\Reports\\Test.pdf");
FileOutputStream fos = new FileOutputStream(file);
ByteArrayOutputStream byteOS = new ByteArrayOutputStream(byteIS.available());
int x = byteIS.read(byteArray,0,byteIS.available());
byteOS.write(byteArray,0,x);
byteOS.writeTo(fos);
byteOS.close();
fos.close();
%>
this just exports a report to pdf format. What if my report has a database logon (username and password) and one parameter field (for record selection). how do i pass these values programatically to my report? please help..
<%
ReportAppSession reportAppSession = new ReportAppSession();
reportAppSession.createService("com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
reportAppSession.setReportAppServer("localhost");
reportAppSession.initialize();
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.setReportAppServer(reportAppSession.getReportAppServer());
reportClientDoc.open("C:/Reports/test.rpt",0);
ByteArrayInputStream byteIS = (ByteArrayInputStream)
reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
byte byteArray[] = new byte[byteIS.available()];
File file = new File("c:\\Reports\\Test.pdf");
FileOutputStream fos = new FileOutputStream(file);
ByteArrayOutputStream byteOS = new ByteArrayOutputStream(byteIS.available());
int x = byteIS.read(byteArray,0,byteIS.available());
byteOS.write(byteArray,0,x);
byteOS.writeTo(fos);
byteOS.close();
fos.close();
%>
this just exports a report to pdf format. What if my report has a database logon (username and password) and one parameter field (for record selection). how do i pass these values programatically to my report? please help..