Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Есть фиксированный перечень отчетов Crystal Reports. из ASP ... заказывается отчет: 1. По данным клиента создается xml с параметрами 2. Создается COM-объект, ему на вход данные об отчете (код, параметры-xml), он их парсит, запускает создание отчета в Crystal Reports, результат конвертируется в HTML и возвращает его 3. HTML отдается клиенту Как делали вы? Жизнеспособен ли данный метод, какие +/-? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2006, 18:39 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
хоспади ! нет, конечно, можно и так, но, например у нас отчет кристала вызывается примерно так: http://bo1:8080/businessobjects/billing/billing_details.jsp?id=10808&show=no&rpar0=2005&rpar1=11&rpar2=906mail:from=peter&mail:to=Peter_Kirillow хочешь покажет результат, хочешь сконвертит в pdf, хочешь по мылу отошлет... кристал+Tomcat+jsp версия то какая ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2006, 19:39 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Peter Kirillow 1. http://bo1:8080/businessobjects/billing/billing_details.jsp?id=10808&show=no&rpar0=2005&rpar1=11&rpar2=906mail:from=peter&mail:to=Peter_Kirillow 2. хочешь покажет результат, хочешь сконвертит в pdf, хочешь по мылу отошлет... 3. кристал+Tomcat+jsp 1. а строку генерит кто? 2. по мылу - идея, хоть и не новая (запишем ) 3. Верно я понял Ваш вариант? по htlm (страничка заказа отчетов) jsp создает COM-объект, запускает отчет, передав фиксированные параметры и отправляет и/или показывает результат. один jsp - один отчет в Crystal Reports? ps: я хотел уточнить об опыте создания прослойки вызова отчета по названию с передачей неких параметров (XML данные, удовлетноряющие соответствующей отчету схеме) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 12:03 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Crystal Reports сохраняет отчеты (не результаты) в виде xml? Тогда можно былобы из него попробовать получить схему, описывающую требования к параметрам. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 13:41 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
я так понял у вас неофициальный Кристал и версии ниже 10... отчеты генерит сервер Business Objects в jsp я передаю ID отчета (для версии кристал 11) или имя отчета, если версия ниже, а потом просто использую API для вызова отчета и перадачи в него параметров из строки URL. никаких COM объектов не нужно, если используется java. вам надо читать про API для версии, которую вы используете. вот пример: <%@ page contentType="text/html; charset=windows-1251" pageEncoding="windows-1251" %> <%@ page import = "java.util.*,java.lang.Integer,java.io.*, com.crystaldecisions.sdk.framework.*, com.crystaldecisions.sdk.plugin.desktop.report.*, com.crystaldecisions.sdk.plugin.destination.smtp.*, com.crystaldecisions.sdk.plugin.desktop.common.*, com.crystaldecisions.sdk.exception.*, com.crystaldecisions.sdk.occa.security.*, com.crystaldecisions.sdk.properties.*, com.crystaldecisions.sdk.occa.infostore.*" %> <% try { request.setCharacterEncoding("Cp1251"); //Log in. IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon( "billing", "bee_billing", "bo1", "secEnterprise"); //Obtain the InfoStore. IInfoStore infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore"); //Query for the report object in the CMS. See the Developer Reference guide for more information the query language. IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query("SELECT TOP 1 * FROM CI_INFOOBJECTS " + "WHERE SI_PROGID = 'CrystalEnterprise.Report' AND SI_INSTANCE=0 AND " + "SI_ID=" + request.getParameter ("id")); IReport oReport = (IReport)oInfoObjects.get(0); if (oInfoObjects.size() > 0) { scheduleReports(oInfoObjects, infoStore, request); out.println("<result>"); out.println("<text>отчет сформирован и отправлен по адресу - " + request.getParameter("mail:to") + "</text>"); out.println("</result>"); } else { out.println("<result>"); out.println("<text>нет данных для создания репорта за указанный период</text>"); out.println("</result>"); } enterpriseSession.logoff(); } catch(SDKException sdkEx) { out.println("<error>"); out.println("<ErrorCode>1</ErrorCode>"); out.println("<ErrorText><![CDATA[" + sdkEx.getMessage() + "]]></ErrorText>"); out.println("</error>"); } %> <%! private void scheduleReports(IInfoObjects oInfoObjects, IInfoStore infoStore, HttpServletRequest request) throws SDKException, IOException { //Grab the first object in the collection, this will be the object that will be scheduled. IReport oReport = (IReport)oInfoObjects.get(0); IReportFormatOptions reportFormat = oReport.getReportFormatOptions(); //Set report format. reportFormat.setFormat(IReportFormatOptions.CeReportFormat.PDF); IDestinationPlugin destinationPlugin = getDestinationPlugin(infoStore, IReportFormatOptions.CeReportFormat.PDF, oReport.getTitle(), request); //Set parameters for this report. setReportParameters(oReport, request); //Retrieve the ISchedulingInfo Interface for the Report object and set the schedule time (right now) and type (run once) ISchedulingInfo schedInfo = oReport.getSchedulingInfo(); schedInfo.setRightNow(true); schedInfo.setType(CeScheduleType.ONCE); //Retrieve the IDestination interface from the SchedulingInfo object use the setFromPlugin() //to apply the changes we made to the IDestinationPlugin object returned from the IStore IDestination destination = schedInfo.getDestination(); if (null != request.getParameter("mail:to")) destination.setFromPlugin(destinationPlugin); destination.setCleanup(true); //Schedule the InfoObjects. infoStore.schedule(oInfoObjects); } %> <%! private void setReportParameters(IReport oReport, HttpServletRequest request) throws SDKException, IOException { // Retrieve the list of parameters on the report List paramList = oReport.getReportParameters(); // Create an IReportParameter interface IReportParameter oReportParameter; IReportParameterSingleValue currentValue = null; //For each parameter in the report, set a parameter value appropriate for the parameter type prior to scheduling. for (int i=0; i < paramList.size(); i++) { oReportParameter = (IReportParameter)paramList.get(i); oReportParameter.getCurrentValues().clear(); String sRepParm = request.getParameter ("rpar" + i); currentValue = oReportParameter.getCurrentValues().addSingleValue(); if (null == sRepParm) sRepParm = "false"; currentValue.setValue(sRepParm); } } %> <%! /* * Utility function for obtain the appropriate destination plugin and set options for that plugin. */ private IDestinationPlugin getDestinationPlugin(IInfoStore infoStore, int reportType, String sFileName, HttpServletRequest request) throws SDKException { String mimeType = getMimeType(reportType); String sParms = ""; //Retrieve the SMTP Destination plugin from the InfoStore //this should be cast as an IDestinationPlugin *DON'T FORGET THE get(0) AT THE END** IDestinationPlugin destPlugin = (IDestinationPlugin)infoStore.query("SELECT TOP 1 * " + "FROM CI_SYSTEMOBJECTS " + "WHERE SI_NAME='CrystalEnterprise.Smtp'").get(0); //Retrieve the Scheduling Options and cast it as ISMTPOptions //This interface is the one which allows us to set all of the required SMTP properties ISMTPOptions smtpOptions = (ISMTPOptions) destPlugin.getScheduleOptions(); smtpOptions.setDomainName("troika.ru"); smtpOptions.setServerName("magician"); smtpOptions.setPort(25); smtpOptions.setSMTPUserName(""); smtpOptions.setSMTPPassword(""); smtpOptions.setSMTPAuthenticationType(ISMTPOptions.CeSMTPAuthentication.NONE); sParms = request.getParameter("mail:from"); if (sParms == null) sParms = "billing_master@troika.ru"; smtpOptions.setSenderAddress(sParms.replace(' ','_')); smtpOptions.setSubject(request.getParameter("mail:subject")); smtpOptions.setMessage(request.getParameter("mail:body")); //Retrieve the list of SMTP recipients. sParms = request.getParameter("mail:to"); if (sParms != null) smtpOptions.getToAddresses().add(sParms.replace(' ','_')); sParms = request.getParameter("mail:cc"); if (sParms != null) smtpOptions.getCCAddresses().add(sParms.replace(' ','_')); //Retrieve the IAttachments Interface then use the add() method to add the mimetype and the embedName of the attachment. IAttachments attachments = smtpOptions.getAttachments(); attachments.add(mimeType, "BeeLine_details_" + request.getParameter ("rpar1") + request.getParameter ("rpar0") + ".pdf"); return destPlugin; } %> <%! /* * Utility function that returns the file extension for an export format type. */ private String getMimeType(int reportType) { String mimeType = ""; switch (reportType) { case IReportFormatOptions.CeReportFormat.CRYSTAL_REPORT: mimeType = "application/report"; break; case IReportFormatOptions.CeReportFormat.EXCEL: mimeType = "application/vnd.ms-excel"; break; case IReportFormatOptions.CeReportFormat.EXCEL_DATA_ONLY: mimeType = "application/vnd.ms-excel"; break; case IReportFormatOptions.CeReportFormat.PDF: mimeType = "application/pdf"; break; case IReportFormatOptions.CeReportFormat.RTF: mimeType = "application/msword"; break; case IReportFormatOptions.CeReportFormat.RTF_EDITABLE: mimeType = "application/msword"; break; case IReportFormatOptions.CeReportFormat.TEXT_CHARACTER_SEPARATED: mimeType = "application/vnd.ms-excel"; break; case IReportFormatOptions.CeReportFormat.TEXT_PAGINATED: mimeType = "text/plain"; break; case IReportFormatOptions.CeReportFormat.TEXT_PLAIN: mimeType = "text/plain"; break; case IReportFormatOptions.CeReportFormat.TEXT_TAB_SEPARATED: mimeType = "text/plain"; break; case IReportFormatOptions.CeReportFormat.TEXT_TAB_SEPARATED_TEXT: mimeType = "text/plain"; break; case IReportFormatOptions.CeReportFormat.USER_DEFINED: mimeType = ""; break; case IReportFormatOptions.CeReportFormat.WORD: mimeType = "application/msword"; break; default: mimeType = "application/report"; break; } return mimeType; } %> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2006, 15:00 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Peter Kirillow<%! private void setReportParameters(IReport oReport, HttpServletRequest request) throws SDKException, IOException { // Retrieve the list of parameters on the report List paramList = oReport.getReportParameters(); // Create an IReportParameter interface IReportParameter oReportParameter; IReportParameterSingleValue currentValue = null; //For each parameter in the report, set a parameter value appropriate for the parameter type prior to scheduling. for (int i=0; i < paramList.size(); i++) { oReportParameter = (IReportParameter)paramList.get(i); oReportParameter.getCurrentValues().clear(); String sRepParm = request.getParameter ("rpar" + i); currentValue = oReportParameter.getCurrentValues().addSingleValue(); if (null == sRepParm) sRepParm = "false"; currentValue.setValue(sRepParm); } } %> такая функция setReportParameters() насколько я понимаю специфична для окружения Reports Serverа, а если только Java Reporting Component использовать, то такой интерфейс задания параметров отчету уже не подходит? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.08.2006, 14:17 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Peter Kirillow 1. я так понял у вас неофициальный Кристал и версии ниже 10... 2. отчеты генерит сервер Business Objects 3. никаких COM объектов не нужно, если используется java. IReport oReport = (IReport)oInfoObjects.get(0); 1. trial 9 2. я через ActiveX родной компонент - вьювер 3. ошибаетесь ... по коду видно, что скриптом COM-объект используется Дело в том, что вы получаете заранее зная что за отчет, а я хотял в отчете идентификацию в описание как xml записать и парсить перед запуском ... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.08.2006, 13:05 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
KGPCrystal Reports сохраняет отчеты (не результаты) в виде xml? Тогда можно былобы из него попробовать получить схему, описывающую требования к параметрам. Crystal Reports сохраняет только результаты. Для создания шаблонов на XML используем iReport. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.07.2007, 10:11 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Кстати, никто не пробовал делать XML-отчеты в Кристал Репортс ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2007, 07:44 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
раньше формировали отчеты с помошью iReport. сам проект сохранялся в виде xml файла. сейчас встал вопрос перехода с iReport на Cristal Report 10 с тем же условием, что проекты будут сохранятся в формате xml. только вот столкнулись с проблемой, не можем найти как сохранить проект в кристале в формате xml или такой возможности попросту нет, и нам надо искать другие пути? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2007, 13:38 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Может сохранять в HTML, или в своем собственном (бинарном) формате. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2007, 13:57 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
я попробую, только от нас требуют xml судя по всему отчеты кристала можно использовать, как отдельные программки, и запускать простым нажатием мышки. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2007, 14:16 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
2 Wireless: Что Вы имеете ввиду под "сохранять в HTML" ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2007, 14:48 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Guesty2 Wireless: Что Вы имеете ввиду под "сохранять в HTML" ? Имелось ввиду выходные данные отчета возможно сохранять в HTML. Мне не известно, чтобы само представления отчета (относительно вопроса panty_dj) могло бы быть сохранено в XML. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.08.2007, 18:45 |
|
||
|
Crystal Reports
|
|||
|---|---|---|---|
|
#18+
Wireless спасибо может быть есть ссылки на электронную литературу по Crystal? Если есть заделитесь п-та ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.08.2007, 07:46 |
|
||
|
|

start [/forum/topic.php?fid=31&msg=34729623&tid=1537790]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
38ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
55ms |
get tp. blocked users: |
2ms |
| others: | 14ms |
| total: | 156ms |

| 0 / 0 |
