sbPrinter - Report Printing

I have been working on a generic printing routine that works in code. I released a couple of weeks ago sabPrint here and it got some good general comments and a number of suggestions for improvement.

I have taken that idea and created my generic printing class, sbPrinter. I am releasing it free of charge to the community.

You can download it here:

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/sbPrinter.zip

This is a working project. You should be able to pick out of it all the main components.

Supports multi-columns, multi-line, graphics in a cell etc.

As usual, please give comments (good and bad) and any enhancement requests. If you modify it for the good, please share.

Thanks to all.

Simon.

Latest version now available.

This version includes the ability to print dotted, dashed, dash-dot lines.

Simon.

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/sbPrinter.zip

Latest version now available.

Simon.

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/sbPrinter.zip

Latest version now available.

This version now has the ability to justify text in a cell.

r.CellText(r.LastIndex, 2) = "this is long text to see the justification applied to it." r.CellJustify(r.LastIndex, 2) = True

Simon.

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/sbPrinter.zip

Nice work, Simon.
You should add a Note to your classes in which you explain who it’s from and what your conditions for using it are.
A link to a website (at least, simply link to this thread) would be good, too. Or include your email address.
All this becomes important once someone incorporates your classes into his own project, because then all your names and refs from your demo window code won’t be with it any more.

[quote=194506:@Thomas Tempelmann]Nice work, Simon.
You should add a Note to your classes in which you explain who it’s from and what your conditions for using it are.
A link to a website (at least, simply link to this thread) would be good, too. Or include your email address.
All this becomes important once someone incorporates your classes into his own project, because then all your names and refs from your demo window code won’t be with it any more.[/quote]
Thank you for your advice, Thomas.

I create these classes for fun and am not looking for anything for them but I do understand why you have made these comments. I will repackage the download.

Simon.

Thanks, Simon. I am going to use your code in an app I’ll probably use commercially. I’ll make sure you’ll get something back for it when it’s done.

Thank you, Thomas.

Very much appreciated.

Simon.

[quote=185188:@Simon Berridge]I have been working on a generic printing routine that works in code. I released a couple of weeks ago sabPrint here and it got some good general comments and a number of suggestions for improvement.

I have taken that idea and created my generic printing class, sbPrinter. I am releasing it free of charge to the community.

You can download it here:

https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/sbPrinter.zip

This is a working project. You should be able to pick out of it all the main components.

Supports multi-columns, multi-line, graphics in a cell etc.

As usual, please give comments (good and bad) and any enhancement requests. If you modify it for the good, please share.

Thanks to all.

Simon.[/quote]

How did You Convert Images to String? like the Gears or Teddy

ALso I dunno,how the background is pink

I have made an app that will do this for you as well as making a whole bunch of graphics pictures into strings inside a module that you can just drag into your project.

Download from here:
https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePictures.pkg

[quote=199294:@Simon Berridge]I have made an app that will do this for you as well as making a whole bunch of graphics pictures into strings inside a module that you can just drag into your project.

Download from here:
https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePictures.pkg[/quote]
Thanks Simon. I’m already having troubles with colors, When I say:

f.TextColor = colRed (Previously declared as a Color Constant) it Prints me on blue.
Also I tried with f.TextColor = RGB(255,255,255) and I get no color

What Am I doing wrong?

Ok I solve it, Its Curious and dunno why, I experimented this color issues in another project.
When I use Hexadecimal colors, It shows distorted, But when I use RGB (0,0,0) it shows correctly!

Ex. If I wanna get red color: RGB(255,0,0)

Now I wanna Ask you,How did you get the text in Bold?

And How did you reduce the space between the Table header and the Table?

Set all font attributes with the font variable (f in my test project) then call SetFont(f).

The call to SetFont must be before you actually set any text!

[quote=199470:@Simon Berridge]Set all font attributes with the font variable (f in my test project) then call SetFont(f).

The call to SetFont must be before you actually set any text![/quote]
Perfect, It WorkS Thanks man!!

How did you use sbMargins? Or how can I modify the Margins of the Document?

Margins are set in the Constructor when you instantiate the class.

If you need to change the margins during the reporting I would construct a new table and not fill the left and/or right column. That way will give the impression that you have changed the margins but actually have not.

[quote=200309:@Simon Berridge]Margins are set in the Constructor when you instantiate the class.

If you need to change the margins during the reporting I would construct a new table and not fill the left and/or right column. That way will give the impression that you have changed the margins but actually have not.[/quote]
Thanks

Hey Simon, I have one more question. Will it works on Windows or only works on Mac?

Cuz I tried to use it on Windows and get and Alpha Error Channel GDI. and sends a blank page to print.

Regards and thanks