General information
Category:
Coding, syntax & commands
Marty, I have a little diifculty with the terminology so i'll rephrase my requirements.
I have on Form Class set up (Called say MyReport) which I call every time I want to print a report. It will have the basic functionality built in , to say Select a printer, set no. of copies, set portratit/ landscape etc.
Now, bear in mind that I will be calling this (Subclassing it more correcttly) from every single screen that I have whose function is to print a report :
(Below is just a small sample of possibilities.)
e.g.
System ...............Calling Screen Fields input on the
..........................................calling screen
------- -------------- ---------------------------
Sales System.........frmAgedDebt.........Sales Period,Sales End date
Purchases System.....frmSupplier.........Purchases period,Purche Year
Stock System.........frmStock............Stock Period,Stock days
Each of the 'Fields input on the calling screen' may need to be accessed and printed on the report.
It is not practical to set up parameters to do this as the parameters will be different for each calling screen. Also each time I create a new screen , with new paramters, I'd have to change myReport class.
What I ahve done up to now is include each field as a dield on a SQL selected file but I thought there might be a better way.
>Are we talking about accessing objects on a "called" form? or a "calling" form. It's a little less bad to access child form properties, but I thought we were talking about accessing parent form properties.
>
>Charlie gave you one great way to prevent the coupling. Mostly what you want to avoid is having your report object require the object calling it having a text box called txtDate and a spinner called spnCopies. If that is written into the report object, you won't be able to call it from some other process. Charlie's advice will help you prevent that.
>
>M.
>
>
>>
>>I take your point here , but is there an altranative OOP way of doing thigs to access objects on a called form. This will happen all the time in ALL applications.
>>
>>Regards,
>>
>>Gerard
>>
>>>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only