Jump to content
Jeff Steinkamp

Print TDBGrid

Recommended Posts

The community version of Delphi 11 does not contain any Reporting Components and I'm not going to spend a boatload of money for a component that I will rarely use. 

 

Can someone point me in the direction to help me devise a quick and easy way to send the data I have in a DBGrid to a printed output.   I do have a couple of PDF components that should do this, PowerPDF and Winsodt's TPDF, but I am unbale to find much in the way of basic documentations for either of these components.

 

Any hep will be much appreciated.

Share this post


Link to post
Posted (edited)

Hi...😎

Quote

The community version of Delphi 11 does not contain any Reporting Components

...wrong. 😉 FastReport Delphi Edition...

 

The right way:

1. use a reporting tool (print, export, preview)

2. do not print the visual component (TDBGrid) ... print the data in the dataset

3. design the report

4. finish...😛

FastReport videos (VCL):

https://www.youtube.com/watch?v=H6ntcbqF0MU

https://www.youtube.com/@FastReportsAcademy

 

Quote

quick and easy way

...nothing is quick and easy. 🙄 You have to learn something new every day.

Edited by haentschman

Share this post


Link to post

So you are looking for a certain kind of poor man's PrintDAT! in order to provide list-reporting, list-printing or formatted list-printing. The situation is similar to poor man's partitioning on Oracle. It works well, but it's work and to a certain degree more in both cases.

 

Take the data from the dataset, use the TPrinter's canvas in order to format the document, print the result to a PDF printer installed into the OS for example. I'd not bother with 'arguments' /thoughts like 'What if there is no such printer installed'. A computer cannot boot to no OS installed, so a program can fairly print to no appropriate printer installed.

 

-

 

In case of designing real reports and passing data from a Delphi data source the story is a different one. Fast Report does integrate into Delphi and not the other way around.

 

-

 

Indeed I'm more infrastructure focused rather than a fan of application centric doing things, that can/should be done another way. An application should not handle the transfer of messages for example, it should just send it. It's just in the early beginning or in case no reliable (messaging) infrastructure can be found or set up. Users tend to get used to this situation.

 

I mentioned messaging just because it's a prominent example or the most prominent one.

Share this post


Link to post
9 hours ago, haentschman said:

Hi...😎

...wrong. 😉 FastReport Delphi Edition...

 

The right way:

1. use a reporting tool (print, export, preview)

2. do not print the visual component (TDBGrid) ... print the data in the dataset

3. design the report

4. finish...😛

FastReport videos (VCL):

https://www.youtube.com/watch?v=H6ntcbqF0MU

https://www.youtube.com/@FastReportsAcademy

 

...nothing is quick and easy. 🙄 You have to learn something new every day.

Where is it??  I do not find any component called Fast Reports and based on the vidoes, I do not find any actual program on my computer called FastReports.

Share this post


Link to post
4 minutes ago, Jeff Steinkamp said:

Where is it??  I do not find any component called Fast Reports and based on the vidoes, I do not find any actual program on my computer called FastReports. 

If you have the community edition, FastReport component is not available. Six years ago (2018) there was an edition of FastReport for CE, but now you must buy it.

 

I never used PowerPdf.

Share this post


Link to post
On 2/29/2024 at 1:18 PM, Jeff Steinkamp said:

Can someone point me in the direction to help me devise a quick and easy way to send the data I have in a DBGrid to a printed output.   I do have a couple of PDF components that should do this, PowerPDF and Winsodt's TPDF, but I am unbale to find much in the way of basic documentations for either of these components.

I found FortesReport Community Edition on GitHub. The only documentation that I saw is in the source code and is in Portuguese. 

 

Or you could roll-your-own. There is some example code in this StackOverflow answer: https://stackoverflow.com/questions/7496813/print-a-tdbgrid/7500147#7500147

Share this post


Link to post
Posted (edited)
Quote

Six years ago (2018) there was an edition of FastReport for CE, but now you must buy it.

...sorry, it is new for me. :classic_wacko:

image.thumb.png.b859297c70482215fcb1a4a534f198b9.png

Edited by haentschman

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×