restrict printer options
Posted
#1
(In Topic #1583)
Enthusiast

Also if I must override things like page orientation in code how do I do it? I tried setting the orientation to landscape in the printer select then in code set to portrait and it stayed at landscape. I really need to find a way to stop the guy from screwing it up.
Posted
Administrator

I have no idea how you are printing.sadams54 said
I have an over zealous client that insists on changing printer options on the printer selection screen. Long story short he refuses to listen. This causes the reports to be cut off and come out strange due to changes he makes. Is there a way to set the print selection window the one from print.configure to only give him certain options such as what pages to print and what printer to use. Basically cut off the rest? or do I need to override his settings in my code?
Also if I must override things like page orientation in code how do I do it? I tried setting the orientation to landscape in the printer select then in code set to portrait and it stayed at landscape. I really need to find a way to stop the guy from screwing it up.
Does the client get a preview and reset configuration there? If so, just print directly to the printer without a preview.
That is what I generally do with reports of any kind for clients. You can set configurations for printer in code before printing and that should work just fine in my experience as I do use it.
Something like below should work (wrote it down right here, no testing):
But if you use hPrinter.Configure to show the client the onfiguration, I guess these get overruled, why else would you show them to the client?
But maybe you mean something else, if so clarify the matter.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Enthusiast

Code
Public Sub btnMemberList_Click()
If Not rMemberList.Configure() Then rMemberList.Print
End
then rMemberList_Begin is where I collate the data.
then rMemberList_draw is where I write the report.
I give the configure so they can also use the preview features and select which printer to use. however when they change the orientation on that screen it overrides my programming and of course the reports will fall off the page. I use the paint object to create the report. rMemberList.Draw is called once for each page of report.
I tried resetting the orientation in code but to no avail. I do have orientation set in the rMemberList object but it is also overridden by the user setting. I have to allow them to choose the printer and not just go to default printers. They also need that preview that is so easy to use on the screen.
Posted
Administrator

As I said, I do think that showing them configure will overrule your code, unless you can do a post hack of some kind.sadams54 said
I am using a printer object on the window. I would name it something like rMemberListCode
Public Sub btnMemberList_Click()
If Not rMemberList.Configure() Then rMemberList.Print
End
then rMemberList_Begin is where I collate the data.
then rMemberList_draw is where I write the report.
I give the configure so they can also use the preview features and select which printer to use. however when they change the orientation on that screen it overrides my programming and of course the reports will fall off the page. I use the paint object to create the report. rMemberList.Draw is called once for each page of report.
I tried resetting the orientation in code but to no avail. I do have orientation set in the rMemberList object but it is also overridden by the user setting. I have to allow them to choose the printer and not just go to default printers. They also need that preview that is so easy to use on the screen.
As to selecting printers that can be easily custom coded, I do that all the time and never show configure.
As to preview, check if rMemeberList.Preview also shows configuration (I'm not sure on that from the bottom of my head
If no configure options in Preview then, combined with some dialog to select the printer, might be your solution.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Enthusiast

gbWilly said
As I said, I do think that showing them configure will overrule your code, unless you can do a post hack of some kind.sadams54 said
I am using a printer object on the window. I would name it something like rMemberListCode
Public Sub btnMemberList_Click()
If Not rMemberList.Configure() Then rMemberList.Print
End
then rMemberList_Begin is where I collate the data.
then rMemberList_draw is where I write the report.
I give the configure so they can also use the preview features and select which printer to use. however when they change the orientation on that screen it overrides my programming and of course the reports will fall off the page. I use the paint object to create the report. rMemberList.Draw is called once for each page of report.
I tried resetting the orientation in code but to no avail. I do have orientation set in the rMemberList object but it is also overridden by the user setting. I have to allow them to choose the printer and not just go to default printers. They also need that preview that is so easy to use on the screen.
As to selecting printers that can be easily custom coded, I do that all the time and never show configure.
As to preview, check if rMemeberList.Preview also shows configuration (I'm not sure on that from the bottom of my headand it might depend on the toolkit)
If no configure options in Preview then, combined with some dialog to select the printer, might be your solution.
Unfortunately I would have to recreate the entire configure to do this. I need to give them access to all the options including duplex. But I need to make sure orientation and paper size are always what I set them to. I can continue to try to drill and pound in their head to DO NOT TOUCH ORIENTATION OR PAPER SIZE. but they do not listen. Come back to me with portrait report printed in landscape mode complaining parts of the report like headings are missing. So if I need a hack to override the configure does anybody know how? For now I will check the configure after they hit it and see if I can detect the change and warn them
Posted
Administrator

That would mean researching the source code, see what happens, how much comes from underlying toolkit, how much is gambas, what can be influenced etc.sadams54 said
Unfortunately I would have to recreate the entire configure to do this. I need to give them access to all the options including duplex. But I need to make sure orientation and paper size are always what I set them to. I can continue to try to drill and pound in their head to DO NOT TOUCH ORIENTATION OR PAPER SIZE. but they do not listen. Come back to me with portrait report printed in landscape mode complaining parts of the report like headings are missing. So if I need a hack to override the configure does anybody know how? For now I will check the configure after they hit it and see if I can detect the change and warn them
I would almost think writing your custom configure would be less work.
Or, maybe try inheriting the Printer class and see what is possible to tweak/add etc.
Just a few suggestions from the top of my mind. Maybe others have better suggestions.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Enthusiast

Posted
Administrator

sadams54 said
actually sounds like it might be easier to just beat into their heads to not touch that setting or deal with the consequences. Not sure I want to spend that much time to idiot proof that for one person.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Regular

b
1 guest and 0 members have just viewed this.


