Once a properly initialized ConnectionInfos object has been created, the database logon information can be passed to the viewer. The viewer handles the process of passing this information to the report.
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
You can disable database prompting to automatically use the set database logon value. This is particularly useful if the database logon being set is unknown to the user.
viewer.setEnableLogonPrompt(false);
viewer.setDatabaseLogonInfos(connInfos);
viewer.refresh();
Note: Setting setOwnPage to false disables exporting and printing.
viewer.setOwnPage(true);
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
Business Objects http://www.businessobjects.com/ Support services http://www.businessobjects.com/services/support/ |