on 06-24-2010 1:50 PM
Hi all,
Actually, I want to create an instance without priting or sending to any destination.
My code steps should be:
1. logon
2. get report object
3. set parameters information
4. create an instance / schedule report
once I create all instances for different reports, then I need to read all created instance objects (report with data populated) and sent to printer.
Is this possible? If possible, please suggest how to proceed further.
Thanks,
Krishna
you can schedule the reports to their default location ( what you see in history of a report template). It creates the report instance in output file repository.
Then you can open the report instance with RAS SDK and use PrintOutputController.printReport() method to print the instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thanks for your valuable response.
But I did tht but I could not find the object in the history. please give me some smaple code snippet, if u can.
Because as per my knowledge either we should send to some destination like (FTP,SMTP, Managed or unmanaged disk) or we should print the report.
correct me If i am wrong.
Thanks
here is a general code sample - you may need to modify it.
<%
IEnterpriseSession oEnterpriseSession = null;
IInfoStore oInfoStore = null;
String username = "administrator";
String password = "<password>";
String cmsname = "<cmsname>";
String authType = "secEnterprise";
String reportName = "<reportname>";
oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
oInfoStore = (IInfoStore)oEnterpriseSession.getService("","InfoStore");
String query = "select top 1 * from ci_infoobjects where si_name='" + reportName + "' and si_instance=0";
IInfoObjects reports = oInfoStore.query(query);
IReport report = (IReport) reports.get(0);
ISchedulingInfo schedInfo = report.getSchedulingInfo();
schedInfo.setRightNow(true);
schedInfo.setType(CeScheduleType.ONCE);
// schedule the report to default destination.
oInfoStore.schedule(reports);
// retrieve report instance. You may have do this multiple times if the report is still in process.
query = "select top 1 * from ci_infoobjects where si_name='" + reportName + "' and si_instance=1 order by si_creation_time desc";
IInfoObjects instances = oInfoStore.query(query);
IInfoObject instance = (IInfoObject) instance.get(0);
IReportAppFactory rptAppFactory = (IReportAppFactory)es.getService("", "RASReportService");
ReportClientDocument clientDoc = rptAppFactory.openDocument(instance, 0, Locale.ENGLISH);
//set PrintReportOptions object properties. Look in RAS SDK documentation for further info.
clientDoc.getPrintOutputController().printReport(PrintReportOptions object);
clientDoc.close();
oEnterpriseSession.logoff();
%>
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.