Resizing Report in Dialog Mode (1 Viewer)

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Experts,

I have a report that I open in acViewReport, acDialog mode. I am attempting to resize the report dialog so that the user press a button that takes a screen shot of the report and pastes it in an email. For reasons more complicated than I have time to explain here, SendObject isn't an option for this report.

Below is the code in the "On Open" event of my report. I have to set focus because there is another form open behind the report when the user clicks a menu button to launch the report. This does successfully open and resize the window, but I am only getting partial rendering of the report; my unbound text fields appear with data in them, but my labels and buttons do not appear. Is there any obvious reason for this? :banghead:

Code:
DoCmd.SelectObject acReport, "rptCapitol", False
DoCmd.MoveSize , , , 20000
 

RuralGuy

AWF VIP
Local time
Today, 07:19
Joined
Jul 2, 2005
Messages
13,826
You might try a DoEvents to give the rendering engine some cpu time.
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Forgive my ignorance, but what would that look like, and where in the code should it take place? I appreciate your time :)
 

RuralGuy

AWF VIP
Local time
Today, 07:19
Joined
Jul 2, 2005
Messages
13,826
That's easy!:
Code:
DoCmd.SelectObject acReport, "rptCapitol", False
DoCmd.MoveSize , , , 20000
DoEvents
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Thank you so kindly, but this doesn't seem to have made any difference. To help illustrate what's happening, I've included two screen shots, one with the MoveSize code and one without. This may help you see what's missing when the report renders :)
 

Attachments

  • WithMoveSize.jpg
    WithMoveSize.jpg
    52.2 KB · Views: 98
  • WithoutMoveSize.jpg
    WithoutMoveSize.jpg
    63.9 KB · Views: 84

isladogs

MVP / VIP
Local time
Today, 13:19
Joined
Jan 14, 2017
Messages
18,186
@sherlocked

Not quite the same as you are doing but I wasted a long time trying to set up sending automatic emails with a screengrab of the message box when program errors occur. I never did get it to work well

I then tried replacing the MsgBox with a form and saving that as an image Still no luck in getting everything to show in the attached image.

I hope you have more luck than I did
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:19
Joined
Feb 19, 2013
Messages
16,555
rather than using movesize, use move

in the report open event

me.move me.left, me.top. me.width, 20000
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Thank you so much, but this still is not working. The report opens, data appears in my text fields, but the rest of the information is missing.

Any other ideas?
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Sorry, missed that question. This code is in the On Open event.

Thanks :)
 

RuralGuy

AWF VIP
Local time
Today, 07:19
Joined
Jul 2, 2005
Messages
13,826
Thanks! There are now some very bright helpers looking at this issue.
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
Testing some more, I found that if I put the Move Size event On_Load it is actually making the report longer, but not the dialog window the report is appearing in. That's really what I need to have larger, so that the screen shot captures all data. Any ideas how this can be accomplished?
 

RuralGuy

AWF VIP
Local time
Today, 07:19
Joined
Jul 2, 2005
Messages
13,826
What happens if you open the report NOT in dialog view?
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
The same thing. The report is longer, yes, but I still need to scroll down to view all the data, and this is what I have to avoid if the user is to be able to click a button to screen print the report and paste it into an email body.
 

isladogs

MVP / VIP
Local time
Today, 13:19
Joined
Jan 14, 2017
Messages
18,186
Could you modify the layout so it fits on 2 pages & also change the default view to 2 pages so it all fits on the screen?

Alternatively why not save the report as a PDF and email it as an attachment
 

RuralGuy

AWF VIP
Local time
Today, 07:19
Joined
Jul 2, 2005
Messages
13,826
How about creating a pdf and attaching it to an email?
 

sherlocked

Registered User.
Local time
Today, 06:19
Joined
Sep 22, 2014
Messages
125
I was not able to find a satisfactory solution, so I wound up just squishing up all my report fields so that they appear on one page. This was a non-elegant but functional solution.

Best of luck to anyone in the future Googling this issue, hope you are able to find a way to accomplish this that I wasn't! :D
 

Users who are viewing this thread

Top Bottom