Link to home
Start Free TrialLog in
Avatar of jfreisen
jfreisen

asked on

Printing report to server from web

I have a html page that prompts a user for information that I add thru a ASP with ADO2.0. I need to print the order automatically to a printer hooked up to the server. I received advice form here about creating a dll to do this. I am using VB6 and would like to use the new datareport form.  Is the best way to get started to create a IIS project or just a activex dll? I would like to call this dll from my asp page(createobject) and then pass it the key field of the record I want printed.
ASKER CERTIFIED SOLUTION
Avatar of jjbyers
jjbyers

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jfreisen
jfreisen

ASKER

I created a DLL and tried to install to install on the web server (using setup created by vb6 wizard). It could not register the dll file.  Although I can register it on my machine with regsvr32. Any suggestions.
Make an install package for the DLL using the setup wizard. Your probably missing VB's runtime and then any references you've used in your project.
I had used the setup wizard and tried to install the dll. It failed at the end when it tried to register the dll. It said it was not a valid file.. I tried to register it manually after that and got the same results. Any other suggestions.
Can you mail me your project?

My email is jjbyers@yahoo.com

I'll see if I can figure it out.
I just changed the project name from printreport.vbp and .dll to printrep.vbp and .dll, recompiled and ran the install on the server and it was fine. What could have been the problem? Maybe the long filename.
Probably something got corrupted in the compile process.

Glad it's working.
Thanks for all your help.
I was able to install the dll on the web server. I went into Access on the server to test the dll by using the following:
  dim x as new TestReport.Application
  testreport.Printreport 1
  set x = nothing
This printed the datareport to the server.

In a ASP however:
  dim x
  set x = CreateObject("TestReport.Application")
  x.PrintOrder 1
  set x = nothing
The object is created ok, but I get an error on the printorder call:
"Data Report error 800a216b"      "Error obtaining printer information."
The dll has a datareport form in it that prints out a record in a database.
Any suggestions. Thanks
Do you have a default printer on the server?
Yes, there is a HP printer hooked directly to the web server and is set as the default printer. Could this be a rights issues or do you have any other suggestions.
Make sure I_user_machinename has rights to use the printer.

Beyond this I'm almost out of suggestions.
I setup the printer on the server to have Full rights for everyone and I get the same results.
If you have any other suggestions I would appreciate them.
I hate to say this but I'm out of suggestions. You might have to log a call to MS.

Sorry
I am facing a similar problem and getting same error message  "Error obtaining printer information.", but am calling the dll from SQL Server stored procedure.
JFreisen please let me know if your problem is solved and how, I am in great urgency.

thanks in advance
Manish