Page 1 of 1

[Solved] Multiseries chart in reports

Posted: Wed Aug 27, 2014 8:47 am
by longi
Hi!
Firstly thanks for reading this post.
I am able to build a report with a graph from a query, but until now I've only made graphs with only one serie of data.
Now I have a query which is like a resume of an amount of data, which is perfect to make a graph with several series, to compare them.
I am not able to deal with matrix or bidimensional arrays (put my query into a bidimensional array) to put data into the grid of data of the graph.
Anybody know how to deal with this kind of object?

The code I need to manipulate is the next:

Code: Select all

   While oResultset.next 'Esto es del libro de Mauricio
  for i=0 to 0
	'Redimensionamos la matriz
    Redim Preserve mDirectorio( co1,Columnas)
    'Guardamos los datos en el nuevo indice
    mDirectorio( co1,i) = oResultset.getString(2) 'El 2 hace referencia al nĂºmero de la columna que hay en la consulta
    'Vamos construyendo nuestro directorio                
    sTmp = sTmp & mDirectorio( co1,i) 
	'Incrementamos nuestro contador de registros
    co1 = co1 + 1
 Next
 Wend  
I attach the example I got with one serie. The report should be opened by the macro. I erased the form with a button to open it because the weight of de database, in order to be able to send it.

Thanks in advance!

Re: Multiserie graph in reports

Posted: Mon Sep 01, 2014 9:11 am
by longi
Hi!

I've just solved this pathc I needed.
I don't know if it is a general solution or only a particular solution, but it works in this case.
I made loads of trials to get it, but it could be a good thing that other people tried the 'solution' in other examples, because I don't want 'my solution', I want a general solution for everyone....
Here you are the piece of code that I changed. Also I've attached the data base with all example (If I knew how to attach images....!)

Code: Select all

 While oResultset.next 'Esto es del libro de Mauricio
   for i=0 to Columnas-2
	'Redimensionamos la matriz
    Redim Preserve mDirectorio( co1,Columnas-2)
    'Guardamos los datos en el nuevo indice
    mDirectorio( co1,i) = oResultset.getString(i+2) 
    'Vamos construyendo nuestro directorio
   next        
    sTmp = sTmp & mDirectorio( co1,i-1)    
	'Incrementamos nuestro contador de registros
    co1 = co1 + 1
 Wend  
I hope it were useful! :super: