• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1574
  • Last Modified:

Display arrows or lines in different positions on a MS Access 2010 report

How do you draw diagonal, horizontal or vertical arrows or lines on an MS Access 2010 report.  The arrows or lines need to go from one symbol to another symbol.  

The symbol is in the detail section of the report and its horizontal position is determined by code.  So each symbol is shown in a different position for each record. The symbols represents events on a annual timeline and the arrows or lines indicate a dependency between the symbols.
0
CertifiedP
Asked:
CertifiedP
  • 7
  • 7
1 Solution
 
IrogSintaCommented:
You would need to manipulate the Top, Left, Height, and Width properties of the line by code as well.  For example, here's how you would create a horizontal line between 2 symbols:
Me.Line1.Height = 0
Me.Line1.Top = Me.Symbol1.Top + (Me.Symbol1.Height / 2)
Me.Line1.Left = Me.Symbol1.Left + Me.Symbol1.Width
Me.Line1.Width = Me.Symbol2.Left - (Me.Symbol1.Left + Me.Symbol1.Width)

Open in new window

0
 
CertifiedPAuthor Commented:
Thanks for the feedback.

I've just reviewed your code. However, only one symbol exists in the detail section of the report.  Therefore, Symbol2 does not exist.  The positioning of each symbol is determined for each record, based on the report's record source details.

In addition, the line(s) may need to be drawn to symbols that are not necessarily the next record in the reports record source.  That is, they may be drawn to any on the symbols.
0
 
IrogSintaCommented:
I don't quite follow. Can you post a screenshot?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
CertifiedPAuthor Commented:
Can't show screenshot as it's on another PC that's unavailable at the moment. However, consider the following:

JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
                              *
                                                 *
                                                                            *
       
            *


The 1st symbol(in Apr), for example, might depend on the event represented by the 4th symbol(in Feb).  So there should be a line from the 1st to the 4th symbol.  

When the report is run it positions each symbol in order, i.e. 1st, 2nd, 3rd...because that the order they appear in the underlying recordset and the code knows where to place the symbols based on dates in the recordset.

Note: Although it looks like several symbols on the report.  It is the same symbol that is positioned as it goes through the records.  If you open the report in design view you will see one symbol.  This symbol is moved by the code for each record.
0
 
IrogSintaCommented:
Well there's the line method, but it won't work from one record to another.  The only way you would be able to use it is if you also position your symbols vertically by code instead of by each record.

http://msdn.microsoft.com/en-us/library/office/aa221362(v=office.11).aspx
0
 
CertifiedPAuthor Commented:
Thanks, I thought about your idea about positioning the symbols, and the timeline, vertically and switching the orientation of the page to portrait.  However, I don't believe this will work because it's not clear how to use the records in this context i.e. which section of the report would you place the symbols.  

I'm thinking about maybe generating an intermediary table with positional information for the symbols and lines and using this as the recordset for the report.  By generating an intermediary table the position of each symbol can be set and the coordinates of the lines can then be determined.  Just not sure how to calculate the position information for the lines so that the will connect to the dependent symbol. Appreciate the feedback.
0
 
IrogSintaCommented:
Regarding which section of the report to use if you do it by code, you could do it any section because the report will not have a Recordsource.  If however, you need a recordsource because there are fields there that you are using for the header or footer section, then you need to make sure that only one record is returned so that you can use your detail section for your symbol and line positioning via code.
0
 
CertifiedPAuthor Commented:
Unfortunately, more than one record is required because the data is used by the code to determine where to position symbols on the timeline.  This information would still be required even if the symbols where to be displayed vertically.
0
 
IrogSintaCommented:
I understand that.  What I meant was that your report will not be bound to a recordset wherein you would have a detail line showing for each record.   You would instead create a recordset via code to create your report (vertically and horizontally).  This would not be that simple but it is doable.
0
 
CertifiedPAuthor Commented:
Oh, I see what you mean using DAO (or whatever they're maybe calling it these days).  

Just thinking this through...so if I:
have data to identify a dependency;
increase the height of the detail section (maybe in code);
Iterate though the recordset (in code);
position each symbol vertically and horizontally;
drawn lines between symbols(may need to do in two passes)

What do you reckon?  If you agree I'll try it out a let you know.
0
 
IrogSintaCommented:
I think you've got the idea.  Let me know how it goes.
0
 
CertifiedPAuthor Commented:
It was not possible to do it based on the advice given.  However, I have a solution which uses straight lines rather than diagonals.  I'll give you the points due to your persistence in trying to help.
0
 
CertifiedPAuthor Commented:
Accepted on the basis that you tried to help.
0
 
IrogSintaCommented:
Thanks. Glad you got it working.
:-)
Ron
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now