pdf in Report (1 Viewer)

SAE

Registered User
Joined
Mar 1, 2018
Messages
21
I have a DB where i have a list of clients and links (via a hyperlink field) to various documents they have sent us.

What i am trying to do i run some filters to filter the documents and then run a report that lists the various clients and the pdfs (usually letters) they have sent us.

Query and filters work fine but I have hit a brick wall when it comes to running a report that shows the pdfs.

Is this at all possible? I have been searching the web for a couple of days and can't find a way to do it. Most responses regard to displaying a pdf in a sub-form on a form, but I need the option to filter and include them in a report.

Note for my queries and filters I could end up with 50-100 pdfs so having to manually filter and group them isn't my preferred route.


TIA,


Simon
 

JHB

Have been here a while
Joined
Jun 17, 2012
Messages
7,720
Do you want to show the content of the pdf files, or to include the pdf files, in the report?
 

SAE

Registered User
Joined
Mar 1, 2018
Messages
21
not sure the difference. between showing the pdf and including the pdf.

I want a report that says Client A, and then has 3 letters following it. Client B then 2 letters following it.

I want to show the contents of the subsequent pdfs and not just a list of names or their link reference.

Hope this clears it up.

Thx,


SAE
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,578
If you are just looking to list the reports they have sent then you can use a Main Report|Subreport scenario.

Main Report - Include ClientID
Subreport - Include the query that lists the documents and the ClientID

Make the Main report and the subreport , save and then drop the subreport on the main report. They should automatically connect based on the ClientID. Then make it look presentable.
 

Mark_

Longboard on the internet
Joined
Sep 12, 2017
Messages
2,112
SAE,

Are you trying to, effectively, have the contents of the various PDFs appended one after the other in some type of display that can also print? Or do you simply want a header list that can open each PDF when clicked upon? Also does this need to be something you can send to others?
 

SAE

Registered User
Joined
Mar 1, 2018
Messages
21
SAE,

Are you trying to, effectively, have the contents of the various PDFs appended one after the other in some type of display that can also print? Or do you simply want a header list that can open each PDF when clicked upon? Also does this need to be something you can send to others?


Yes, this needs to be something I print out, so having a link that I click on isn't an option.

As you said, I need a header followed by subsequent pdfs, then another header, then more pdfs.

Also, I thought reports weren't interactive so I couldn't put an active link in a report anyway.
 

SAE

Registered User
Joined
Mar 1, 2018
Messages
21
If you are just looking to list the reports they have sent then you can use a Main Report|Subreport scenario.

Main Report - Include ClientID
Subreport - Include the query that lists the documents and the ClientID

Make the Main report and the subreport , save and then drop the subreport on the main report. They should automatically connect based on the ClientID. Then make it look presentable.

Gina, I don't just want a list of document, I want to actually display the documents.

The report is set up as you describe with a sub report linked to the main report via ID_Client field. In my subreport I have a hyperlink field with the link datafield as the Control Source. But all this shows in a list of hyperlinks, not the actual documents.

Is there another field type that can show the actual pdf and not just its path ???

Thanks,


SAE
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,578
I realized that after I read your reply to Mark. The only that comes to mind, short of turning them into images, is an OLE Object. I have never done that and not sure how well it work.
 

SAE

Registered User
Joined
Mar 1, 2018
Messages
21
I realized that after I read your reply to Mark. The only that comes to mind, short of turning them into images, is an OLE Object. I have never done that and not sure how well it work.

That's pretty much the route I am about to try. I just need people to get out of the BE so I can add an OLE field to the table. I'll then try with either pdf or scan some docs to jpg and see how that goes.
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,578
I would suggest you make a copy of the backend and TEST first. Do not attempt this on a live backend. If it works great then you can implement but if it doesn't you didn't inconvenience anyone.
 

JHB

Have been here a while
Joined
Jun 17, 2012
Messages
7,720
Only a thought, can not you convert it all into one pdf file per client?
Ie. Your output per. client from the database is converted to a pdf file, after which you merge the corresponding pdf files per. client.
As mention, only a thought. :)
 

Mark_

Longboard on the internet
Joined
Sep 12, 2017
Messages
2,112
From your description, putting the files into your back end isn't going to help.

I'm not sure exactly how to do it, but you really want a display on each subreport that displays the contents of each PDF. As a PDF can be multiple pages and be sized for different paper, not exactly sure if this is what you are trying for or not.

Which version of ACCESS are you using?

NOTE: There is an alternate approach for generating a paper report that may do what you wish; create a loop that calls your "Header" as a report that is automatically sent to a printer. Then loop through the child records (links to PDFs) and automatically send them to the same printer in sequence. I'm not sure if this can be pulled off in ACCESS without a dialog popping up along the way though. Only time I've had to do this I was doing it through crystal reports using their API, and that was a long time ago.
 

Mark_

Longboard on the internet
Joined
Sep 12, 2017
Messages
2,112
Simon,

Can you get the documents in a format other than PDF? Or is it an option to use a command line converter to make non-PDF copies for printing?

In a report you can't easily change a displayed PDF, but an image control showing a JPG can easily change to show something else. If you have single page PDFs you should be able to have a command line converter make image copies of each for printing purposes. Then you would have a header record that lists who the pages are for, one subreport that lists your index of documents, then another that prints the image files for each document.

The other alternative is to write a loop that goes through your dataset. Your loop would call the "header report" first for each "parent record" (and gives you a list of documents that will follow) then get a recordset for all child documents. For each child record, you will want to send it to the printer. I'd write a function that can be passed the full path to the PDF and the printer you want it printed on. How you write the function depends on which version of access/adobe you have and what it supports. The goal here would be to create an instance of adobe first, use that instance to print all of the documents, then end that instance so adobe doesn't remain in memory.

Using adobe to do the printing will definitely give a better printed result, but depending on your needs using image files may be a better/easier option.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom