SN's PVF Reporting Tool (FAQ)

Home

  1. How do I use the ocx from Microsoft Excel?
  2. How do I use the ocx from other applications or programming languages?
  3. What paper sizes does the ocx cater to?
  4. Can the ocx generate reports with numerous sections?
  5. How does someone not having the programmer's parent program view the reports created from the parent program?
  6. Does the file size increase proportionately if there are many report pages and each has a graphic such as logo in bitmap format?
  7. How can I block my client from using the 'Replace' facility to a word or words in the report - such as my company name?
  8. Why is the Editor Page facility provided?
  9. The writing tool provided generates the string that the ocx 'understands' from .frm + .frx files only.  What about from other languages?
  10. The trial ocx has License ID and Release code boxes.  I don't want to bother my clients with this.  My application. has its own Release Code.
  11. How many developers can use the licensed ocx?
  12. Can a document containing several pages (reports) show reports of different paper sizes and some in Portrait while others in Landscape?
  13. What is the maximum length of the string that can be sent to the .AddToPage method?
  14. I have zoomed the preview to 200%, yet the printed output is obtained at 100%.  How come?
  15. When I have graphics or RTBs or charts in the report, the parent program has to refer to the file names.  What about in the .pvf files?
  16. When I include the ocx in my application, will the Help-About box and SN Terms and Conditions be seen by my clients?
  17. What are the files that I need to package with my application?
  18. What do the procedures CompFile and DeCompFile do?
  19. The writing tool bundled-in has four blocks.  Why?
  20. What does this ocx do that I cannot achieve using a db reporting tool or Crystal Reports?
  21. The build methods drawtexts, drawlines, etc. are not used in the example project.  Why?
  22. The optional parameters in the build methods drawtexts, drawlines, etc. are not optional with the passed string addtopage method.  Why?
  23. What upgrades are available and at what cost?
  24. What has the JoinFiles and UnJoinFiles function go to do with a preview / printing ocx?
  25. Where is the media file stored when I save (export) to a .pvf file?

Type in your query below. This query will be submitted with your default mail client. You will get a reply within 2-3 business days via email.

Q1. How do I use the ocx from an application like Microsoft Excel? Top

A. From the Microsoft Excel Menu bar, click on Tools-Macro-Visual Basic Editor.  From the VB Editor Menu, select Tools-References and click on the Browse button.  Select 'ocx' from the 'Files of Type' drop-down box.  Browse to the folder where you have installed PPOcx.  Select it and click on 'Open'.  Close the references dialog box.

Next insert a new userform or utilise any userform already created.  From the Tools Menu, select 'Additional Controls'.  Select the PPOcx control and click on OK.  You should get the control on the toolbox.  Click and drag the control to the userform.  The control will be added with the name PVFReader1.

You can now refer to the control from anywhere in your application ide.  for example From Sheet1.commandbutton1.click, the code 

userform1.PVFReader1.show

will show the PVF reporting tool application.

 

 

Q2. How do I use the ocx from other applications or programming languages? Top

A.  In much the same way as the answer to Q1. the user navigates through the language ide to setup a reference to the control.  Once the control is inserted into the project, its methods can be exposed in a similar manner to the answer in Q1.

Q3.  What paper sizes does the ocx cater to? Top

A.  The ocx caters to all the standard paper sizes as well as any custom paper-size.  The paper size is set from the 'Dimension method.

Sub dimension(h As Long, w As Long, sh As Long, sw As Long, Orientation As Byte, PaperSize As PrinterObjectConstants, [elementseparator As String], [parameterseparator As String], [DecimalSep As String = "."])

When the paper size is A4 or Letter size, the user should set the report template to 15840 x 11955 twips.  The value 1 should be passed in the 'PaperSize' argument.  This will take care of both A4 and Letter Size reports.

Q4.  Can the ocx generate reports with numerous sections? Top

