Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Jasperreport and openerp 7 with parameters How-to

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
reportjasper
5 Risposte
24855 Visualizzazioni
Avatar
Oscar Cascante F

Hello,

I would like to share this mini-howto about use jasperreport server, ireport and openerp 7 passing parameters. I hope this help somebody. Again, sorry for my english

1- Install jasperreport server

2- Download and extract jassperreport file for openerp from https://github.com/syleam/openerp-jasperserver. This extract two folders.

3- Install "python-pip" library from command line or synaptic

4- Download and install 3 libraries from command line: "sudo pip install httplib2 pypdf python-dime"

5- Untar the openerp jasperreport file and install the jasper_server module.

In jasperreport server:

create needed folders in jasperserver:

6- Create "openerp" folder inside the root directory

7- Create "datasources" folder inside the openerp directory

8- Create "inputs" folder inside the openerp directory

9- Create "bases" folder inside the openerp directory

10 Under "bases" folder, create a directory with the name of your working openerp database and complete the necesary data parameters.

11 In openerp go to menu /configuration/jasper report/configuration/jasperserver configuration/ and create a new database parameter access.

11 Right click over datasources folder and create a new datasource.

12 Use ireport to create a new report with a basic query without parameters

13After create the sql query, define two parameter that we are going to use to pass data from openerp.
This parameters have to be named as OERP_<name of="" parameter="">

Repeat, name of parameters must be in uppercase.

14 In jasperreport server go to tree openerp/inputs option and create an input control for each parameters you created in openerp. You have to use the same parameters name.

15 In openerp/bases/<databasename> folder create a new jasperreport resource with the same report name of your ireport report name and choose the <reportname>.jrxml file.

16 Then in "resources and controls" add two input controls from jasper server

17 In "datasources" select the repository just created

18 Create a new class inside your module ( the one you are going to call the report ) This class is used to call the report and give the parameters from openerp to jasper.

Example tested:

( change the values inside <> with yours )

class <report_class> (osv.osv):

def <nameoffunction>(self, cr, uid, ids, context=None): # you can use a button to call this funtion to execute the report

    <reg> = self.browse(cr, uid, ids, context=context)[0]
    data = {}
    data['model'] = '<modelname>'
    data['jasper'] = {
        '<jasperparameter1>': <reg>.<param1>, # without "OERP_"
        '<jasperparameter2': <reg>.<param2>,
    }

    return {
            'type': 'ir.actions.report.xml',
            'report_name': 'jasper.<openerp/jasperdocument/servicename>',
            'datas': data,
    }


_name = '<modelname>'

_columns = {
    '<param1>' : fields.char('From', size=15, required=True),
    '<param2>' : fields.char('To', size=15, required=True),
}

19 Now create the xml to show the report parameter form in openerp

20 In openerp go to menu configuration/jasper report/jasper document and create a new one using this parameters:

objet model = <report_class> in your module

service name = field report_name in your class without "jasper."

service unit = jasperserver report name

jasper file = jasperserver report name

21 Go to "parameter" tab and create the two parameters with the same name you write in jasperreport

22 Test

My openerp parameter screen:

image description

My pdf jasper report screen question:

image description

As soon as posible we are going to upload a video of the process

5
Avatar
Abbandona
Gary Dunnaway

This is about the only information I can find about using Syleam's Jasperserver module. I still don't understand it, though. I have it installed, and I really have no idea where to go from here.

Oscar Cascante F
Autore

If you have a concrete question i would try to answer it.

STROOM Technology

Oscar, i've tried to understand how to use the module. What i don't understand is what to fill in service name. You've said <openerp/jasperdocument/servicename>, is this literal? Another question is what you are referring as jasperserver report name. I think is the name in jasperserver (not the jrxml file), is that right?

Gene Leung

It is great with the information. I tried to follow the steps. At step 11, is it pointing to the Jasper server, datasources folder newly created under the openerp folder? I really wish you have time to create the video howto so that we can follow it easily. Thanks in advance.

Gary Dunnaway

