Infopath - print form to network printer - infopath

this seems like such a simple question, but is there a way to print a completed infopath form to a network printer using VSTA/VB?
I confirmed that Me.Print() in the click event of a button was working fine to print to the default printer on the users workstation, but how do I re-route the print job to a printer other than the default?

Change to Me.Print(true) to show the standard Windows Print dialog where they can choose a printer and settings.
http://msdn.microsoft.com/en-us/library/office/aa944532(v=office.14).aspx

Related

The Run button on PopSQL not working [greyed out]

The run button in PopSQL greyed out a while ago after I restarted my laptop. No matter how I tried I couldn't click on it. I re-checked, double-checked my queries but it still didn't work.
Please help.
First of all, check the following -
Your query - Check for semantic errors.
Your database connection - There may be some fault in the connection itself. Try connecting again with the database. Check if just above the tab where the connection is specified if you can see your database name like this -
If you have just installed MySQL in your laptop (or anyways, now you don't have any other option) -
Open run from Start Menu or press windows key + R.
Search for 'services.msc'.
In the search window, search for MySQL80. Double click on it to open.
You will notice that the service is either disabled (in startup type) or stopped in the service status.
Select Automatic or Automatic (Delayed start) in the select box of Startup type and click on apply. So that whenever your machine starts the MySQL service will start automatically in the background.
After that click on the Start button to start the MySQL service on your machine. It will take a few seconds to start.
Then click on apply and hit Ok. Then close the services window also.
Now try opening PopSQL you'll see that database connection has been corrected.
ENJOY!!!

Dealing with colored text on Routers/Switches using expect script

I am trying to login to a router using an expect script. Now, normally, my script works fine when the text on the remote device is not colored.
But when the text on the device is colored, the script fails to authenticate and login to the device.
I googled and I understand that it has something to do with the ANSI color code sequences.
#!/usr/local/bin/expect
set hostName [lindex $argv 0]
spawn telnet $hostName
expect "Username:"
send "userid\n"
expect "Password:"
send "pswdstring\n"
expect "*#"
send "quit"
Here are my observations:
I can login successfully to the device manually. The colored text is still printing on the console, but there is no issue in authentication.
When I redirect the output of the script to a file, I can see the ANSI color codes
Snippet of the output:
[33mNo/expired credentials.
[m[33mUsername: [muserid
[33mPassword: [mpswdstring
I know that the color escape sequence is appending to the actual userid and passwords entered and causing authentication failure. I tried sending a backspace character but that dint work too.
Please help in dealing with these color codes. I an executing the script from Solaris machine.

Using apple script to press the return key when prompted to connect to server

Currently this is my delima. Once in a while a build agent will reboot. It needs to always stay connected to share on one of our servers. The idea was to tell finder to mount the volume, wait 2 seconds, and then press enter...since the user name and pssword are both part of the address when I enter it such as SMB://username:password#Server1/DFS it pops up the pasword dialog fully populated but I can't get applescript to recognize it, then press either connect or the return to say "Yes" login witht hat name and don't prompt me.
it worked fine when connecting at home to a synology device but it's not working when connecting to a server in the office.
tell application "Finder" to mount volume "SMB://username:password#Server1/DFS"
delay 2
tell application "System Events" to keystroke "return" -- key code 36
Any help for this seemingly simple step would be greatly apprecited.
I have looked ove the forums and found variou stratagies but they all relate to an application like Firefox or some other script aware app. I just need it to press enter when the password dialog comes up.
First of all the Finder is not needed to mount a volume, you can delete the tell block.
Secondly, if username and password are passed the volume is supposed to mount without a dialog. Maybe you could find the reason why it doesn't.
Nevertheless the password dialog belongs to the process SecurityAgent, you have to use (ugly) GUI scripting to press the button:
tell application "System Events"
repeat until exists process "SecurityAgent"
delay 0.5
end repeat
tell window 1 of process "SecurityAgent"
click button 2
end tell
end tell
The script waits until the window appeared, this is much more reliable than an hard-coded delay.
Looks like a possible XY Problem as I would expect a solution such as https://apple.stackexchange.com/a/698/204318 to work for you to directly mount the share:
mount -t smbfs //username:password#MACHINENAME/SHARENAME /SomeLocalFolderOfChoice
However, if you are really required to interact with the dialog, and as you asked about it, take a look at this tutorial (written in Python) for scripting up something:
detect missing connection
attempt connection
capture screen periodically
look for dialog box, else loop
error after a few seconds of failure
if dialog is detected, interact with it
input username and password
wait, then press return
check if connection worked after a small delay
success or failure
This type of strategy is very powerful for interacting with all sorts of different dialogs you may encounter and should be possible in AppleScript if you are much more familiar with it (or another scripting language).
If you are open to non-AppleScript solutions, then you might consider Keyboard Maestro, one of the best Mac automation tools available.
You said:
it pops up the pasword dialog fully populated but I can't get
applescript to recognize it, then press either connect or the return
to say "Yes" login witht hat name and don't prompt me.
You could probably do this very easily using Keyboard Maestro. Here's an example of the KM Actions to accomplish this.
If you'd like help with KM, please visit the forum at:
https://forum.keyboardmaestro.com/
I'm a big AppleScript/JXA user, but I often find it easier/quicker to use KM for many automation tasks. Of course, KM Macros can execute AppleScript, JXA, Shell Scripts, and other scripts easily.
You can try a full version of KM for free for 30 days.

oracle forms 10g web application

I'm working in oracle forms 10g.
I write message in when new form instance trigger it did not show
when I run the form from application but when I run it from form builder directly
then it shows message. I want to see message when i open form from application?
The message probably is showing in the bottom left corner.
Instead of
message ('Your message goes here');
use
message ('Your message goes here');
pause;
The pause command should make sure it pops up when you open the form and not just show it at the bottom.

Print Management / AIF

I have setup the AIF so that when an invoice is created, it gets added to the queue. I know that this doesn't work when Printing to Screen. So I had adjusted the print management settings for that customer to Print to Archive. However, the document still doesn't get added to the AIF queue.
After some investigation, I've found out why. Even though I have "Use Print Management" ticked in the Posting box for posting an Invoice, Under the Printer Setup I have "Send To" set to screen still, when I change this to Print Archive my document gets added to the AIF queue.
So my question is, why is this the case? Why doesn't it pick up what I have set in Print Management for that customer?
I attempted to recreate your issue, but it worked for me just as you would have expected. Perhaps your customer print management isn't set up correctly.
To change my test customer's print management settings, I went to the customer in the customer master form, click Setup -> Print management. Expanded Module -> Account -> Documents -> Sales order invoice. Right-clicked on Original and clicked Override. Then I overrode the default printer destination for that customer.
Follow those steps if you haven't already, and let me know if that works. If not, there may be some other problem.
Are your printers configured as AOS printers? See Classes\SalesFormLetter\checkAOSPrintersPrintManagement
Does this have the same issues in your test environments? Try resetting your usage data. There is a usePrintManagement variable packed in the invoicing process.
If you can debug this, it should be fairly easy to step through and see if print management is actually getting used.

Resources