Display report in 'Print Preview' mode inside form (1 Viewer)

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
This is a stretch... Can I display the a report in a subform control on a main form in 'print preview' mode?

I'm trying to display a realistic, document-like , preview of a report. Converting to a .PDF and serving that seems like an unnecessary step
and also a headache since Access makes it a challenge to display one of the most universal document types on the planet.

Ideas?
-Regards
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:37
Joined
Oct 29, 2018
Messages
21,467
Probably not. The next best thing, maybe, is to export the report into PDF and then display the PDF on the Form using a Browser Control.
 

mike60smart

Registered User.
Local time
Today, 10:37
Joined
Aug 6, 2017
Messages
1,904
Hi Why do you need a Report on a Data Input Form?
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
Displaying a PDF in a form is a real joy.

Web Browser control - simply wants to open it in Chrome. MS couldn't update the web browser control in the last 20 years and ditch IE. Glad it's million's of user's license fees are being put to good use. (y)(y)(y)

Using adobe reader - might as well spend the next year deciphering how to use their worthless Active X control. No property to even set a source doc to point it too. Why do I need third party anyway. Its a PDF! (n)(n)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:37
Joined
Oct 29, 2018
Messages
21,467
Displaying a PDF in a form is a real joy.

Web Browser control - simply wants to open it in Chrome. MS couldn't update the web browser control in the last 20 years and ditch IE. Glad it's million's of user's license fees are being put to good use. (y)(y)(y)

Using adobe reader - might as well spend the next year deciphering how to use their worthless Active X control. No property to even set a source doc to point it too. Why do I need third party anyway. Its a PDF! (n)(n)
Are you saying you couldn't make it work? (displaying a PDF file in a web browser control, that is)
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
Yes, on both accounts -

The browser control is trash. And by that, I mean it would rather download or open the file in chrome then even display it inside the control.
The form loads and a prompt displays for 'Open' or 'Save'. You know, that one from internet explorer back in like 2003.
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
....
 

Attachments

  • Screen Shot 2021-01-31 at 1.34.22 PM.png
    Screen Shot 2021-01-31 at 1.34.22 PM.png
    51.3 KB · Views: 393

theDBguy

I’m here to help
Staff member
Local time
Today, 02:37
Joined
Oct 29, 2018
Messages
21,467
Yes, on both accounts -

The browser control is trash. And by that, I mean it would rather download or open the file in chrome then even display it inside the control.
The form loads and a prompt displays for 'Open' or 'Save'. You know, that one from internet explorer back in like 2003.
Okay, interesting, thanks for the clarification. It's usually just a matter of Settings. Each environment is different, but I had no problems making it work on my computer before. I even posted a demo somewhere in the past. I'll have to see if I can find a link. If this is not possible anymore, my guess would be that this behavior was changed from the way it used to act before.
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,527
I think I am doing exactly that. I have a form with filter controls and displays the filtered report in print preview. Then I have export options. In fact this concept works so well I probably will incorporate in all dbs. The image shows after I verify the report and hit export to PDF.

Report.jpg
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
@MajP

OooOO that looks nice. But I am skepticial... Are you certain that subform control is actually displaying the report in 'Print Preview' and not in Report View?

I was unable to figure out how to get the subform control to display in Print Preview - even changing .DefaultView in the report itself didn't give me a solution.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,527
Yes not print preview. I think I just get lucky because these reports look similar in both views.
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
Yeah, my report doesn't look the same as it would in print preview, and that's what i'm trying to achieve.

I didn't think this was possible.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,527
Assuming you want a form similar to what I have with options to export and filter, could you just pop it open in its own window?
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
I have a form similar to what you have. but I want the subform that shows the report to be exactly as I would print it.

The only solution appears to be embedding a PDF in the form, which is a real PITA apparently.
 

isladogs

MVP / VIP
Local time
Today, 10:37
Joined
Jan 14, 2017
Messages
18,216
Whilst you can use a report as a subform (and a form as a subreport), doing so will not give you give the full functionality that the object has when opened on its own.
AFAIK, one of the limitations is that the subform report is only available in report view so that you cannot, for example, display multiple columns from the report when used in a subform.
 

ironfelix717

Registered User.
Local time
Today, 05:37
Joined
Sep 20, 2019
Messages
193
Somehow after the 100th try, I was able to get a browser control to display the PDF which is using Adobe Reader for IE.

My next step to complete this is to get details about the report's page size and size the control to an aspect that better fits the underlying report's page dimensions.

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:37
Joined
Oct 29, 2018
Messages
21,467
Somehow after the 100th try, I was able to get a browser control to display the PDF which is using Adobe Reader for IE.

My next step to complete this is to get details about the report's page size and size the control to an aspect that better fits the underlying report's page dimensions.

Thanks
Hi. Glad to hear you got it to work. It was taking a long time to find that link I promised, so I just decided to recreate the demo and was able to get the following result. Good luck with your project.

1612127047221.png
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,527
Somehow after the 100th try, I was able to get a browser control to display the PDF which is using Adobe Reader for IE.

My next step to complete this is to get details about the report's page size and size the control to an aspect that better fits the underlying report's page dimensions.
Can you post the working code or a demo?
 

Users who are viewing this thread

Top Bottom