Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Zoom in the Preview over 100%?
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00841098
Message ID:
00841143
Views:
26
>Hi, Shlomo.

>>Is there a way where I can change the report preview percentage to go over 100%?

>Take a look at:
>Report Engine/Preview Control (PDF/CHARTS/EMAIL) File #14538

>This is really an awsome tool that let you do this and MUCH more.

Thanks Martin! I've been working pretty much around the clock to get all the new improvements made to the next release to fix my STRETCH WITH OVERFLOW issues and improve support for the SHAPE and LINE Stretching over groups.

While I was at Whilfest last week I had a question from a customer that prompted me to add in support for the Windows CLIPBOARD. This actually adds in a lot of cool things that you can now do with the Report Engine. The BETA 4 which I posted this morning now adds in support for drawing a Bounding Box while previewing a Report and dropping in Formatted Word Text, Excel Charts, Visio Drawings, Microsoft Publisher Objects, Etc.. Simply go into Word, Excel, etc and select some text or a chart and select COPY to paste the object onto the clipboard. Then go back into my Report Engine and draw a bounding box to drop in the image into a report page. Hold down the SHIFT KEY to draw a bounding box that will maintain the ASPECT RATIO of the object and hold down the CTRL KEY to make the object fit to the page. This is a real fast way to make a Picture Collage. <g> You can overlap and layer multiple pictures and drawings and text onto the page. It's kind of cool zooming into a Visio drawing of a floor plan at 20,000%. The metafile objects from Visio, Word and Excel are fully scaleable vector graphics as well as the same thing that I paste to the Clipboard from my engine. I will need to add in support to move the objects in the future, after I finish my VFP FRX improvements. However, it gives you a good idea of what you can do. You can even go into IE and right click over images one at a time and select COPY from the popup menu and then paste them onto report pages. There is a new button in the Toolbar which can be turned off to Add New Pages to the Report Engine at Runtime.

You can also RIGHT CLICK over the REPORT ENGINE now and select the new COPY TO CLIPBOARD menu item and the current page will be rendered into a METAFILE OBJECT and placed onto the CLIPBOARD. Now you can go straight into MS WORD and hit CTRL+V to paste the Rendered Page right into a WORD DOCUMENT.

I also have added several new Methods to support programmatically doing the above as well as Render and Save Pages to Image Files:
CopyPageToClipboard([nPageNumber])
Copies the current page or the specified page to the clipboard.

AddFromClipboard(cName, nHPos, nVPos, nWidth, nHeight)
* Adds the current Clipboard object onto the current page programmatically.

SaveToMetafile(cFileName, [nPageNumber], [lOpenfile])
* Saves the current page or the Page specified to a Metafile.

SaveToBitmap(cFileName, [nPageNumber = 0], [lOpenFile = .F.], [nThumbnailSize = 0], [nBitsPerPixel = 24], [lGrayScale = .F.])
* Saves the current page or the Page specified to a Bitmap.

SaveToJPEG(cFileName, [nPageNumber = 0], [lOpenFile = .F.], [nThumbnailSize = 0], [lGrayScale = .F.], [nCompressionQuality = 90], [lProgressiveEncoding = .F.])
* Saves the current page or the Page specified to a JPEG.

* lAutoOpenFile uses ShellExecute() to open the default viewer for the file after it is generated.
* nThumbnailSize allows you to specify the maximum Width or Height of the BITMAP or JPEG image. This allows you
* to quickly render Thumbnail images of every page in a report.
* I rendered 100,000 thumbnails yesterday in about 45 minutes at 120 pixels with an nCompressionQuality of 75%
I also posted code to take a report and stuff it into a WORD Document using the Clipboard which is extremely fast since it is pasting in Metafile images of each and every page rather than adding in each and every object drawn onto the page. These report pages cannot be edited but they are fully scaleable and are also rendered exactly as if they were previewed on the screen. The code below took 4.9 seconds to render a 126 page report with a lot of lines, shapes and text into my Report Engine and then it only took 3.9 seconds to paste all of the pages into a Word Document programmatically. The REPORTTOWORD.PRG file is in the BETA 4 download as well.
SET CLASSLIB TO MindsEyeReportEngine
LOCAL lnSeconds, lcFRX
PUBLIC o, oRPT
o = CREATEOBJECT('MindsEyeReportEngine')
lcFRX = GETFILE('FRX')
IF EMPTY(lcFRX) THEN
	MESSAGEBOX("No FRX Report File Selected",16,'Report To Word')
	RETURN
ENDIF
oRPT = o.ReportFormObject(lcFRX)

IF VARTYPE(oRPT) # 'O'
	MESSAGEBOX("Mind's Eye Report Engine was Not Instantiated",16,'Report To Word')
	RETURN
ENDIF
PUBLIC oWord
*
* INSTANTIATE WORD APPLICATION
*
oWord = CREATEOBJECT('Word.Application')
IF VARTYPE(oWord) # 'O'
	MESSAGEBOX('WORD Could Not Be Instantiated',16,'Report To Word')
	RETURN
ENDIF
lnSeconds = SECONDS()
*
* CREATE A NEW DOCUMENT
*
oWord.Documents.Add
oDoc = oWord.ActiveDocument
*
* SETUP THE PAGE MARGINS
* THE MARGINS CAN BE VERY SMALL OR EVEN SET TO ZERO SINCE THE PAGES WERE RENDERED AT FULL SIZE
* AND INCLUDE THE MARGINS IN THEM FROM THE REPORT ENGINE.
*
oDoc.PageSetup.TopMargin = 20
oDoc.PageSetup.BottomMargin = 20
oDoc.PageSetup.LeftMargin = 20
oDoc.PageSetup.RightMargin = 20
*
* NOW COPY THE FIRST PAGE OF THE REPORT ONTO THE CLIPBOARD
*
oRPT.oReportEngine.FirstPage()
oDoc.PageSetup.PageWidth = MIN(MTON(oRPT.oReportEngine.PageWidth * 72),22*72)
oDoc.PageSetup.PageHeight = MIN(MTON(oRPT.oReportEngine.PageHeight * 72),22*72)
oRPT.oReportEngine.CopyPageToClipboard(1)
oDoc.Content.Paste
*
* NOW LOOP THROUGH THE REST OF THE PAGES IN THE REPORT ENGINE AND COPY EACH
* PAGE TO THE CLIPBOARD AND PASTE THEM INTO NEW SECTIONS
FOR i = 2 TO oRPT.oReportEngine.nTotalpages
	oRPT.oReportEngine.GoToPage(i)
	oDoc.Sections.Add
	oSection = oDoc.Sections(oDoc.Sections.Count)
	oSection.PageSetup.PageWidth = MIN(MTON(oRPT.oReportEngine.PageWidth * 72),22*72)
	oSection.PageSetup.PageHeight = MIN(MTON(oRPT.oReportEngine.PageHeight * 72),22*72)
	oRPT.oReportEngine.CopyPageToClipboard(i)
	oSection.Range.Collapse
	oSection.Range.Paste
ENDFOR
MESSAGEBOX("Report Engine Pasting into Word Complete"+CHR(13)+;
           "Processed in: "+STR(SECONDS() - lnSeconds,8,3),0,'Report To Word')
*
* NOW MAKE WORD VISIBLE. IT IS MUCH FASTER TO RUN WITH WORD NOT VISIBLE
* AS WE ADD IN ALL OF THE PAGES TO THE WORD DOCUMENT.
oWord.Visible = .t.
You can download BETA 4 now from the website to play with these new features. I am working on Documenting all of these new features. There is too much stuff to document. <bg>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform