473,651 Members | 2,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dont show blank pages in print preview in report

jj
I created a dynamic report and the fields is displayed
base on the query. The report contains about 34 fields so if the query has
34 fields, all
34 fields in the report shows up. But if the query has 10 (which most of
them have) fields, the report only shows 10 fields and hides the rest.
What happen is that when I go to print preview, its shows
the pages that have the fields and the blank page. The
blank page infact are the hidden fields. My problem is
that, how do I tell the print preview to display only
the pages that have the fields and don't show the pages
that contain the hidden fields.

Thanks

JJ


Jan 22 '06 #1
1 2877
You'll have to monkey around with your report's RecordSource, which it
sounds like you're doing anyway. You'll still have to supply fields for
all controls with a ControlSource property set and use set each
control's CanGrow, CanShrink property to 'Yes'. The Detail section of
the report, and any grouping sections (i.e. GroupHeader0, GroupFooter1)
also need to have their CanGrow, CanShrink props set to 'Yes'.

For your report's RecordSource in the 34 field case use:

SELECT Table1.*
FROM Table
WHERE ...whatever...
ORDER BY ....something.. .;

For the 10 field case use:

SELECT Table1.Field1, Table1.Field2, ...,
Table1.Field10, Null as Field11, ...,
Null as Field 34
FROM Table1
WHERE ...whatever...
ORDER BY ...something... ;

This will keep you from getting prompted for the field values that
don't appear in every iteration of the report and provide those fields
with a Null value.

The last couple of gotchas I've run into for something like this are
making sure you don't have a related Controls collection for the
controls that display your data on the report (e.g. labels with your
text boxes). Secondly, you'll need to play around with the ForceNewPage
property for each section of the report.

Jan 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1043
by: StevenBarnes | last post by:
We're needing to generate a "report" that will arrange data to be printed on tractor-fed forms. When we preview the "report", the data is right where it should be, but most of the page is blank, of course. The data will end up in the boxes/regions/areas/whatever on the pre-made tractor-fed forms. I can include a scanned image of the form on the report. When previewed, it looks perfect. However, when you hit "print", the image of the...
7
14358
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to display the graph but it is not possible to send query parameters to an OLE graph on a report (or programatically change any properties of an OLE Graph). However with a Form you do have the ability to change the RowSource of
6
4694
by: noway | last post by:
I have greated a report and have included a page break in it. The report breaks were it is supposed to but then it creates a blank page between the two pages. Since this report will print out approx 20 pages (without the blank pages) it is large waste of paper. I have tested the report by setting the data source so that only one page will print and all the data fits on page. I have checked all the printing parameter, set the print magins...
0
1709
by: Greg Reed | last post by:
I have a 4 column report and wondered if there is column number property. I have more complicated uses for it but basically could I Have column number shown at ctop of each column 1 2 3 4 < Column Number. ABC DEF GHI JKL Did briefly try programming a counter but can't find where to put
0
1128
by: B-Dog | last post by:
I'm using the code from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/printwinforms.asp to print some info from a database and I've struggled through customizing the report to fit what I need and thought I had it all working great since my print preview looked great but when I hit the print button I get blank pages at the printer. I've tried two different printers with the same results. Any ideas?
2
14114
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002 database? Thanks, Dean Slindee
4
3151
by: Mal Reeve | last post by:
Hello, I have a report that has only 2 levels of grouping. The detail section is simply 1 large block for a memo field. I am finding that on some occasions the report errors and generates hundreds (perhaps even an infinite loop...I have to break the system to stop the report generating) of pages. While I'm not 100% I think this may have something to do with the detail
4
7560
by: scubasteve | last post by:
Hi, I'm having issues with AC2007 custom ribbons. I'm building an AC2007 runtime app which has a custom ribbon (called CommandsDisabledHideRibbon) set as the default db ribbon name (see XML at end of post). The aim is to hide as much of the Access interface as possible. CommandsDisabledHideRibbon ribbon XML (verified as well-formed by the Office 2007 Custom UI Editor): <customUI...
11
7320
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code is run again? This is causing certain error problems. 1 Why does the code run for a print preview when the report already exists? 2 What command do I use in code to find out if a report (or any other object for that matter) is already...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7294
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.