A.  This versatile control can generate reports of any degree of complexity.  The controls can be 'placed' on the report with micro precision.  The placement as well as all the parameters of each of the various controls can be controlled at run time.  See Example Pic5. The controls that do not overlap can be fired in any order from the parent program.  Should there be an overlap as in the case of of box shape with some text boxes inside then the shape control string(s) have to be fired after the text box string(s).  This is so that the textbox(es) get painted on the screen in the front order.  See the method 'DrawBoxs' below

Sub DrawBoxs(left As Single, top As Single, Width As Single, Height As Single, [lshape As Integer], [lBorderColor As OLE_COLOR], [lBorderStyle As Integer = 1], [lBackColor As OLE_COLOR = 16777215], [iLineWidth As Integer = 1], [lFillColor As OLE_COLOR], [lFillStyle As Integer = 1], [lBackStyle As Integer])

From the above, it is easy to see that shapes can be fired to any portion of a report with micro precision.  The same is true with all the other controls.  This makes it very easy for the programmer to calculate the 'top' of a line in a report having a section of 120mm height but needing exactly 11 equidistant rows. See Pic9 Tip: If a border is required, fire four lines instead of the box shape. That way, the user need not be bothered with the back or front order.

Q5.  How does someone not having the programmer's parent program view the reports created from the parent program? Top

A.  The PPOcx has the facility to generate a file containing the page(s) fired to it.  The files have a .pvf extension.  These .pvf files are compressed and encrypted.  They can be password protected.  The file(s) can then be e-mailed to anyone.  The recipient will be able to view the file from a freeware called PVF Reader.  The PVF Reader of about 1.5MB in size is downloadable from http://cargocal.com/SNPVF.exe  This application is packaged with the ocx and so is already available with the programmer.  The programmer in turn should package the reader with the parent application and write the appropriate code to associate the icon.  An example is as below - or else, advise their clients, the link above.

[Icons]
Name: "{group}\SN's PrintPreview Reader"; Filename: "{app}\PrintPreview Reader.exe"
Name: "{group}\{cm:UninstallProgram,SN's PrintPreview Reader}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\SN's PrintPreview Reader"; Filename: "{app}\PrintPreview Reader.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\PrintPreview Reader.exe"; Description: "{cm:LaunchProgram,SN's PrintPreview Reader}"; Flags: nowait postinstall skipifsilent

[Registry]
Root: HKCR; Subkey: "SN's PrintPreview Reader"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "SN's PrintPreview Reader"; ValueType: string; ValueName: ""; ValueData: "PVF File"
Root: HKCR; Subkey: "SN's PrintPreview Reader\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "{app}\PrintPreview Reader.exe %1"
Root: HKCR; Subkey: "SN's PrintPreview Reader\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\PVF.ico"
Root: HKCR; Subkey: ".PVF"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: ".PVF"; ValueType: string; ValueName: ""; ValueData: "SN's PrintPreview Reader"

where {app} = Program Files\PreviewPrint

Q6. Does the file size increase proportionately if there are many report pages and each has a graphic such as logo in bitmap format? Top

A.  All data such as graphics or charts are stored just once.  So images such as logos on each page of the report will not consume more file length than absolutely necessary.  And as already mentioned, the files are compressed effectively to bring the file size to astonishingly low levels.

Q7. How can I block my client from using the 'Replace' facility to a word or words in the report - such as my company name? Top

A.  The 'DrawTexts' method has a 'BlockReplace  argument. See Below.  Set the value to 'T'

Sub DrawTexts(stext As String, lleft As Single, lTop As Single, lWidth As Single, lHeight As Single, [lFColor As OLE_COLOR], [lBColor As OLE_COLOR = 16777215], [lAlignment As Byte], [lBordStyle As Integer], [lBackStyle As Integer = 1], [MultiLine As String = "F"], [JustifyLeftRight As String = "F"], [Hlr As String = "F"], [LineSpace As Single = 1], [BlockReplace As Boolean = False], [MarqBlink As Integer = 0])

