Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 9th, 2004, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
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
Reply With Quote
  #2 (permalink)  
Old November 15th, 2004, 04:31 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #3 (permalink)  
Old November 15th, 2004, 07:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
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
Reply With Quote
  #4 (permalink)  
Old November 16th, 2004, 08:47 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #5 (permalink)  
Old November 16th, 2004, 10:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
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
Reply With Quote
  #6 (permalink)  
Old November 16th, 2004, 11:06 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
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
Reply With Quote
  #7 (permalink)  
Old November 16th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
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
Reply With Quote
  #8 (permalink)  
Old November 16th, 2004, 01:39 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
  #9 (permalink)  
Old November 16th, 2004, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
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
Reply With Quote
  #10 (permalink)  
Old November 16th, 2004, 02:49 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.