Creating MS Access reports as PDF's using .Net Windows Services

I have a windows service running on a Windows 2000 server that opens up an instance of Microsoft Access 2000, saves an access report as a pdf file on the server, and then emails the pdf file to a group of users.  Just recently, the section of the code that creates the physical pdf file stopped working.  The service code was written in and opens up an instance of MS Access using impersonation of a user that has appropriate rights on the server. 

I have recreated this service code as a console app, and when executing the console .exe, the pdf file is created and everything works fine.  However, when the service runs the same code, the following error is logged:

<< There was a problem retrieving printer information for the Win2PDF on PDFFILE:. The object may have been sent to a printer that is unavailable. >>

In this case, Win2PDF is the name of the pdf printer driver and PDFFILE: is the name of the port.  I have narrowed down that the pdf driver seems to be working fine, as I can create a pdf file when running the console application.  Also, the user that I am using for impersonation purposes has not expired or anything like that, as the same service is sending out excel reports as this user.  Just the ability to create pdf files seems to have gone away when the service executes the code. 

Does anyone out there have any ideas as to what might have happened all of the sudden where the pdf file cannot be created?


Thanks in advance.


4/10/2008 12:49:25 PM 1945 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 38

Hi John,

I want to do a similar kind of thing ie saving a sql server report as a pdf on the server using windows service and email to a group of users. Can you please send me the code for what you have done so that I get an idea about how to do this in .net ?



5/14/2008 12:47:46 AM

I am not able to send you any code as I am contractually obligated to keep the code for my client projects confidential.

However, the route you want to go is using a pdf driver to stream text to a file using the system.IO namespace (you are creating the physical file on the server somewhere.  You can delete the file afterwards).  You'll know the location of this file and can then use the .net system.web.mail namespace for emailing purposes.  Windows services is a pretty broad topic for a message thread.  I would suggest digging up knowledge base articles or buying a book on how to put one of these together.



5/14/2008 12:09:51 PM

Similar Artilces:

Creating report while MS Access database is open causes error "Cannot create a connection to data source 'xyz'. (rsErrorOpeningConnection) file already in use
Hi All We have a small MS Access application for tracking our time worked on projects. The database is MS Access. We have created reporting services reports to display data about time spent on different projects etc. Whenever someone is running the MS Access application to track their time, none of the reporting services reports will display. the following error occures. An An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'XYZDatabase'. (rsErrorOpeningConnection) Could not use ''; file already i...

IBM's WebSphere vs. MS's .NET (article) "Unlike Microsoft's model, which only allows Windows applications to communicate with other Windows applications, WebSphere is committed to an open source environment. " -- JB Learn the Hazards ...

how to create crystal report using VB.NET with the database of ACCESS
hi..! i want to create crystal report of my project.em using access database...!   but i have no idea how to create reports using VB.NET with the access db  i create the report but it shows only one record  hi ......You can do it PUSH method of creating crystal reports...!!!!! In push method Typed Dataset is used as the data sourcefor crystal report...!!!Steps for creating the report could be.....1. add a typed dataset to your solution.2.go to server explorer.3.connect your access file to your server explorer. 4.Change data base.. 5.attach access file..!!6.test ...

Sending SMS using or using or
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

