Creating dinamic Report

  • Thread starter Thread starter Oded Kovach
  • Start date Start date
O

Oded Kovach

Hello there

I have crosstab query which the columns on it are dinamic (the amout of
columns depend on the data that comes)

Now i need to build a report based on that query that the amount of columns
changes.

the application should be work as MDE aslo.

Is there a way to build report like this?
 
Oded

My answer would be to loop through the fields collection
of your crosstab query using ADO or DAO, and use the
following Access function to create the fields in the
detail section of your report:

Function CreateControl(FormName As String, ControlType As
AcControlType, [Section As AcSection = acDetail],
[Parent], [ColumnName],
, [Top], [Width], [Height])
As Control

The greatest problem would be the spacing and calculating
the spacing between the controls, but you could calculate
this by reviewing the number of columns in your query and
use this value to calculate the spacing.

Good luck! It is manageable but could involve a lot of
work. Come back to the group if you encounter any problems
along the way.

This is my solution but there may be others out there.

Alastair MacFarlane
Scotland​
 
You can't create controls in an MDE file. I think the best solution for
dynamic crosstab reports is in the Crosstab.mdb in the download at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4.

--
Duane Hookom
MS Access MVP
--

Alastair MacFarlane said:
Oded

My answer would be to loop through the fields collection
of your crosstab query using ADO or DAO, and use the
following Access function to create the fields in the
detail section of your report:

Function CreateControl(FormName As String, ControlType As
AcControlType, [Section As AcSection = acDetail],
[Parent], [ColumnName],
, [Top], [Width], [Height])
As Control

The greatest problem would be the spacing and calculating
the spacing between the controls, but you could calculate
this by reviewing the number of columns in your query and
use this value to calculate the spacing.

Good luck! It is manageable but could involve a lot of
work. Come back to the group if you encounter any problems
along the way.

This is my solution but there may be others out there.

Alastair MacFarlane
Scotland
-----Original Message-----
Hello there

I have crosstab query which the columns on it are dinamic (the amout of
columns depend on the data that comes)

Now i need to build a report based on that query that the amount of columns
changes.

the application should be work as MDE aslo.

Is there a way to build report like this?


.
 
Back
Top