"Reports" - printing our own in X#

Public forum to share code snippets, screen shorts, experiences, etc.
Post Reply
User avatar
Phil Hepburn
Posts: 743
Joined: Sun Sep 11, 2016 2:16 pm

"Reports" - printing our own in X#

Post by Phil Hepburn »

Hi X# guys,

I have posted this to ask for your help, and guidance, over the matter of printing reports. Although I did a lot with VO and VN with printed output, I never used a third party report generator. I did all my own printing of the format required by my two big (main) customers. We printed millions of customer and doctors letters, despatch notes, and invoices etc., over the years. Our internal reports were only good enough for company use.

Last evening I rescued my old .NET "TestBed - printing" app and got it to work. It is designed to help guys get to use my printing class and all its various methods. Well, "Printing Class" has actually become "Document Class".

Here below is a couple of sample screen outputs - the following two images are captured as the "TestBed" was executing :-
Printing_13.jpg
Printing_13.jpg (59.19 KiB) Viewed 138 times
The code behind the test buttons (on the LHS) contains the necessary detail to make the printed output shown on the "Print Preview" object surface. Above are some fun bits using the printer class members - these are necessary to build / output more complex reports / documents.

Below is a more serious attempt at printing a data filled invoice 'blank' :-
Printing_14.jpg
Printing_14.jpg (86.37 KiB) Viewed 138 times
I have all the code for the "TestBed" and the test documents A through F.

However, I have not as yet found my code which generated the following report style, even though it uses the very same methods from the Printer / Document class I have built up. Check this out below :-
Printing_12.jpg
Printing_12.jpg (172.73 KiB) Viewed 138 times
Yes, a very different format to the previous two printed pages.

Now then, how can you help me, well the report style above seems to have gone missing and so I would like to make a new Class and/or Methods which would generate something similar in a modern way, with X# dotNET.

I would like to use a 'Collection' of business objects to generate the report, say for example a collection of 'Customers', or 'Product Details'.

It may be that at first a 'DataTable' is more convenient, even though it is older technology.

Do I keep the column headers with the data, or do I have separate objects for row data and header details with column specifications - for width, font size, position formatting, etc., etc..

I would plan to have the report generator work as much by default values as possible - so its an easy start for most guys ........

How often do we need to sum to totals horizontally and/or vertically. Obviously a choice of Landscape and Portrait is also necessary.

Please can you give me the benefit of your reporting experience - and remember, because I am doing all this printing 'stuff' with my own X# code, we should be able to do anything that makes sense, even if it is complex, or even complicated.

May be a good idea to start out simply however. I would also add a couple of buttons extra to show the sample report(s).

Don't forget, telling me what to do and what is nice is one aspect, BUT letting me know what NOT to do is just as important, or even more so.

HELP !!!

TIA,
Phil.
Wales, UK.
Post Reply