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!

passing db and parameter info

Status
Not open for further replies.

ajoce

Programmer
Aug 4, 2003
14
PH
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..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top