Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > Business Objects > SDK
SDK Forum d'entraide pour la programmation des outils BO par des API (VBA, ASP, Java)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 30/01/2008, 14h19   #1
Invité de passage
 
Inscription : avril 2006
Messages : 69
Détails du profil
Informations forums :
Inscription : avril 2006
Messages : 69
Points : 3
Points : 3
Par défaut [BO XI][VBA]Compter le nombre de page dans section (Difficile)

Bonjour,

Le problème est simple: Y a t il possibilité en BO xi d'afficher pour chaque section (ex section sur le client) les pages sous le format (X/Y) avec X qui est la page courante dans la section et Y le nombre de page totale de la section

ex: section 1 -> page 1/3
section 2 -> page 2/5

dans ce cas mon document possède 8 pages au total.

Pour le moment j'ai utilisé la fonction PageDansSection(NumeroSection()) mais cela m'affiche que la page courante de la section et en plus de cela cette fonction bug car elle affiche 0 dès que l'on passe à la section 2.

Sur un forum j'ai trouvé une macro VBA (pas spécialiste du tout donc pour le moment elle ne marche pas) -> j'aiemrais savoir s'il y aune autre solution ou si quelqu'un a déjà résolu ce problème

merci beaucoup
schumi101 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2008, 14h21   #2
Invité de passage
 
Inscription : avril 2006
Messages : 69
Détails du profil
Informations forums :
Inscription : avril 2006
Messages : 69
Points : 3
Points : 3
Voici le code de la macro

Code :
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
Public Sub Paginate(Pages AS DpVBAInterface)
 
Dim DocObj AS busobj.Document 'Document Object
Dim RepObj As busobj.Report 'Report Object
Dim SecArray 'Array that will hold section values
Dim IntSecArrayLen As Integer 'Length of the section array
Dim SectionType AS String 'Data Type of Section
Dim i As Integer
'Dim PagesArray(1, 2)
 
SET DocObj = ActiveDocument ' Get the Active Document
Set RepObj = ActiveReport ' Get the Selected Report
SET SectionPage = DocumentVariables
 
 
' Retrieve name of the top level section (We can also know if there exist any sub-sections)
SectionName = RepObj.GeneralSectionStructure.SubSectionStructure.Master.Name
 
 
' Retrieve VALUES of the Section
SecArray = DocObj.DocumentVariables(SectionName).VALUES(boUniqueValues)
SectionType = TypeName(SecArray(1)) ' Identify Data type of the section
IntSecArrayLen = UBound(SecArray)
 
 
Pages.UserString(1) = "PageCount"
'Pages.DpVBACubes.SetNbCubes (1)
 
'Our new cube is the first one
Dim PageCount As DpVBACube
Set PageCount = Pages.DpVBACubes.Item(1)
PageCount.DpVBAColumns.SetNbColumns (2)
PageCount.DpVBAColumns.Item(1).Name = "Contract Number"
PageCount.DpVBAColumns.Item(2).Name = "Total Pages in Section"
 
PageCount.DpVBAColumns.NbLines = IntSecArrayLen 'Number of LINES = number of contract Sections
 
Dim ContractNumber AS DpVBAColumn
Dim PagesInSection AS DpVBAColumn
 
 
SET ContractNumber = PageCount.DpVBAColumns.Item(1)
ContractNumber.Qualification = boDimension
ContractNumber.Type = boCharacterObject
 
FOR i = 1 TO IntSecArrayLen
ContractNumber.Item(i) = SecArray(i)
Next i
 
SET PagesInSection = PageCount.DpVBAColumns.Item(2)
PagesInSection.Qualification = boDimension
PagesInSection.Type = boCharacterObject
 
WITH RepObj
FOR i = 1 TO IntSecArrayLen
'Filters the report by contract number
.AddComplexFilter SectionName, "=<" & SectionName & "> = """ & SecArray(i) & """"
.ForceCompute
'Assigns the page number TO the array
PagesInSection.Item(i) = .NumberOfPages
'Releases the filter
.AddComplexFilter SectionName, "=(0=0)"
.ForceCompute
 
Next i
 
 
End With
 
End Sub
schumi101 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2008, 15h52   #3
Invité de passage
 
Inscription : avril 2006
Messages : 69
Détails du profil
Informations forums :
Inscription : avril 2006
Messages : 69
Points : 3
Points : 3
Ne pas hésiter à me poser des questions si ma demande n'est pas clair

Merci
schumi101 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/01/2008, 08h53   #4
Invité de passage
 
Inscription : avril 2006
Messages : 69
Détails du profil
Informations forums :
Inscription : avril 2006
Messages : 69
Points : 3
Points : 3
Bonjour,

Y-t-il des personnes qui ont la même demande qui est à mon avis assez courante et le même problème

merci pour votre aide
schumi101 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/02/2008, 13h39   #5
Membre émérite
 
Avatar de Ayana
 
Inscription : décembre 2005
Messages : 901
Détails du profil
Informations forums :
Inscription : décembre 2005
Messages : 901
Points : 900
Points : 900
V5, V6, XI ?
DeskI, WebI ?
__________________
--= Ayana =--
Modératrice B.I.

Règles du forum BO

Team BAB - Spécialistes BO

Rubrique BI de developpez.com
Ayana est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 13h15.


 
 
 
 
Partenaires

Hébergement Web