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

VFP has an error in report preview window anybody helps me

Status
Not open for further replies.

prg555

Programmer
Dec 8, 2006
12
PK
hi ..,

VFP 7 and earlier has a very hard error .in report preview window ..
if u press windows shortcut key in report preview window you will see a menu with .[cut ] [copy ] then u click on cut and again press shortcut key u see a menu with data environment.. .
and that time you click on data environment .and access any table on the disk or in report and change the data as u want.
my salesman takes the advantage of this error and they changed the amount of invoices and stolen the money ..

purpose of the .. story ..is that

anybody help me how can i solve ..this problem..
i m tired to solve this problem .currenty i disabled report preview option in my software but i have a lot of pressure to enable preview optoin

how can i resolve this
to disable window shortcut menu key from keyboard..
or
any other suggestion u have..


regards

Hyder
 
Sorry to hear that. When you say "windows shortcut key" which key is that? is it the one with the windows logo that opens the start menu?
Unfortunetly, I have VFP9 so I cannot recreate the problem.

The only solution that comes to mind is before the report is generated disable the Key(s).
Write a small program which displays a messagebox which says these keys are disabled during the report process
Example:
Program name = prg1
On Key Label F1 do prg1
...... do prg1
..... do prg1
Once the report is done a simple
On key label F1 will revert back to the default

Though I do not think you can diable the Start Menu key. But I could be wrong
 
WOW: I got it to recreate the problem with the Shortcut Key on the Keyboard, running in Engine behavior 80. some times it gave me the cut, copy properties menu at other times it opened the print menu with dataenvironment in it.
I see how the data could be changed.

DO NOT put your tables in the data environment of the report. Set the report to Default Data session, leave the tables in the forms data environment and it will work.

"Na rahay bans na bajay bansari
 
Hyder,

I've also been able to reproduce this. An interesting bug.

However, my attitude would not be to try to disable the preview feature, or the shortcut key, or perform any other Foxpro-related fix. This is a business problem, not a technical one.

If a sales rep is able to steal money by altering values in a table, then the company needs better security and audit procedures in place. Blocking a bug in the preview window won't solve it. If the salesman is knowledgeable enough to exploit this bug, he won't have any difficulty in finding other ways of getting into your tables.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
This, being able to access the data environment, IMO is there to give your users the capability to create ad-hoc reports on their own in your app. Though I never realized this could be done. It is an eye opener for me. Thanks Hyder, I have learnt something new.

Fortunately for us we put this capability in a wrapper and the report data environment does not contain tables.

For your problem; like Mike said, don’t fool around with disabling then enabling buttons etc, it is confusing, but remove all tables, at least the sensitive one, from the report DE, leave them in the form’s DE, and make the report Default Data session. This will not only solve your problem, but give you tighter control over the report.

Again like Mike said, unfortunately there are other ways to get into the tables and make changes through development machines…

I am sorry, no simple solution comes to mind, but I am sure someone here may be able to come up with one.
 
Mike said:
If a sales rep is able to steal money by altering values in a table, then the company needs better security and audit procedures in place.

I am assuming these could be Cash transactions, it is crookedly ingenious, take this scenario: The Invoice when created is posted to AR with the correct amount ($100). The salesmen changes the table to $120, prints the invoice again, changes the amount back to $100, takes it to the customer, gets the $120 in cash and remits only $100. The $100 is posted to Cash. The books balance and no one is the wiser. This could go on forever.

My suggestion, prosecute the salesperson to the fullest extent of the law, make him an example so others would think twice before stealing from you.
 
Imaginecorp,

You've made some good points, as usual.

In the scenario you described, the company is asking for trouble. They are allowing an employee to deliver an invoice personally to a customer, and to collect cash from the customer, with no audit trail. At the very least, they should send a receipt to the customer, independently of the salesman. Any situation where employees handle cash needs extra controls in place.

But it does support my point (and yours) that it is a business problem, not a Foxpro one.

I also like your idea of not putting tables in the report's DE. Unlike with forms, I've rarely found I needed to use the DE in a report.

In fact, I'd go a bit further and say that I rarely give the users the built-in report viewer. Not for security reasons, but because it's too darned unfriendly (users really hate clicking on a report to try to select some text, and then seeing the page zoom down). Fortunately, there are some good third-party viewers availalble, and, in VFP 9.0, you can roll your own with no too much difficulty.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

thanx mike n imaginecorp for reply

mike as u say abt audit dept.. my audit dept. alerts me that mr.hyder ur software has an error .the invoice amount has been automatically changes after saving.they tell me that thing 6 months before and i have surprised that my software is running from 2-3 years successfully .. and how this error comes if this error in my software then why it never comes before from starting ..

actually its and hospital software .and we have 8 cash counters.. with total 40 terminals software

i m shocked if this error comes daily the cash shortage may be increase.. but u i never knows how this invoice /slip amount was changed after saving and printing.

but my mind clicked that someone hacking the system .
but how.
we have windows 2000 advanced server with fully restriced machines , and user's r only allow to hospital software . they never have right click ,or datetime change or any desktop item's

actually a cashier changes only cash slips to panel/creditor slips ..changes the customer type
for ex. cash account to PEPSI .. and deletes the received amt. and his statment show that slips as a credit slip without amt. cause we done billing our creditors after a month , and the physically access amount he put is his pocket..
but i have no avidence to catch him .if i catch him directly my software also flops in my company and all other operators knows this error...

over 10 - 15 days working i never knows how this come ..then i decided a desktop spy software.. this software give me the pictures as i tell u .. and then i know it is VFP report preview bug .. and instantly i closed all report preview in software..

by as imagecorp says . dont add the tables in dataenvironment its not a good idea i tried this 3 months before .. the operator right clicks on dataenviroment and add any table from disk and browse it easily ..

so i have only three options now.
1- crystal reports .
2- disable the keys
3- switch to vfp9 with report listner .


regards

Hyder


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top