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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report preview with search 1

Status
Not open for further replies.
badukist,

I downloaded the package, compiled the ReportPreviewEx.app (found all the parts that were missing), then I assigned the app name to the _reportpreview system variable, next I ran the sample reports from the task pane solution samples... I didn't see any search functionality. Do I need to use the customlistener in order to get the search functionality? I'm assuming this is what you meant when you mentioned the custom code for the Render method, but I'm hoping you might be able to save me some time and point me in the direction I need to go in order to run your custom preview app with the task pane examples. I'm anxious to see it in action, thanks.

Ken Levy said over in the Universal Thread that the Fox Team was working on removing the EULA restrictions for XSource items such as this when Visual FoxPro 9.0 SP1 comes out. That would sure be a nice change to Redist.txt. I ran into the same problem with my own custom ReportPreviewEx.app.


boyd.gif

SweetPotato Software Website
My Blog
 
The new preview class looks at the reportlistener reference passed if it has lOutputToCursor = .T. and if the alias is set and used. If is not OK, disable search button.

If you use the standard ReportOutput, updatelistener class is used, without new properties.

You need to add cursorlistener class from cursorlistener.vcx to listener.vcx (with class browser or ADD CLASS command), copy .H files over old files (for the reportoutput to use the cursorlistener class) and then rebuild ReportOutput.app

The overhead of the asociated cursor updated as report is rendered is small.
 
badukist,

What I did was compile the project as ReportPreviewEx.app, then I set the _reportpreview system variable to this new app. When I run the first VFP 9.0 solutions sample "a multiple detail band report used for calculations" your preview window comes up with the very nice toolbar and icons. Everything works except for the search which is disabled.

I am trying to follow your instructions, but so far have been unable to get the search functionality to enable. Please advise as to the exact steps I am missing in order to get this to work as I really want to see this thing in action. Here is the code that is running in the solution sample to bring up the report...

Code:
* Run the report.
local lcDirectory
lcDirectory = sys(16)
lcDirectory = addbs(justpath(substr(lcDirectory, at(' ', lcDirectory, 2) + 1)))
report form forcepath('EmployeesMD2.FRX', lcDirectory) preview

...if you're preview application will not work with a simple report form command, then please provide the code you are using to run reports.

As you may already know, replacing the ReportPreview.app is not necessary as any valid preview application can be specified by assigning the name of it to the _reportpreview system variable.

I'm sorry to keep bugging you on this, but I really want to see this work and perhaps write a blog entry on it to give it some more exposure.

boyd.gif

SweetPotato Software Website
My Blog
 
OK, I believe is my English that makes me hard to be understood.

The new report preview application will have search enabled only if a new report output application is used, with cursorlistener as the default class which is instantiated.
To achieve this, you must:
- unpack ReportOutputEx folder from ZIP, along with ReportOutput folder from xsource.zip, in the same parent folder
- copy cursorlistener class from cursorlistener.vcx into listener.vcx in ReportOutput folder ( you can drag it using two class browser instances)
- copy reportoutput.h over the one in ReportOutput folder

or

-replace these lines in old reportoutput.h
#DEFINE OUTPUTAPP_CLASS_PRINTLISTENER "CursorListener"
#DEFINE OUTPUTAPP_CLASS_PREVIEWLISTENER "CursorListener"

- rebuild reportoutput.app

Then try to preview a report again.



 
badukist,

That was much clearer. I went ahead and made a copy of the ReportOutput folder from XSource, copied the cursorlistener over using the class browser, and recompiled the project as ReportOutputEx.app. Then I set the _reportoutput system variable to this new application and the search functionality appeared enabled.

First of all... great idea and your toolbar is really good.

I realize this is the first release of this, but I noted some issues with the search accurately drawing the rectangle around the matching string it had located. The rectangle also disappeared completely at times, though it appeared to still be searching and moving around - I just couldn't see it anymore.

In any event, it's a great start and I'll have more feedback and perhaps some code for you after I've had a chance to dig into it.

A Star for this alternative reportpreview application and for taking the extra time to help me get it up and running at this end. I really appreciated it.

boyd.gif

SweetPotato Software Website
My Blog
 
Hi, thank you for your feeback
There is a timer on form that watch lHighlightText property of the form. If this is set to .T. by a successfull search, it draw a rectangle 5 times in .5 second and then deactivates itself. The count can be increased.
For page rendering, I'm sure that there is a way to stop Paint() acting like crazy, maybe using API, binding to windows events or something.

To calculate coordinates of rectangle, I've used GetPixelsPerDpi960().

BTW, related to ReportOutput, I want to try to integrate your cool ProgressbarEx class to show the generation progress. What do you think about it?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top