Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Form print sizing problem

Status
Not open for further replies.

TinyNinja

Programmer
Oct 1, 2018
99
US
Hey community,

I need help with VFP Report Form page sizing.

Why is my report being cut off? I have tried everything to get it to print out the full 8in proper letter size.

This is the look of my form, I am trying to place a picture into every report that gets printed. The pictures below I am just running the preview option in the project area of the program. I don't have it fully running in the program live but I'm getting this same problem regardless of which way I run the report. I have set the printer to a real printer vs a PDF creator and haven't seen anything different happen.
Prob1_iumbi8.png

Set ReportBehavior 80 - allows the whole report to be created but no picture.
Prob2_sirhke.png

Set ReportBehavior 90 - cuts the print out in half and I don't a chance to see the picture. The picture might be present but I have no clue.
Prob3_rciukq.png

Current settings
Prob4_uoyxdm.png

The code I'm using in the code.
Prob5_lsa4vc.png
 
Hi TinyNinja

Did you check under "Page Setup ..." and choose the correct paper size?

Screenshot_2024-08-07_195344_lymwjl.png


You may also try

Code:
Report Form ... NoConsole to Printer Prompt

... to try with different printers

or click under "Print Area" "Printable Page"

hth

MarK
 
Hey mjcmkrsr, I have tried different sizes and nothing in the page setup fixes the issue.

I also tried this - Report Form ... NoConsole to Printer Prompt - but it still cuts the report in half.
 
TinyNinja,

Is the Windows text scale setting higher than 100%? If so, try setting it to 100% and rerunning the report. If the report is okay, you'll have to signal your application as DPI-Aware.
 
Atlopes,

I'm using a 4k monitor and I changed the scaling down to 100% and now I see the full report. What is the easiest way to do the DPI-Aware?

 
Hey Mike,

I added that code to the top of my prg but nothing changed or was fixed, my reports are still cut in half. Do you have to do more with that declare?
 
If SetProcessDPIAware() didn't work for you, I suggest you remove it. Clearly it's not the solution that you were looking for. I was simply answering your question about the easiest way to make the app DPI aware.

I've also heard that SetProcessDPIAware() can cause unwanted side effects. I'm not sure what those are, but that would be a good reason to remove it when it doesn't work.

Sorry I can't be more help.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
oooo alright, I will remove SetProcessDPIAware() and try something else to get the DPI Aware to work.

Thanks for the help.
 
I'm at a roadblock now.
I'm not fully understanding on how to incorporate either atlopes/DPIAwareManager or Tracy-P/vfp_dpi_aware into my prg / src to get the reports to print out correctly. I get different errors for things missing or it just crashes before opening the form.

The way my form works is fine and doesn't bother me, I just really need to get my frx to print out correctly on any monitor type. I'm developing on a 4k monitor but the program will run prob on multi different monitor sizes on the workstations I deploy it to.
 
Well, as far as I know atlopes DPIAwareManager it needs forms to be processed after being created and (ideally) before they are shown.

There's onthig about reports, though and since reports are not objects you can't apply the same strategies of stretching controls (or skewing them) and adjusting font sizes to counteract the Windows text scalöing >100%.

I think one solution is to give up on the text upscaling feature of Windows and demand users of your application to only run it in 100% mode (no scaling) or use FoxyPreviewer instead of the standard Report preview engine of VFP. I'm a bit uncertain here, but I think they made adjustments to report rendering so they became dpi aware. Not 100% sure if it's done in the last free version nor the paid one, though that's just an experiment as you can test the commercial version before bying, because...
[URL unfurl="true" said:
https://www.foxypreviewer.com/p/pricing.html[/URL]] It just shows a watermark in some reports and a reminder in the Preview forms.

So, start trying with the FoxyPreviewer v299z41.zip version, if that's not solving it try the 3.0 version unlicensed first.

Chriss
 
Maybe you can update your VFP9 ReportingApp(Link)!

If the problem is not resolved, then try DPIAwareManager(Link).

In any case, they are beneficial.

 
Hi Mike,

Mike said:
I've also heard that SetProcessDPIAware() can cause unwanted side effects. I'm not sure what those are, ...

On my screen (1680 * 1050) it blurs some icons - not all - when scale settings is set back to 100% and DPIAware is still set

hth

MarK
 
Hi XinJie,

xinjie said:
Maybe you can update your VFP9 ReportingApp

Side note: Make sure to replace the reporting apps in the

[ul]
[li]...\Program Files (x86)\Microsoft Visual Foxpro 9 folder[/li]
[li]...\Program Files (x86)\Common Files\Microsoft Shared\VFP folder[/li]
[li]and on every pc/laptop where your applications run[/li]
[/ul]
hth

MarK

 
Hello,

i never had problems with SetProcessDPIAware()

Question / idea :
It should work if you create an exe and start it directly.

It does not work when you start your program from the VFP IDE.
For that you have to set it in the properties of the link with which you start VFP.

It does not work (always) if you have a loader program which starts an exe/app.
You have to add it to the loader, too.

HTH
Regards
tom

Just for the archive :) :
In this link you find a description on dpiproblem with a manifest sample and how to use it :

foxypreviewer 3.x has a built in "dpiaware mode" for pdf generation
 
Hi TinyNinja

Yo may want to change the High DPI Settings in the shortcut to your VFP

Screenshot_2024-08-09_105437_j9skxk.png


hth

MarK
 
I must say that I have never noticed a problem when calling SetProcessDPIAware(), whether I run the program from the IDE or as an EXE. In particular, I don't remember seeing the icon blurring that Mark mentioned. Then again, there are probably many factors that might affect this, and my system might not be typical.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hey Chris Miller, I tried using the free version of FoxyPreviewer and it was working. I then tried replacing the ReportingApp and that solved it too so I'll be using that instead since I don't need to worry about licensing in the future.

Hey xinjie, The updated ReportingApp fixed my sizing issue! Thank you!

Hey mjcmkrsr, Thank you for calling out all the places the ReportingApp needed to be copied, very helpful!

The post hasn't been about the Form and needing to use DPI to try to fix it. Just to play it safe, I have included SetProcessDPIAware() in the beginning of my program just incase. I have been trying to fix the reports that get generated.
 
I made some updates and then restarted the IDE and now the report cut in half when previewing while using Set REPORTBEHAVIOR 90 this really is a head scratcher. When I run the EXE file then the reports get made correctly. So very confusing but at least it works.

I might need to use FoxyPreviewer in the future if this becomes a problem again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top