I have a report that is 12 inches wide, however the way the report is designed it can sometimes print only 8 inches. Here's what I do, the report has 18 fields that can be printed but because of the program sets up the report it can print anywhere from 5 to 18 of the columns. The used can choose what columns they want to print.
What I do is move those columns that don't need to print to the left = 0 and set them to visible = false. If the number of columns will fit on Portrait I get a second page that is blank. Everything that would have gone onto the second page has been moved to the left = 0. Margins are set correctly.
I know this is confusing but I hope someone will understand it and maybe be able to give me some direction.
Thanks again for any advise.
10 1621
I found the answer to this. I went into the setup and changed the column width to 8 inches. This worked to eliminate the second blank page. Is there a way to do this in VBA that way I could set it on the fly instead of making it a standard.
Luuk 1,047
Recognized Expert Top Contributor
You could try to change the Width of your report as you 'hide' columns.
it's not the width of the report but the Column size that is in the page setup section. the original column size is 14. something and I manually changed it to 8 which worked. I would like to be able to change the column size according to the number of fields are being printed.
Luuk 1,047
Recognized Expert Top Contributor
But if the report width is larger than the page width...
I think Access will print a blank page?
I am confused. I suspect what you mean is that the user can select which fields he or she wants to print.
So my thoughts are that, if there is some sort of selected/not selected field for each control, you could have a minimum control width specified for each field (It probably will be different for each one, depending on the type of data to be printed).
So, after the required controls are selected, the report width can be calculated from the sum of the minimum widths of each control.
This should give an indication of whether to print in Landscape or Portrait.
If it won't fit in landscape, you need to set the can grow property for each control and the detail section to yes, or consider using a smaller font.
If it fits easily onto the paper, you can recalculate the control width as the minimum width * (report width - margins) / sum(minimum widths)
Hope that helps
Phil
The report width shows 13.125 and I have the column size in the page setup to 8 and it seems to work fine. Remember all 18 columns are on the page to begin with and it will not let me change the report width because of this. But I haven't tried changing the report width after the columns that are not used are moved to the left. In Access VBA how do I change the report width, this program so out as a runtime so editing the report in runtime I don't think I can do that, I maybe wrong.
Luuk 1,047
Recognized Expert Top Contributor
To make is 90% of it's original width (with a click on the report): - Private Sub Report_Click()
-
Dim a As Report
-
Set a = Screen.ActiveReport
-
a.Width = a.Width * 0.9
-
'MsgBox a.Width
-
End Sub
-
NeoPa 32,557
Recognized Expert Moderator MVP
Hi Luuk.
Remember that, for the code within the associated module of the report itself, it is able to reference itself simply as Me .
That would leave your code as : - Private Sub Report_Click()
-
Me.Width = Me.Width * 0.9
-
End Sub
Luuk 1,047
Recognized Expert Top Contributor
Hmmmz, i'm not an Access expert ;)
and in other languages (like C#) it's called 'this'
I have problems getting the languages apart, with all thos function names 'INSTR', 'INDEX', 'POS', 'SUB', 'INDEXOF', etc, etc which are doing the same thing, but just got a different name ;)
NeoPa 32,557
Recognized Expert Moderator MVP
Well, you're doing a fine job anyway.
Access (VBA) is definitely different from other development languages and environments. Good to see you offering help even when it's just ideas without the finesse of a VBA programmer.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jody Gelowitz |
last post by:
I am having a problem with printing selected pages. Actually, the problem
isn't with printing selected pages as it is more to do with having blank
pages print for those pages that have not been...
|
by: Andrew |
last post by:
Hi,
I've got a spreadsheet style html document that has enough columns to
span two pages, and so rather than cramming all columns into one page,
or forcing the user to use 8 1/2 by 17 paper, ...
|
by: Andy V |
last post by:
Hi. I've got a multi page report of my monthly purchases. I'd like a running
total (month to date) at the end of each page and to have that total at the
top of the following page. So far all I can...
|
by: abhishek007p |
last post by:
hi,
i am new to asp.net. here is what i want to do. i have 2 aspx pages,
first.aspx and second.aspx
now from the first.aspx i want to give the second.aspx page values like
...
|
by: ME |
last post by:
I need to know how to create a MULTI page report. All I can seem to create
is a report with only one page, even though the datasource it is bound to
returns multiple records. I have posted an...
| |
by: thirunavukarasukm |
last post by:
I have a link wich opens a the second page with links wich call a javascript function.
I have some problem with javascript.
i am two aspx page..
in my first aspx page contain the second...
|
by: Gunjal |
last post by:
hi
i am generating a report in crystal report using asp.net
i want to print the report so i am using client side javascript
window.print() to print the report
But it always prints 1st page as...
|
by: karen987 |
last post by:
the page below is called "todays newslog" and it automatically draws out news articles posted within a 24 hour period. It is an asp page updated each midnight.
During the time Midnight to whenver...
|
by: bhappy |
last post by:
Hi All,
I am generating a report using crystal reports, i am getting 1st page as blank and remaining pages im getting data??
Any body have any idea plz..........
|
by: chachacha |
last post by:
how do i print the second image in the second page of the print document..
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
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...
|
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...
|
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,...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
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...
| |