Sunday 29 April 2012

Getting it all on (virtual) paper

At the moment our trading record is presented in what might best be described as a utilitarian format, so the next, and last, task for this stage of our trading database development is to get the data into a format which makes reading it and drawing conclusions from it more intuitive and visually pleasing. As you would probably expect by now this is not incredibly difficult due to the highly graphical nature of Access.

Ensuring that 'qryTradesBySport' is highlighted (but not opened) in the All Objects navigation  panel, select the Create ribbon, and 'Report Wizard'. The dialog box that pops up lists the fields in the query. We will use all of them so you could just click the '>>' button and have all the fields move over onto the right side of the screen. The problem with so doing, and why I would recommend selecting the fields one at a time, is that the report will then display the fields in the order they appear from top to bottom. You could sort them, but if you select them one at a time it's easier to control the order in which they appear on the finished page.

To my mind the best way to display the query is with the games traded, followed by the stake information, the P/L information and then ROI and Strike Rate - all grouped by Sport - but arrange it as you see fit. When you have selected all fields and ordered them as you want them to appear click next - you will be asked if you want to group the records. The answer, of course, is that we do - by Sport. After selecting Sport as the group you should then be looking as something similar to this:

Clicking next brings you to the Sort screen - assuming you remembered to sort alphabetically by Sport when designing your query I'd ignore this screen  and click next. The next dialog determines how you want the layout to appear. Keep the default 'Stepped' on the left options group but change the right one from Portrait to Landscape. You are then asked which Style you would like - I just accept the default 'Office' style.

The next screen asks you for a name for your report, which will also appear as the report's title, so type one in and then select 'Preview' and click 'Finish'. This action causes the report to run, and as it's information is displayed via a paramaterised query you will be asked to provide the 'From' and 'To' dates. Following a brief pause whilst Access generates the report you will see something like this:


Now we're getting somewhere! There's work to be done still, but at least you can now start really to see the fruits of all the labour so far!

Arranging the display of the report is best done in 'Layout' view. Happily this view is quite easy to use, and unlike with the form layout view the boxes don't all contract and expand to the same degree as you adjust one.

I'm not going to go into detail about how to adjust your report. Play around with it, switching between 'Layout' and 'Report' view to assess your changes. Have a look at the long list of properties you can change on the property sheet - most are fairly intuitive - 'Text Align' for example allows you to choose to have the text left aligned, centred or right aligned among others. I learnt how to do this largely by trial and error - trust me  - it's the best way!

You can then repeat the above exercise on the 'qrySportsByStrat' query - and that will conclude the detailed 'how to' for this stage of the trading database.  I trust you have found it useful.

No comments:

Post a Comment