Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2004, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report - Transpose fields and records

The "normal" layout of a report comprises fields along the x-axis and the records along the y-axis.

If the underlying query is in the above format, is there any way of having the fields along the y-axis and the records along the x-axis. Similar to the results of the Transpose function in Excel.

Any help appreciated. Thanks.

Clive Astley
__________________
Clive Astley
 
Old November 15th, 2004, 04:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

I'm not quite sure what you mean. Do you mean when you use the report wizard and you ask for tabular format of data that you want the rows as columns and columns as rows vs. the default?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old November 15th, 2004, 07:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Greg,

Thanks for your reply. Yes, that's exactly what I want to do.

Clive Astley
 
Old November 16th, 2004, 08:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Unless there's a third-party add-in to do that, the easiest way I can see doing that is to use the wizard to create the report in a strict columnar format (one column from the top down) and then you manually place all the fields. That is, don't use the tabular format at all, go strictly top down to place all your fields in the report, and then rearrange them yourself.

:(




Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old November 16th, 2004, 10:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Greg. I haven't been able to fathom an alternative either. I've so far done it by brute force method of producing a DAO recordset to fill variables which then fill text boxes on the report. It works, but just thought their had to be a better way.

Latest problem is trying to produce a report on the fly from a crosstab query. The number of column headings in the crosstab varies with the data. But once one has written a report, it's layout is fixed forever.

Thanks gain. Best wishes,

Clive Astley
 
Old November 16th, 2004, 11:06 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried coding a pivot table from within VBA then you could provide any type of dynamic design?

Cheers Ray
 
Old November 16th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Ray. But I don't really understand what you mean. Can you give me a bit of a clue please.

Thanks.

Clive Astley
 
Old November 16th, 2004, 01:39 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Clive!
I've been reading about how to do the transpose in an access db.There is no
clue in access books about it. I am not an expert programmer and i will let
them to implement it but a better way is u read ur report source to an array
and then u retrieve ur source from the array transposing the rows and columns.
I would be happy to see this happening.
Regards Penta.

 
Old November 16th, 2004, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Penta. I wonder if this is what I am doing already. Reading a recordset into an array and then using the array contents to fill text boxes on the report. But it seems a bit messy. Can you give me an example of what you mean please.

Many thanks.

Clive Astley
 
Old November 16th, 2004, 02:49 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Clive!
As i have said i'm not an expert. Please read "Having problems retrieving an array to a table" on my ulterior posts. The main difference seems to be that i have used a table or a qry and the function "get rows" to read the source to the array. Then the idea is to have the inverse function (only experts would know how!) to retrieve the values from the array transposing columns and rows to a new table which will become the report source.
Hope this will help.
Regards P.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding fields to the crystal report Pravin.k Crystal Reports 2 January 3rd, 2008 09:35 AM
Report fields have links skdevre Crystal Reports 1 May 7th, 2007 08:46 AM
Formula Fields in Records Problem berniehunt Crystal Reports 1 April 14th, 2006 06:52 PM
add fields to a report dartcoach Access 2 March 9th, 2005 02:38 PM
Create Table's fields from another's Records Jinan BOOK: Beginning Access VBA 0 August 30th, 2004 10:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.