First of all, thank you for your time and effort. In general, is this method necessary for me to print invoices through JasperServer? Or only if I want to pass parameters back and forth? I want my client to be able to do everything through the OpenERP web interface, without having to open the /jasperserver web page. As for your tutorial, I am a bit confused here: 10 Under "bases" folder, create a directory with the name of your working openerp database and complete the necesary data parameters.

Parameters? On a folder? I don't understand. Perhaps you meant something else there?

Anabela Damas

Is the best info that I found about Jasper Reports and Openerp. But I can't find "11 In openerp go to menu /configuration/jasper report/configuration/jasperserver configuration/ and create a new database parameter access." I've also the same question that @Gary Dunnaway has... Can you help me ?

Avatar
STROOM Technology
Risposta migliore

Hi Oscar, have your tried an XML report using SYLEAM jasper_server module?

I receive the following answer after SOAP call:

<faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>

Any clue?

Another question: does openerp send the id/s of the selected rows when you launch the report from the sidebar in a tree view? Does it send the ids in a jasperreport parameter?

Thanks!

0
Avatar
Abbandona
Avatar
Gary Dunnaway
Risposta migliore

This is about the only information I can find about using Syleam's Jasperserver module. I still don't understand it, though. I have it installed, and I really have no idea where to go from here.

0
Avatar
Abbandona
Avatar
Paula Neves
Risposta migliore

Hello there.

So me and some collegues of mine have been trying to actually put this to work but we still havent managed to do this, i think there is something wrong with the class that we have created but we don't know.

# *****************************************************
# JASPER - início
# *****************************************************

class hr_contract_jasper(osv.osv):

    _name='hr.contract.jasper'

    def relatorio_contrato_consultor(self, cr, uid, ids, context=None):

        res = self.pool.get('hr.contract').browse(cr, uid, ids, context=context)[0]

        data = {}
        data['model'] = 'hr.contract.jasper'
        data['jasper'] = {
            'IDCONTRACTO': res.id,
        }

        #raise osv.except_osv('Error !', _(data))
        #data = {'model': 'hr.contract.jasper', 'jasper': {'IDCONTRACTO': 897}}
        """
        ERRO

        if hasattr(cur_obj, 'company_id') and cur_obj.company_id:
        File "/opt/openerp-source/server/openerp/osv/orm.py", line 497, in __getattr__
        return self[name]
        File "/opt/openerp-source/server/openerp/osv/orm.py", line 385, in __getitem__
        self.__logger.debug(''.join(traceback.format_stack()))
        """

        return {
                'type'          : 'ir.actions.report.xml',
                'report_name'   : 'jasper.report_1',
                'datas'         : data,
        }    

hr_contract_jasper()

# *****************************************************
# JASPER - fim
# *****************************************************

Can you see if there is something wrong with this?

I am almost 100% sure that the way we are handling the other parts of the toturial are correct.

Thanks in advance.

PS: if you could provide a video i would be gladly appreciated.

0
Avatar
Abbandona
Avatar
Oscar Cascante F
Autore Risposta migliore

Hello,

Sorry about the delay...

In openerp->settings->jasper documents-> you create a new report. Here, you have a field name: Service name. This is the name you have to use. About the jasper report name, is the name used in jasperreport server.

Hope this help

0
Avatar
Abbandona
Avatar
ARRA Jean Jonathan
Risposta migliore

Hi Mister Oscar, I have a problem about the parameters in jaspserserver I don't know how can I create a parameters to link that ith my jasperserver. Pleas help me

0
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
document is empty error
report jasper
Avatar
Avatar
1
ago 20
16340
Jasper report module for Odoo v8. Risolto
report jasper odooV8
Avatar
Avatar
1
gen 16
4559
How to fuse custom data and openerp data using jasper parser
report jasper parser
Avatar
0
mar 15
5122
Jasperserver openerp 7, The simplest way How-to
report jasper openerp7
Avatar
0
mar 15
4831
Jasper report module for OpenERP 7
v7 report jasper
Avatar
Avatar
Avatar
Avatar
3
mar 15
17243
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now