IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SDK Discussion :

Ouverture de rapport DESKI ave le SDK de SAP BO4.1 [JAVA]


Sujet :

SDK

  1. #1
    Membre à l'essai
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2002
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2002
    Messages : 16
    Points : 21
    Points
    21
    Par défaut Ouverture de rapport DESKI ave le SDK de SAP BO4.1
    Bonjour,


    J'aimerai savoir s'il est possible d'ouvrir (en vue de rafraichir) un rapport DESKI en java ?

    Le 'reportengine' me renvoie un message d'erreur lors du getService avec le paramètre FC_REPORT_ENGINE : 'Unable to instantiate ReportEngine'

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    reportEngines = (ReportEngines) iSess.getService("ReportEngines");
    ReportEngine wiRepEngine = (ReportEngine) reportEngines.getService(ReportEngines.ReportEngineType.FC_REPORT_ENGINE);
    Voici le message d'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
     
    Exception in thread "main" com.businessobjects.rebean.wi.CommunicationException: Unable to instantiate ReportEngine.
    	at com.businessobjects.rebean.wi.ReportEngines.createReportEngine(ReportEngines.java:290)
    	at com.businessobjects.rebean.wi.ReportEngines.getService(ReportEngines.java:244)
    	at Connect_n_Refresh_BO4_1.createInterface(Connect_n_Refresh_BO4_1.java:285)
    	at Connect_n_Refresh_BO4_1.main(Connect_n_Refresh_BO4_1.java:50)
    Caused by: java.lang.ClassNotFoundException: com.businessobjects.rebean.fc.internal.ras21.FullClientReportEngineOCCAFactory
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at com.crystaldecisions.celib.classloader.ClassLoaderHelper$2.loadClass(ClassLoaderHelper.java:90)
    	at com.crystaldecisions.celib.classloader.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:145)
    	at com.businessobjects.rebean.wi.ReportEngines.createReportEngine(ReportEngines.java:275)
    	... 3 more
    D'avance merci.

  2. #2
    Rédacteur/Modérateur
    Avatar de NorocBzh
    Homme Profil pro
    Développeur décisionnel
    Inscrit en
    Juin 2008
    Messages
    834
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur décisionnel
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 834
    Points : 1 265
    Points
    1 265
    Par défaut
    Salut,

    Deski n'existe plus en BI 4.1.
    Il faut que tu convertisses tes rapport Deski en Webi.

    Sinon, il existe un moyen (le DCP - Deski Compatibility Pack) pour utiliser un client deski XI 3.1 sur des rapports Deski hébergés sur l'environnement BI4.1.
    Mais en sdk, je ne pense pas que ce soit possible...

  3. #3
    Membre à l'essai
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2002
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2002
    Messages : 16
    Points : 21
    Points
    21
    Par défaut
    Bonjour NorocBzh,

    En effet, j'ai fait une erreur dans ma demande, j'aimerai ouvrir des rapports Rich (Full client) et non des rapports webi !

    Je réitère donc ma question

  4. #4
    Membre à l'essai
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2002
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2002
    Messages : 16
    Points : 21
    Points
    21
    Par défaut
    Bonjour,

    j'ai finalement réussi à rafraichir un rapport avec invit (prompt) et tout ce qu'il me faut.

    Le problème venait de la requête qui inclue un top 1000 et donc le rapport n'était pas trouvé dans les résultats.

  5. #5
    Nouveau membre du Club
    Homme Profil pro
    Informatique-Statistique
    Inscrit en
    Décembre 2011
    Messages
    23
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Informatique-Statistique

    Informations forums :
    Inscription : Décembre 2011
    Messages : 23
    Points : 31
    Points
    31
    Par défaut
    Bonjour callman,

    Peux-tu partager avec nous comment t'as fait s'il te plait ?

  6. #6
    Membre à l'essai
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2002
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2002
    Messages : 16
    Points : 21
    Points
    21
    Par défaut
    Bonjour cr.khalid,

    Voici ma class en entier pour ceux que ça pourrait intéresser :

    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Vector;
    import java.util.logging.FileHandler;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.logging.SimpleFormatter;
     
    import com.businessobjects.rebean.wi.BinaryView;
    import com.businessobjects.rebean.wi.CSVView;
    import com.businessobjects.rebean.wi.DocumentInstance;
    import com.businessobjects.rebean.wi.OutputFormatType;
    import com.businessobjects.rebean.wi.Prompt;
    import com.businessobjects.rebean.wi.Prompts;
    import com.businessobjects.rebean.wi.ReportEngine;
    import com.businessobjects.rebean.wi.ReportEngines;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
     
    public class bo_util {
    	private final static Logger goLog = Logger.getLogger(bo_util.class.getName());
    	private static FileHandler fh = null;
     
    	public static IEnterpriseSession iSess = null;
    	public static ReportEngines reportEngines = null;
    	public static ReportEngine wiRepEngine = null;
     
    	public static String username = "";
    	public static String pwd = "";
    	public static String cmsname = "serveur";
    	public static String authtype = "secEnterprise";
     
    	public static String err = "";
     
    	public static IInfoObject rppEncours = null;
     
    	public static void init(){
    		try {
    			fh = new FileHandler("log_ex1.log", false);			
    		}catch (SecurityException | IOException e){
    			e.printStackTrace();
    		}
    		Logger l = Logger.getLogger("");
    		fh.setFormatter(new SimpleFormatter());
    		l.addHandler(fh);
    		l.setLevel(Level.CONFIG);		
    	}
     
    	public static void main(String[] args) {
    		bo_util.init();
    	}
     
    	public static Boolean connectBO() {
    		System.out.println("Connecting...");
    		ISessionMgr sessionMgr;
    		try {
    			sessionMgr = CrystalEnterprise.getSessionMgr();
    			iSess = sessionMgr.logon(username, pwd, cmsname, authtype);
    			System.out.println("Connected!");
    			return true;			
    		} catch (SDKException e) {
    			goLog.log(Level.INFO, "NOT Connected ------");
    			return false;
    		}			
    		/*
    		 * finally { if (reportEngines != null) reportEngines.close(); if (iSess
    		 * != null) iSess.logoff(); }
    		 */
    	}
     
     
    	public static void deconnect() {
    		if (reportEngines != null)
    			reportEngines.close();
    		if (iSess != null)
    			iSess.logoff();
    		System.out.println("Finished!");
    	}
     
    	public static Vector<Integer> getIDrpp(String nomRpp, String chemin) throws SDKException{
    		Vector<Integer> ret = new Vector<Integer>();				
     
    		IInfoStore infostore = (IInfoStore) iSess.getService("InfoStore");
    		String query = "select si_id, si_name, si_parentid from CI_INFOOBJECTS where SI_NAME LIKE '%" + nomRpp + "%' and SI_KIND in ('Webi','FullClient') and SI_INSTANCE=0";
     
    		IInfoObjects infoObjects = (IInfoObjects) infostore.query(query);
     
    		for (Object object : infoObjects) {
    			IInfoObject infoObject = (IInfoObject) object;
    			String path = getInfoObjectPath(infoObject);
    			if (path.startsWith("/") & !path.startsWith("/Web") & !path.startsWith("/Mon") & !path.startsWith("/Report") & !path.startsWith("/User")) {					
     
    				Integer id_doc = infoObject.getID();
     
    				if (chemin == "" || chemin.equals(path))
    					ret.add(id_doc);
    				else
    					goLog.log(Level.WARNING, "Le chemin ne correspond pas");
     
    				rppEncours = infoObject;				
    			}			
    		}		
    		return ret;
    	}
     
    	public static boolean lanceRefresh(int idrpp, String nomRpp, String ValPrompt, String Dest, String export) throws SDKException{
    		reportEngines = (ReportEngines) iSess.getService("ReportEngines");
    		ReportEngine wiRepEngine = (ReportEngine) reportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
     
    		DocumentInstance widoc = wiRepEngine.openDocument(idrpp);
    		Prompts p;
    		p = widoc.getPrompts();
     
    		Integer nbP = p.getCount();
     
    		String [] aValPrompt = ValPrompt.split("/");		
     
    		if (nbP > 0) {
     
    			System.out.println("Nombre d'argument : " + p.getCount());
     
    			if (nbP > 0) {
    				Prompt pro0 = p.getItem(0);
    				System.out.println("Prompt name 1 : " + pro0.getID());
    				String[] dte0 = new String[1];
    				//dte0[0] = "20035209";
    				dte0[0] = aValPrompt[0];
    				pro0.enterValues(dte0);
    				System.out.println("Valeur prompt 1 : " + pro0.getCurrentValues()[0]);
     
    				if (nbP > 1) {
    					Prompt pro1 = p.getItem(1);
    					System.out.println("Prompt name 2 : " + pro1.getID());
    					String[] dte1 = new String[1];
    					//dte1[0] = "Livre";
    					dte1[0] = aValPrompt[1];
    					pro1.enterValues(dte1);
    					System.out.println("Valeur prompt 2 : " + pro1.getCurrentValues()[0]);				 
    				}
    			}
    		}
    		widoc.setPrompts();
    		widoc.refresh();		
    		widoc.save();
     
    		if (widoc.getMustFillPrompts()){ // check si tous les prompts ont été rempli
    			System.out.println("--> Check tous les prompts : ok");
    		}
     
    		if (widoc.getMustFillContexts()){ // check si context not seleted
    			System.out.println("--> Error : Context has not been selected");
    			err = "Error : Context has not been selected";
    			widoc.closeDocument();
    			return false;
    		}
     
    		if (export != "" || export != "none"){
    			BinaryView bv = null;
     
    			switch (export){
    				case "pdf":
    					bv = (BinaryView) widoc.getView(OutputFormatType.PDF);
    					writeBytes(bv.getContent(), nomRpp + "." + export);
    					break;
    				case "csv":
    					CSVView csvView = null;
    					csvView = (CSVView) widoc.getDataProviders().getView(OutputFormatType.CSV);
     
    					File f = new File(nomRpp + "." + export);
    					FileWriter fw;
    					try {
    						fw = new FileWriter(f);
    						fw.write(csvView.getContent());
    						fw.close();
    					} catch (IOException e) {
    						e.printStackTrace();
    					}
    					csvView = null;
    					break;
    				case "xlsx":
    					bv = (BinaryView) widoc.getView(OutputFormatType.XLSX);
    					writeBytes(bv.getContent(), nomRpp + "." + export);
    					break;
    				default :
    					err = "Format d'export non supporté";
    					widoc.closeDocument();
    					return false;
    			}			
    			bv = null;
    		}
     
     
    		widoc.closeDocument();		
    		widoc = null;
     
    		System.out.println("----- FIN TRAITEMENT REFRESH RAPPORT (" + nomRpp + ")-----");
    		/*if (Dest != ""){
    			IInfoStore infostore = (IInfoStore) iSess.getService("InfoStore");
    			String folderquery = "select si_id from CI_INFOOBJECTS WHERE SI_KIND='Folder' and SI_NAME='" + Dest + "'";
    			IInfoObjects folders = infostore.query(folderquery);
    			IInfoObject folder = (IInfoObject) folders.get(0);
     
    			IInfoObjects newInfoObjects = infostore.newInfoObjectCollection();
    			IPublication publication = (IPublication) newInfoObjects.add(IPublication.KIND);
     
    			publication.setTitle("Test Publication");
    			publication.setDescription("publication test");
    			publication.setParentID(folder.getID());
    			publication.save();
    		}*/
     
    		return true;
    	}
     
    	public static void writeBytes(byte[] data, String nomfich){
    		goLog.log(Level.INFO, "ecrit nomfich : " + nomfich);
    		try {
    			File file = new File(nomfich);
    			FileOutputStream fstream;		
    			fstream = new FileOutputStream(file);
    			fstream.write(data);
    			fstream.close();
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
     
    	}
     
    	private static String getInfoObjectPath(IInfoObject infoObject) throws SDKException {
    		String path = "";
    		while (infoObject.getParentID() != 0) {
    			infoObject = infoObject.getParent();
    			path = "/" + infoObject.getTitle() + path;
    		}
    		return path;
    	}	
    }

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 9
    Dernier message: 23/11/2009, 17h23
  2. [Migration] [V6.5]->[XI 3.0] Migration de rapport Deski
    Par stephy61083 dans le forum Administration-Migration
    Réponses: 1
    Dernier message: 19/02/2009, 15h09
  3. [XI 3.1] rapport DeskI via Infoview
    Par aziza2009 dans le forum Administration-Migration
    Réponses: 3
    Dernier message: 18/12/2008, 18h09
  4. Echec de l'ouverture de Rapport
    Par dachir dans le forum IIS
    Réponses: 0
    Dernier message: 19/05/2008, 13h57
  5. Echec de l'ouverture de Rapport
    Par dachir dans le forum SAP Crystal Reports
    Réponses: 0
    Dernier message: 19/05/2008, 13h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo