Add fields to a report

AlexRigholt

Registered User.
Local time
Tomorrow, 01:12
Joined
Nov 14, 2008
Messages
36
Hello,

In a dialog box users select what columns will appear in a report. How to make a report that includes only the selected fields, without having gaps between the columns?
 
Access will not automatically adjust spacing on a report's detail lines. You have at least three choices:
1. Use one report with all the fields that might be required - this could get ugly so you may want to separate this into a couple of canned versions.
2. Create a specific report for each set of fields.
3. Create the report on the fly with code - not for the faint of heart. The actual difficulty with this method is getting the columns sized right. If I were going to do this, I would create a table with all the possible column names along the width of the column in inches and the width and caption of the associated label.
 
Thanks Pat,

Thanks for your replay. A report with all fields wouldn't even fit on a landscape A3 sheet, and a selection of reports wouldn't make my customer happy.
I'll be able to code it as per your suggestion 3, but hoped there would be a simple way. I'll assemble strings for both the header line and the details, and use a mono-spaced font.
 
The simplest way is to create exports to excel rather than reports. You can give them a field list on the form and use that to create the query. Then export the query to excel and let them do what they want with it.

Access already contains a built in report writer so writing a duplicate seems to be counter productive. Are you intending to let the users save these created "objects" - that would be a bad idea since it would prevent you from being able to distribute new copies of the front ends. If you are going to allow them to save their requests, you need to save their selection criteria in a table and then rebuild the report each time they run it.
 
You're right Pat about duplicating the report writer, and I already have options in all reports to export to Excel... This is going to save me a lot of time! Thanks!
 

Users who are viewing this thread

Back
Top Bottom