plz any resource for using crystal report with MS access and VB.NET
hi all i'm so despret for a resource telling me how to generate reports from MS access using VB.NET under VS2005 ... i'm still new to all the programming thing, so i need something simple  need to know how to - send Parameterized query to the report ?- what is the difference between using a dataset and use the other connections?- how to create sub-reports?- how to send the DB password from the webconfig file to the report?[:'(]plz guys i've been looking for weeks for any resource .. i posted many messages here but no one gave me an answer thanx in advance ... any help wi...

Converting windows application using web service from Visual 2003 to Visual 2005
Hello, everyone! I have a solution which contains a windows project,a web service project and several other library projects. These projects were coded under visual 2003. Now I need to converted them to use Visual 2005. Does any one know any article providing step-by-step guide  to converting WINDOWS APPLICATION with web service? I can find one under MSDN for converting web project.  But I guess I am a little confused if mine should follow this article since I am using web service in my windows application? Thanks a lot in advance.  ...

Access Denied while window service in .net trying to create a file on remote server
Hi,              I am facing serious problem while running window service.              My window service is running on remote machine(in the same private network) and I am trying to create a file using window service on my machine. When I am trying to create the file, the path I am giving is \\MyMachine\MyFolder. But, is giving 'Access Denied' exception. I need this asap. Hope I will get the response soon.   Thanks in advance, Kalyan.    &nb...

Access data using web service from a Dot Net windows user control
Hi, I have a Windows Control Library and many UserControls in them. I added the output .DLL to another web project. I have put the dll in the root folder of the website. Now, in my .aspx pages I will declare <object> as follows. <object id="some id" name="some name" classid="some.dll#namespace.usercontrol name" width="578" height="404">    <param name="DAWebServiceUrl" value="<%=DAWebServiceUrl%>" /></object> This works fine if the url of the website has LOCALHOST. If I use t...

Crystal reports don't run well after Windows Update installs .net 2.0 and .net 3.5
 I have a web reporting application build using VS2003 and Crystal ver 9.5.Everything was working fine until the infrastructure team run the windows 2003 server WINDOWS UPDATE where the new .net 2.0 & .net 3.5 got installed.I started to get CrystalDecisions.CrystalReports.Engine.InternalException: Error in File:crreport5.rpt -The request could not be submittted for background processing.After I restart IIS , the reports start working again but they stop after a while and I have to restart again ...Please, advise.    ...

Use VB6 to access VB.NET Dll's without losing itellisense?
I'm not sure what I want to do is possible, nor am I sure of what terms I should be looking for when searching for information about this. I want to make my .Net dll's as normal in VB or C# or whatever. I also have VB6 COM Dll's. I'd like to somehow have the VB6 COM be able to talk to the .NET DLL's without having to make the .NET Dll's into ones you have to register with RegSvr32.exe . A) I have no idea how to do this or where to begin. B) I thought you might be able to have a sturcture like this: [VB-COM-DLL] <--> [Intermediate-.NET-DLL] <---> [.NET-Classes] <---...

Wants to access Ms Project's .mpp file from my web application in VB.NET
I have developed web application,which contains TODOList,so i have to display tasks of loged in user.For that i have to fetch the data from MS Project 2000's .mpp file which is already created. i want to access that file Please help me .......... Hi Savitha ,  I am in search of same info , as  i need to integrate my  web based project with microsoft project management tool to do project scheduling from web interface.  Please  inform me if u have any  links or info regd this.  Thanks...

100% Free
See MyGeneration's Website. We fully support Access and provide a free .NET architecture called dOOdads available in both C# and VB.NET. We even generate Access Stored procedures for you. Give us a look, we're free and can save you 100's of man hours. We just released 1.0, we support 10 different DBMS systems including Microsoft SQL, Oracle, IBM DB2, MySQL, PostgreSQL, Microsoft Access, FireBird, Interbase, SQLite and VistaDB. ...

ISAPI 'C:\Windows\\Framework\v.1.1.4322\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'.
In our web application we are calling different XML Webservices and make approximately 25 calls every 10 minutes. We use a separate thread to call a the webservice (Crawler) and populate our cache -- our application then retrieves the data from the Cache -- the cache is set to expire in approximately 25 minutes -- but since the Crawler populates the cache every 10 minutes with the new data -- thus it never expires. In above scenario -- our webserver seems to stop responding after some hours and we noticed that somehow requests to Webservices were ...

Creating Reports using Crystal Reports for Visual Studio .NET
Hi i am trying to create a crystal report using C# coding but instead of creating a web application under new project i decided to choose create an website with C#. The problem is i get:- The report you requested requires further information. --------------------------------------------------------------------------------XP\SQLEXPRESS  Server name:    Database name:    User name:    Password:    All data is present except my password when i enter it, it works fine and the report works too with no problems. How do i ...

Web resources about - Creating MS Access reports as PDF's using .Net Windows Services -

Resources last updated: 1/22/2016 1:37:31 PM