Q8.  Why is the Editor Page facility provided? Top

A.  The user may be forwarding a report containing one or more pages to his/her H.O.  The PIC there may forward it in turn to some one else such as the company's client.  The PIC may want to add a covering page or an addendum to the report sent in from the field.  It is for this reason that an end-user Editor Page facility has been provided with the ocx.  The Editor Page is essentially a rich text box.  The person editing may do so directly into the newly inserted page or may import data into it from a file prepared using any word processor.

Q9.  The writing tool provided generates the string that the ocx 'understands' from .frm +.frx files only.  What about from other languages? Top

A.  The methods for the 8 types of controls are exposed.  It should not be too much trouble for any software developer to write a routine to generate a string to conform to the template of the report written in any language not stored in .frm files.

Q10.  The trial ocx has License ID and Release code boxes.  I don't want to bother my clients with this.  My application. has its own Release Code. Top

A.  When purchased, a second installer will be sent to the user.  The ocx in this installer will not have the License ID and Release Code boxes.

Q11. How many developers can use the licensed ocx? Top

A.  The ocx can be packaged only from the PC it was installed to.  Thus while more than one developer may make use (have design time control) of the ocx in their applications, they must do so from the PC where the ocx was installed.  The fee charged is negotiable based on volumes required in the same premises of an organization.

Q12. Can a document containing several pages (reports) show reports of different paper sizes and some in Portrait while others in Landscape? Top

A.  Yes.  The 'Dimension' method is utilized to fire to the ocx a change in report (paper) size and/or orientation.  This will affect the page in question only, unlike MS Word, where the change is affected to the whole document.

Q13.  What is the maximum length of the string that can be sent to the .AddToPage method? Top

A.  The data type is a variant, so we guess the string length is irrelevant.  It would take more pages than any document would hold to exhaust the capacity.

Q14.  I have zoomed the preview to 200%, yet the printed output is obtained at 100%.  How come? Top

A.  This is not a bug.  That's the way it has been designed.  The user may preview at any percentage of the original size from 1 to 999 but the reports will be printed at 100% zoom factor.

Q15.  When I have graphics or RTBs or charts in the report, the parent program has to refer to the file names.  What about in the .pvf files? Top

A.  When a report is generated from the parent program, the ocx no doubt refers to passed file names for the graphics or RTBs or charts.  When storing the reports to .pvf files, the ocx converts all this to a binary data stack along with the rest of the report data.  Distinct files especially relevant to the graphic files are stored only once.  Thus the .pvf files do not have to be 'accompanied' by the files referred to.  The data is embedded in the .pvf file and the file length will be considerably smaller than the originals.

Q.16 When I include the ocx in my application, will the Help-About box and SN Terms and Conditions be seen by my clients? Top

A.  No.  When a purchase is made, a new setup file is sent to the you, either by a download url or on a CD by courier. This installation will not have the SN references such as in the Help-About box or Terms & Conditions box.

Q.17 What are the files that I need to package with my application? Top

A.  The following runtime files as well as the files for the rich text box, common dialog box and chart control etc. are needed  If not already packaged in your application, you should locate and include the following -

bullet stdole2.tlb - Destination Directory: system
bullet msvbvm60.dll - Destination Directory: system
bullet oleaut32.dll - Destination Directory: system
bullet olepro32.dll - Destination Directory: system
bullet asycfilt.dll - Destination Directory: system
bullet comcat.dll - Destination Directory: system
bullet comdlg32.ocx - Destination Directory: system
bullet comdlg32.dep - Destination Directory: system
 
bullet Zlib.dll - Destination Directory: system
bullet zip32.dll - Destination Directory: system
bullet Unzip32.dll - Destination Directory: system
 
