Creating dinamic Report

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?
 
A

Alastair MacFarlane

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​
 
D

Duane Hookom

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?


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top