Vertical lines changing

  • Thread starter Thread starter NevilleT
  • Start date Start date
N

NevilleT

I have a report with some vertical lines. It is a Gantt Chart with variable
timescales so the lines need to be constructed at runtime based on a form
parameters.

The lines draw in the place they should however some only appear for some of
the records. The lines are OK from the top of the page but it looks like a
ragged comb. Even more weird is that by clicking on the report to zoom, some
lines appear and some others disappear. It seems random. Occasionally all
appear.

Without getting too far into the variables, I am using

For intCounter = 1 To lngTemp
Me.Line (funCmToTwips(dblOffset + ((intCounter - 1) * dblLabelWidth)),
0)-(funCmToTwips(dblOffset + ((intCounter - 1) * dblLabelWidth)), 14400)
Next

I have a simple function called funCmToTwips that converts cms to twips.
 
NevilleT said:
I have a report with some vertical lines. It is a Gantt Chart with variable
timescales so the lines need to be constructed at runtime based on a form
parameters.

The lines draw in the place they should however some only appear for some of
the records. The lines are OK from the top of the page but it looks like a
ragged comb. Even more weird is that by clicking on the report to zoom, some
lines appear and some others disappear. It seems random. Occasionally all
appear.

Without getting too far into the variables, I am using

For intCounter = 1 To lngTemp
Me.Line (funCmToTwips(dblOffset + ((intCounter - 1) * dblLabelWidth)),
0)-(funCmToTwips(dblOffset + ((intCounter - 1) * dblLabelWidth)), 14400)
Next

I have a simple function called funCmToTwips that converts cms to twips.


That might be resolution issue. Try making the lines
thicker:
Me.DrawWith = 3
For ...

Think about using the Step option so you don't have to
repeat the offset expression.
 
Tried DrawWidth but no change. Still missing some lines. The offset thing
is part of the calculation of the left alignment. dblOffset is the width of
the task name and dates in the Gantt Chart dblLabelWidth is the distance
between lines. lngTemp is the number of lines.
 
Where do you have the code to draw the lines? I was
assuming it was in the detail section's Print event
procedure (I think it would also work in the detail
section's Format event, but I'm not 100% sure about can grow
situations). If you have it somewhere else, then I need
more details about where it is and how that event relates to
the data values.

The fact that you said the lines can come and go with
different zoom factors really indicates that it is a
resolution issue. I thought DrawWidth of 3 would be
sufficient, but maybe you need to go a little higher. It's
also possible that there is another issue clouding the
picture, but I don't have enough info to have a clue if that
is true or not and if it is true what the issue might be.

I understand what the offset calculation is doing. What I
was suggesting is that this would be shorter:

Me.Line (funCmToTwips(dblOffset + ((intCounter - 1) *
dblLabelWidth)), 0)-Step(0, 14400)
 
Hi Marshall

I already tried 5 but no success. The code is in the format event. Thanks
for the comments on offset. The first few rows seem to be fine, then blocks
of lines have different heights.
If you can imagine it looks like this (joined up of course)
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | |
| | | | | |
| | |

When you zoom it might change to
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | |
| | | | | |
| | | | | |


Marshall Barton said:
Where do you have the code to draw the lines? I was
assuming it was in the detail section's Print event
procedure (I think it would also work in the detail
section's Format event, but I'm not 100% sure about can grow
situations). If you have it somewhere else, then I need
more details about where it is and how that event relates to
the data values.

The fact that you said the lines can come and go with
different zoom factors really indicates that it is a
resolution issue. I thought DrawWidth of 3 would be
sufficient, but maybe you need to go a little higher. It's
also possible that there is another issue clouding the
picture, but I don't have enough info to have a clue if that
is true or not and if it is true what the issue might be.

I understand what the offset calculation is doing. What I
was suggesting is that this would be shorter:

Me.Line (funCmToTwips(dblOffset + ((intCounter - 1) *
dblLabelWidth)), 0)-Step(0, 14400)
--
Marsh
MVP [MS Access]


Tried DrawWidth but no change. Still missing some lines. The offset thing
is part of the calculation of the left alignment. dblOffset is the width of
the task name and dates in the Gantt Chart dblLabelWidth is the distance
between lines. lngTemp is the number of lines.
 
Since zooming the report has no interaction with the report,
it can not affect how the lines are drawn. The lines coming
and going is strictly related to the resolution of your
monitor and rounding the positions/thickness of the line
while rendering the display.

I tried to do something similar to what you are doing and
did not have a problem, but I did notice that I had to set
DrawWidth to a substantially larger number to get a clearly
noticible effect. Try setting DrawWidth to 30 to see if it
affects the number of lines you can see.

Note: You can also get a similar effect when you print the
report. Different printers can have different resolutions
that will have different rounding so the thin lines may
appear or not appear differently on different printers and
be different from what you are seeing in print preview. To
confuse things further, the issue may or may not be limited
to the display/printer hardware, the drivers can also be a
major player in this melee. Try printing the report to see
how it looks on paper.
 
Thanks Marshall. That worked. I tried 30 and it all displayed. Found that
10 was the minimum to get them all displaying. Next problem is how to bring
the line to the front. Will be working on that issue today.

Thanks again for your help.

Marshall Barton said:
Since zooming the report has no interaction with the report,
it can not affect how the lines are drawn. The lines coming
and going is strictly related to the resolution of your
monitor and rounding the positions/thickness of the line
while rendering the display.

I tried to do something similar to what you are doing and
did not have a problem, but I did notice that I had to set
DrawWidth to a substantially larger number to get a clearly
noticible effect. Try setting DrawWidth to 30 to see if it
affects the number of lines you can see.

Note: You can also get a similar effect when you print the
report. Different printers can have different resolutions
that will have different rounding so the thin lines may
appear or not appear differently on different printers and
be different from what you are seeing in print preview. To
confuse things further, the issue may or may not be limited
to the display/printer hardware, the drivers can also be a
major player in this melee. Try printing the report to see
how it looks on paper.
--
Marsh
MVP [MS Access]

I already tried 5 but no success. The code is in the format event. Thanks
for the comments on offset. The first few rows seem to be fine, then blocks
of lines have different heights.
If you can imagine it looks like this (joined up of course)
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | |
| | | | | |
| | |

When you zoom it might change to
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | |
| | | | | |
| | | | | |
 
NevilleT said:
Thanks Marshall. That worked. I tried 30 and it all displayed. Found that
10 was the minimum to get them all displaying. Next problem is how to bring
the line to the front. Will be working on that issue today.


What do you mean by "bring the line to the front"?

The Line method normally draws on top of text box controls,
so I can not imagine the issue.
 
Back
Top