perove
asked on
Fixed number of lines in report -ALWAYS
Hi,
I have a simple report, just a report header and a detail section. Lets say it contains customers from northwind
Depending on some user selection i can have 10,100,43 or whatever customers in the report
I have designed the report so that under each detail line i have draw a horozontal line, and each field is divided by vertical lines.
So it *almost* look like a excel spreadsheet.
OK?
My problem is that I alway wants 25 lines pr.page, and if I return ex. 35 records I want to draw the lines for the 15 lines that are in the report without customerdata.ie I want 15 "empty lines"(just the horizontal & vertical lines) in the rest of page2.
See what I mean?
perove
I have a simple report, just a report header and a detail section. Lets say it contains customers from northwind
Depending on some user selection i can have 10,100,43 or whatever customers in the report
I have designed the report so that under each detail line i have draw a horozontal line, and each field is divided by vertical lines.
So it *almost* look like a excel spreadsheet.
OK?
My problem is that I alway wants 25 lines pr.page, and if I return ex. 35 records I want to draw the lines for the 15 lines that are in the report without customerdata.ie I want 15 "empty lines"(just the horizontal & vertical lines) in the rest of page2.
See what I mean?
perove
Hi perove. I don't have any suggestions on this topic; I just wanted to point out a question I posted for you earlier that you probably didn't see:
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=msaccess&qid=20162321
Mike.
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=msaccess&qid=20162321
Mike.
ASKER
Well, before the report is run the user selects criteria for the report. If he select ex. all the customer in Himalaya this might give the report only 35 customers to display.
The problem is not to make a page break on very 25th record/line, the problem is to make the report to fill in the rest of the vertical lines in the report to "fill the page"
I have a feeling you don't get my point, sorry for my english, hope it is clearer now..
Mike:
Thanks, haved checked in here 4 a while, and missed thisone..
perove
ASKER
this is how I whant the report to look like:
page1
__________________________ _______
customerid | customername |
-------------|------------ ------
perove | Per ove |
-------------|------------ ------|
alfi | Afred holly |
-------------|------------ ------|
| |
-------------|------------ ------|
| |
-------------|------------ ------|
| |
-------------|------------ ------|
...
...
..23 "empty" totally
This example return only two records (due to the criteria) but IO want to fill the rest of the page with 25 lines (vertical & horisontal) ie 23 "empty" records
perove
page1
__________________________
customerid | customername |
-------------|------------
perove | Per ove |
-------------|------------
alfi | Afred holly |
-------------|------------
| |
-------------|------------
| |
-------------|------------
| |
-------------|------------
...
...
..23 "empty" totally
This example return only two records (due to the criteria) but IO want to fill the rest of the page with 25 lines (vertical & horisontal) ie 23 "empty" records
perove
You could always use a different table .... starting with it being empty, add your n items, and then add empty records as needed to a multiple of 25 records.
You would then base your report off of this table.
-Dennis Borg
You would then base your report off of this table.
-Dennis Borg
I would use a kind of "template" table with the number of lines you want.
This table can be joined (LEFT or RIGHT) in such a way that the template always "shows".
This will force e.g. 25 output records, even if there is no real data.
To join you need the enumeration of your input.
Getting the idea ?
Nic;o)
This table can be joined (LEFT or RIGHT) in such a way that the template always "shows".
This will force e.g. 25 output records, even if there is no real data.
To join you need the enumeration of your input.
Getting the idea ?
Nic;o)
Perove,
I havn't checked all the links in this thread, so this may already have been suggested.
What you want to do is use the MoveLayout, NextRecord, and PrintSection properties.
By using these, you can move the layout down the page without skipping records. ie.
MoveLayout=True
NextRecord=False
PrintSection=True
By doing this in the OnFormat of the detail section, you can control the report engine in a varity of ways. ie. Print a specific number of records per page, print blank lines, etc.
It's not entirely clear to me what you specific goal is, but the technique I've suggested will do the trick in one form or anther.
Feel free to send along a sample MDB if you wish.
Jim.
I havn't checked all the links in this thread, so this may already have been suggested.
What you want to do is use the MoveLayout, NextRecord, and PrintSection properties.
By using these, you can move the layout down the page without skipping records. ie.
MoveLayout=True
NextRecord=False
PrintSection=True
By doing this in the OnFormat of the detail section, you can control the report engine in a varity of ways. ie. Print a specific number of records per page, print blank lines, etc.
It's not entirely clear to me what you specific goal is, but the technique I've suggested will do the trick in one form or anther.
Feel free to send along a sample MDB if you wish.
Jim.
ASKER
Thanks people,
Using a temp table and fill with rec from code is not an option for me. This is a mutiuser database and increase my project to also keep track of x temptables is not what I want to do.
Jim,
I have been experimenting with the three prop. you are referring to but I cant get it right., but I'm sure this is the way to go.
My goal is to write a form that ALWAYS have 25 lines pr page, even if the criteria of the recordsorce (due to filtering ect..) only give me 15 records i whant to fill the rest of the page with ten lines...
perove
Using a temp table and fill with rec from code is not an option for me. This is a mutiuser database and increase my project to also keep track of x temptables is not what I want to do.
Jim,
I have been experimenting with the three prop. you are referring to but I cant get it right., but I'm sure this is the way to go.
My goal is to write a form that ALWAYS have 25 lines pr page, even if the criteria of the recordsorce (due to filtering ect..) only give me 15 records i whant to fill the rest of the page with ten lines...
perove
Send along a sample MDB if you can, but it sounds like you need to know when you on the last record and then move down the page.
Jim.
Jim.
ASKER
Jim,(or anyone)
Instead of sending a database to you let me try to explain how you can make me a sample.
In northwind create a new query:
SELECT Customers.*, Customers.CustomerID
FROM Customers
WHERE (((Customers.CustomerID) Like "a*"));
Save the query as "mytestQuery" (or whatever..)
Which gives me 5 customers when I run it.
Then create a new report based on this query.
Add customerid and CompanyName in the detail section so that they are on the same line, remove the labels.
The report will then look like:
ALFKI Alfred futterkiste
ANATR Ana tuiljo..
ANTON Antonio Moreno..
AROUT Around the horn
Then add a horisonatl line under the customers
The report will then look like:
ALFKI Alfred futterkiste
__________________________ ______
ANATR Ana tuiljo..
__________________________ ______
ANTON Antonio Moreno..
__________________________ ______
AROUT Around the horn
__________________________ ______
What I want is five more lines under the last customer. Simple as that. So the report will look like:
ALFKI Alfred futterkiste
__________________________ ______
ANATR Ana tuiljo..
__________________________ ______
ANTON Antonio Moreno..
__________________________ ______
AROUT Around the horn
__________________________ ______
__________________________ ______
__________________________ ______
__________________________ ______
__________________________ ______
Hope this is a fear challange for 100p
if not let me know..
perove
Instead of sending a database to you let me try to explain how you can make me a sample.
In northwind create a new query:
SELECT Customers.*, Customers.CustomerID
FROM Customers
WHERE (((Customers.CustomerID) Like "a*"));
Save the query as "mytestQuery" (or whatever..)
Which gives me 5 customers when I run it.
Then create a new report based on this query.
Add customerid and CompanyName in the detail section so that they are on the same line, remove the labels.
The report will then look like:
ALFKI Alfred futterkiste
ANATR Ana tuiljo..
ANTON Antonio Moreno..
AROUT Around the horn
Then add a horisonatl line under the customers
The report will then look like:
ALFKI Alfred futterkiste
__________________________
ANATR Ana tuiljo..
__________________________
ANTON Antonio Moreno..
__________________________
AROUT Around the horn
__________________________
What I want is five more lines under the last customer. Simple as that. So the report will look like:
ALFKI Alfred futterkiste
__________________________
ANATR Ana tuiljo..
__________________________
ANTON Antonio Moreno..
__________________________
AROUT Around the horn
__________________________
__________________________
__________________________
__________________________
__________________________
Hope this is a fear challange for 100p
if not let me know..
perove
perove:
What about using a Split Database, where each user has their own copy of the front end? The temp table I spoke of earlier would be located in the front end, which would elimitate the concurent user problem.
As far as updating the clients with new versions of the front end, this process can be automated so that you would not be required to visit each workstation.
-Dennis Borg
What about using a Split Database, where each user has their own copy of the front end? The temp table I spoke of earlier would be located in the front end, which would elimitate the concurent user problem.
As far as updating the clients with new versions of the front end, this process can be automated so that you would not be required to visit each workstation.
-Dennis Borg
Will there be any grouping in the report?
Jim.
Jim.
OK, a different approach:
Why not make a .jpg to function as your reports background image with the lines "in place" for 25 lines per page.
There will be some aligning effort, but you're able to have your "empty lines" even when there are 2 pages or more necessary, without any coding effort.
Besides this you need to arrange ofcourse that the detail section between header and footer can have a max of 25 lines.
Nic;o)
Why not make a .jpg to function as your reports background image with the lines "in place" for 25 lines per page.
There will be some aligning effort, but you're able to have your "empty lines" even when there are 2 pages or more necessary, without any coding effort.
Besides this you need to arrange ofcourse that the detail section between header and footer can have a max of 25 lines.
Nic;o)
ASKER
Jim,
No grouping,
Dennis,
Thanks for the input, but this is just a small piece in a rather big , complex syste (I dont have all tha *control*) so redesigning the whole approach is not an option.
Nico,
Could be a Good idea, but I still prefer a .movelayout if it can be done
perove
No grouping,
Dennis,
Thanks for the input, but this is just a small piece in a rather big , complex syste (I dont have all tha *control*) so redesigning the whole approach is not an option.
Nico,
Could be a Good idea, but I still prefer a .movelayout if it can be done
perove
perove:
Just to throw out another idea, that you may or may not find beneficial:
Since you have no control over the overall process (i.e. the whole application), but you do have control over this particular aspect, you could design this to programatically create a local database (if it hasn't been created already), create a table in that database and link it into your program. This prep code would only be executed once per client.
This way, you could still base the report off a table stored on the user's local machine.
-Dennis Borg
Just to throw out another idea, that you may or may not find beneficial:
Since you have no control over the overall process (i.e. the whole application), but you do have control over this particular aspect, you could design this to programatically create a local database (if it hasn't been created already), create a table in that database and link it into your program. This prep code would only be executed once per client.
This way, you could still base the report off a table stored on the user's local machine.
-Dennis Borg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ummm, if there isn't a field that dups to header on, create a BS one in the source query with a value of 1 or whatever.
You'll have to play with page breaks and such too.
You'll have to play with page breaks and such too.
perove,
It is possible to do this using MoveLayout along with a group footer turned on. I'm sorry I haven't gotten back to this sooner, but I've suddenly gotten busy.
At a quick glance it looks like dill has given you a solution along the same lines. But I don't think it will work. The problem is is that you need to space down *after* the last record is printed. So setting NextRecord false won't give you the last record until the bottom of the page. Anyway, try it out and if it doesn't work get back to me. I'll work up an example.
Basically, the technique is to turn on group header/footer and in the format event of the footer, determine if the last customer has printed. If so, space down the page. This is based on a MSKB article on how to place a Group footer at a specific point on a page. Probably could do the same thing with the page footer.
Jim.
It is possible to do this using MoveLayout along with a group footer turned on. I'm sorry I haven't gotten back to this sooner, but I've suddenly gotten busy.
At a quick glance it looks like dill has given you a solution along the same lines. But I don't think it will work. The problem is is that you need to space down *after* the last record is printed. So setting NextRecord false won't give you the last record until the bottom of the page. Anyway, try it out and if it doesn't work get back to me. I'll work up an example.
Basically, the technique is to turn on group header/footer and in the format event of the footer, determine if the last customer has printed. If so, space down the page. This is based on a MSKB article on how to place a Group footer at a specific point on a page. Probably could do the same thing with the page footer.
Jim.
ASKER
Thanks people,
will try dill's suggestion, give me a few days
perove
will try dill's suggestion, give me a few days
perove
ASKER
Well, it has got more then "a few days", sorry.
I hane not tested this yet, my boss asigned me to another project.
Plaese be patient with me...
thanks
perove
I hane not tested this yet, my boss asigned me to another project.
Plaese be patient with me...
thanks
perove
Thank you for taking the time to give us an update, perove. :-)
ASKER
Took som time to get back to you people but here is my solution.
Here how i did it:
Option Compare Database
Dim totcount As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
totcount = totcount + 1
If totcount < 10 Then
Me.PageBreak6.Visible = False
Else
Me.PageBreak6.Visible = True
End If
End Sub
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If totcount < 10 Then
totcount = totcount + 1
Me.NextRecord = False
Else
totcount = totcount + 1
Me.NextRecord = True
End If
End Sub
Private Sub PageFooterSection_Format(C ancel As Integer, FormatCount As Integer)
totcount = 0
End Sub
I have no grouping in my recordsource, but I have a column which have the same value for all records. I have a groiup footer on thhis column. In this section I have all the lines etc. the same way I have in my detail section. So I just repeat this section for 10-("number of records already on page")
Simple is beutiful!
Thats all there is to it. Anybody want a sample let me know your email. I will be leaving for holyday (mauritsius!!!! ..leaving snowy norway to a couple of weeks) tomorrow, but will check in on the tread when I get back.
Thanks 2 all for the input, I credit dill's suggestion, cause it gave me the most clues.
regards from a "holyday ready" perove
Here how i did it:
Option Compare Database
Dim totcount As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
totcount = totcount + 1
If totcount < 10 Then
Me.PageBreak6.Visible = False
Else
Me.PageBreak6.Visible = True
End If
End Sub
Private Sub GroupFooter1_Format(Cancel
If totcount < 10 Then
totcount = totcount + 1
Me.NextRecord = False
Else
totcount = totcount + 1
Me.NextRecord = True
End If
End Sub
Private Sub PageFooterSection_Format(C
totcount = 0
End Sub
I have no grouping in my recordsource, but I have a column which have the same value for all records. I have a groiup footer on thhis column. In this section I have all the lines etc. the same way I have in my detail section. So I just repeat this section for 10-("number of records already on page")
Simple is beutiful!
Thats all there is to it. Anybody want a sample let me know your email. I will be leaving for holyday (mauritsius!!!! ..leaving snowy norway to a couple of weeks) tomorrow, but will check in on the tread when I get back.
Thanks 2 all for the input, I credit dill's suggestion, cause it gave me the most clues.
regards from a "holyday ready" perove
perove
I have been experiancing a similar problem, I however have a report were the size of the detail section varies between records..
Hence unlike your DB, mine would not always have 10 records on each page. It may only have one or two depending on the amount of data.
To get to my question, I want to fill in below the last record of each page with one large (or small) blank record. My goal is to have a box if you like right around the page (includeing the edges below the last record on each page.)
ie
________
|Header|
________
|Detail 1|
_________
|Detail 2|
__________
|Detail 3|
__________
|Blank space|
__________
|Footer|
________
Thanks in advance..
Ken
I have been experiancing a similar problem, I however have a report were the size of the detail section varies between records..
Hence unlike your DB, mine would not always have 10 records on each page. It may only have one or two depending on the amount of data.
To get to my question, I want to fill in below the last record of each page with one large (or small) blank record. My goal is to have a box if you like right around the page (includeing the edges below the last record on each page.)
ie
________
|Header|
________
|Detail 1|
_________
|Detail 2|
__________
|Detail 3|
__________
|Blank space|
__________
|Footer|
________
Thanks in advance..
Ken
Hi Ken,
This question is "closed" and from 2001, thus any response not guaranteed.
Perhaps better to post your question as a new question in this topic area and I'm sure the access experts will help you.
Nic;o)
This question is "closed" and from 2001, thus any response not guaranteed.
Perhaps better to post your question as a new question in this topic area and I'm sure the access experts will help you.
Nic;o)
For having always at least 25 lines I would probably also make sure in the query that the reports gets them.
Under what condition do you need to have the 35 ?
Nic;o)