bullet Richtx32.ocx - Destination Directory: system
bullet Riched32.dll - Destination Directory: system
bullet riched20.dll - Destination Directory: system
bullet Richtx32.dep - Destination Directory: system
 
bullet Mschrt20.ocx - Destination Directory: system
bullet Mschrt20.dep - Destination Directory: system
 
bullet Mshflxgd.ocx - Destination Directory: system
bullet Mshflxgd.dep - Destination Directory: system
 
bullet MSSTKPRP.DLL - Destination Directory: system
bullet Mscomctl.ocx - Destination Directory: system
 
bullet VBCorLib.dll - Destination Directory: Windows
bullet VBCultures.nlp - Destination Directory: Windows
 

Registered users can receive all the above files as an e-mail attachment, should that be necessary.

Q18.  What do the procedures CompFile and DeCompFile do? Top

A.  The ocx compresses the files saved in .pvf format.  We have made the methods 'public'.  You can utilize these methods to compress or decompress any of the files in your application.  This method is exposed in order to indirectly save your code length.  The procedures are as follows -

Sub CompFile(filename As String, ZipFileName As String) - The full paths are specified.  The zipped file will have the .zip extension

Sub DeCompFile(filename As String) - The full paths are specified.  The file will be un-zipped to the ocx application path.

Q19. The writing tool bundled-in has four blocks.  Why? Top

A.  If you design your report in parts, you can use the tool to combine the parts into one report.  Generally, this in not required.  So, only the left top section need be filled in with a file name before generating the preview and resultant code.

Q20.  What does this ocx do that I cannot achieve using a db reporting tool or Crystal Reports? Top

A.  See Example Pic9.  In this example, the report seen is the exact replica of the client's printed pad.  The programmer has to create a report with a fixed height for the rows labeled '1P' to 'SS' but there's a catch.  The number of rows may change (any number between say 12 and 25).  Can you, at run-time, space the row height using db reports or Crystal Reports?  Further, you cannot place lines with micro precision using Crystal Reports.  After every so many lines, the line just will not snap to the required position.  Check this out by trying to place 15 adjacent lines in Crystal Reports exactly .9975 cm apart.   Please note that the author of this paragraph has not tested the figure .9975.  Substitute .9975 with any distance that you fancy.

 Q21.  The build methods drawtexts, drawlines, etc. are not used in the example project.  Why? Top

A.  It is more efficient to build the string in the parent application and send the ocx the completed string.  The methods have not been made private so that the user may expose them to see / refer to their parameters while building the string locally.  The point to note is that the drawtexts method does not have the font parameters as part of the method but while building the string in the parent application, the font parameters are included.

For example :  The parameters in red are font parameters -

sg = sg & "¬1¿Gross¿44.25¿283.5¿79.5¿14.25¿0¿16777215¿2¿0¿0¿False¿False¿Times New Roman¿12¿False¿False¿F¿F¿F¿30¿1"

Q22.  The optional parameters in the build methods drawtexts, drawlines, etc. are not optional with the passed string addtopage method.  Why?  Top

A.  The methods have not been made private so that the user may expose them to see / refer to their parameters while building the string locally.  If the parameters were to be allowed as optional, more CPU cycles would be necessary at the ocx end to test the passed string and apply default values, if necessary.  We find it far more cost effective to have all parameters included in the passed string in the addtopage method.

Q23.  What upgrades are available and at what cost?  Top

A.  Registered users are entitled to all upgrades at no charge provided that the release date is within a year of the original purchase. 

Q24.  What has the JoinFiles and UnjoinFiles got to do with a preview / printing ocx?  Top

A.  The procedures are made public so that the programmer can utilise a file join and unjoin facility, if needed. No need to re-invent the wheel!

Q25.  Where is the media file stored when I save (export) to a .pvf file?  Top

A.  Just like a chart, RTB or image, distinct media files are stored as binary data in the .pvf file. Unlike MSWord, where only the file header is stored, the entire media file is stored within the pvf file.

Home