2008-10-28 10 views
10

क्या किसी ने कभी डेस्कटॉप एप्लिकेशन में बीआईआरटी रिपोर्ट का उपयोग किया था। मैं .NET पर्यावरण से आ रहा हूं और वहां आप डेस्कटॉप ऐप्स में रिपोर्ट दिखाने के लिए क्रिस्टल रिपोर्ट का उपयोग कर सकते हैं। क्या यह सर्वर वातावरण स्थापित किए बिना भी बीआईआरटी के साथ संभव है?बीआईआरटी

क्या आप मुझे कुछ सलाह दे सकते हैं कि इस लक्ष्य तक कैसे पहुंचे?

अग्रिम धन्यवाद।

उत्तर

2

हां, यह संभव है। मैंने इसे लगभग एक साल पहले किए गए एक प्रोजेक्ट में इस्तेमाल किया था, इसलिए मुझे विवरण के साथ आपको वापस जाना होगा। (बातें तब से परिवर्तित हो सकता है हालांकि)

हैं प्लगइन हैं मैं की जरूरत:

<?xml version="1.0" encoding="UTF-8"?> 
<classpath> 
    <classpathentry kind="src" path="src"/> 
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
    <classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/> 
    <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/> 
    <classpathentry kind="lib" path="lib/swt.jar"/> 
    <classpathentry kind="con" path="SWT_CONTAINER"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.device.extension_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.device.swt_2.1.1.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.engine_2.1.2.v20070205-1728.jar" sourcepath="C:/Programme/eclipse/plugins/org.eclipse.birt.chart.source_2.2.0.v20070209/src"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.engine.extension_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.runtime_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.core_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.emf.common_2.2.1.v200609210005.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.emf.ecore_2.2.1.v200609210005.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.emf.ecore.xmi_2.2.1.v200609210005.jar"/> 
    <classpathentry kind="lib" path="js.jar"/> 
    <classpathentry kind="lib" path="com.ibm.icu_3.4.5.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.ui_2.1.1.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="org.eclipse.birt.chart.ui.extension_2.1.2.v20070205-1728.jar"/> 
    <classpathentry kind="lib" path="lib/hsqldb.jar"/> 
    <classpathentry kind="output" path="bin"/> 
</classpath> 
1

हाँ, यह संभव है। Here कुछ सामान्य विवरण है। मैंने सर्वर पर्यावरण में बिर्ट का उपयोग किया है, जहां तक ​​मुझे पता है कि एक रेंडरकॉन्टेक्स्ट इंटरफेस है जिसके माध्यम से आप अपनी रिपोर्ट को अपनी इच्छानुसार प्रस्तुत करते हैं।

4

एक बीआईआरटी रन-टाइम है जो आपको कमांड लाइन से रिपोर्ट जेनरेट करने की अनुमति देता है। this article पढ़ें। इससे आपको सर्वर के बिना बीआईआरटी का उपयोग करने की अनुमति मिल जाएगी। मूल रूप से here as an answer to my own question नोट किया गया।

5

यदि आपका डेस्कटॉप एप्लिकेशन एक्लिप्स रिच क्लाइंट प्लेटफ़ॉर्म (आरसीपी) का उपयोग करके लिखा गया है तो रिपोर्टिंग जोड़ने में यह छोटा है। आपको बस org.eclipse.birt.viewer प्लगइन जोड़ने और फिर इसका उपयोग करने की आवश्यकता है।

यहाँ एक लेख है कि बताते है यह: http://digiassn.blogspot.com/2008/08/birt-launch-birt-rcp-application.html

0

यह संभव है और आप आसानी से एक JeditorPane में रिपोर्ट की एक पूर्वावलोकन बना सकते हैं, तो आप BIRT रनटाइम डाउनलोड करने के लिए है और फिर आप उदाहरण कोड के साथ की कोशिश कर सकते ग्रहण मंच पर this पोस्ट में पोस्ट किया गया।

0
package com.passport; 

import java.io.FileOutputStream; 
import java.util.Collection; 
import java.util.Iterator; 


import org.eclipse.birt.core.framework.Platform; 
import org.eclipse.birt.report.engine.api.EngineConfig; 
import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask; 
import org.eclipse.birt.report.engine.api.IParameterDefnBase; 
import org.eclipse.birt.report.engine.api.IRenderOption; 
import org.eclipse.birt.report.engine.api.IReportEngine; 
import org.eclipse.birt.report.engine.api.IReportEngineFactory; 
import org.eclipse.birt.report.engine.api.IReportRunnable; 
import org.eclipse.birt.report.engine.api.IRunAndRenderTask; 
import org.eclipse.birt.report.engine.api.RenderOption; 

public class EngineReport { 
    private static final long serialVersionUID = 1L;  
    private IReportEngine engine=null; 
    private EngineConfig engineconfig = null; 
    private IReportEngineFactory factory = null; 
    private String sourceReport; 
    private String locationReport; 
    private String reportRealPath = ""; 

public static void main(String[] args){ 
    EngineReport engineReport = new EngineReport(); 
    engineReport.save("src/com/passport/report.rptdesign","c:/tmp/rep.doc"); 
} 

private void save(String sourceReport, String locationReport) { 

    this.sourceReport = sourceReport; 
    this.locationReport = locationReport; 
    IReportRunnable design = null; 
    IRenderOption options = null; 
    try { 
     String reportFormat = locationReport.substring(locationReport.lastIndexOf('.')+1); 
     sourceReport = "src/com/passport/report.rptdesign"; 
     if ((sourceReport != null && (sourceReport.length() > 0))) { 

      engineconfig = new EngineConfig(); 
      reportRealPath = ""; 
      Platform.startup(engineconfig); 
      factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);    
      engine = factory.createReportEngine(engineconfig); 
      design = engine.openReportDesign(reportRealPath+sourceReport);   
      IRunAndRenderTask task = engine.createRunAndRenderTask(design);  

      IGetParameterDefinitionTask taskParam = engine.createGetParameterDefinitionTask(design); 
      Collection<?> params = taskParam.getParameterDefns(false); 
      String paramName = null; 
      Iterator<?> iterOuter = params.iterator(); 
      while (iterOuter.hasNext()) { 
       IParameterDefnBase param = (IParameterDefnBase) iterOuter.next(); 
       paramName = param.getName();     
       if (paramName.equalsIgnoreCase("PR_SOME_PARAM")) { 
        task.setParameterValue(paramName,"someparam"); 
       }     
       else if (paramName.equalsIgnoreCase("PR_SOME_PARAM_2")) { 
        task.setParameterValue(paramName,"someparam2"); 
       } 
      }    
      options = new RenderOption();   
      options.setOutputFormat(reportFormat); 

      FileOutputStream fos = new FileOutputStream(locationReport); 
      options.setOutputStream(fos); 
      task.setRenderOption(options); 
      task.run(); 
      task.close(); 
      engine.destroy(); 
      fos.close(); 

     } 
    } catch(Exception e) { 
     System.out.println(e.toString()); 
    } 
} 

}

संबंधित मुद्दे