Showing posts with label address. Show all posts
Showing posts with label address. Show all posts

Sunday, March 11, 2012

Crystal report printing to 2 different printers using IP address

Hi ,

I using vb6 and crystal report 5.0 version.
There is a requirement to print reports to two different locations (diff.countries) . If I have the printer machine's IP address instead of Printer name , is it possible to print reports based on the IP address to the resp. printers ? Crystal reports -> printer setup menu will accept only printer name and not printer IP address. Crystal help is not having any clue about this.

It will be of great help if you can throw some light on this.

Thanking you in advance,
Deepa.I use CR Version 8.5.

In my VB code, I loop through the Printers object to get the name of the printer I want and then pass the required info back to Crystal (Printer Name, Port, and DriverName). I don't know if it's possible, but perhaps you can loop through the printer collection and compare it to the IP address to get the right printer?

Dim prt As Printer

For Each prt In Printers

If prt.DeviceName = strPrinterName Then 'You would compare to IP address instead

Set Printer = prt

strDeviceName = prt.DeviceName
strDriverName = prt.DriverName
strPort = prt.Port

Exit For

End If
Next prt

Set prt = Nothing

Report.SelectPrinter strDriverName, strDeviceName, strPort

Report.PrintOut False|||Thank you for your response !!

Tried your code and found that this code piece will work if the specified printer is installed in the local machine.But in my case the application will be provided with a Printer IP address alone.Meaning if we go to Control Panel -> Printers option , there will not be any printer installed.Hence the Problem!

Thanks and Regards,
Deepa.|||I'm sorry I can't be of anymore help, but if you find the solution, will you post it?|||I am trying out some options as of now .Once I get the best way , I will post it here.

Thnaks a lot
Deepa.

Wednesday, March 7, 2012

Crystal Mandatory Fields

Hiya,

I'm writing a crystal report linking with an Access Database.

basically I need to say If Address line1 = "" then display section A if not, do nothing,

but I have to do this for about 30 fields, How would i go about doing this?

Basically, it picks up data from the database,If everything is filled in when the report is run, the report orints out fine, if something is blank or a null value then it will pick up details section B which will say "The following fields need to be filled in" and then it will list the fields?

Any ideas

Thanksif you want to suppress whole section A if addressline ="" then right click on section A -> format section -> there is a button beside suppress text click on it and write down:
if addressline ="" then true else false

It will suppress that section and if you want to suppress some fields only then you have write this on each and every field in design view and for that you have to right click on that field -> formate field -> and here also same you have to write "if addressline ="" then true else false" in suppress button script.

Best of Luck|||better use

if isnull(addressline) then
true
else
false