473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 2853
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
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...
7
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...
6
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...
0
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 ...
0
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...
2
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...
4
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...
4
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...
11
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.