OK sorted it. If anyone else is interested heres what you need to do,
step by step!
1/ Build the Printer Delivery Sample as per the documentation. Pay
particular note to the format of the printer name in the <printers>
section of the config file - this caused me no end of problems as what
names were in the printers and faxes folders were not those found
using the PrinterSettings() class which the printer sample uses!
2/ Follow the destructions in the Reporting Services Books Online for
'Debugging Delivery Extension Code' - ensure you have the latest
version of books online avail from
http://www.microsoft.com/downloads/details.aspx?FamilyID=5e550d73-8f35-435e-bb71-c8573a1cdbdb&DisplayLang=en 3/ Open your browser and point to http://localhost/reports (in my case
anyway). Goto a report you have and create a subscription to that
report- in the delivered by, select the printer sample option, choose
a printer and a time to run the report (I used every two mins so it
was easy to debug)
4/ Now back in VS with the printer sample code open, goto
Debug/Processes and select both aspnet_wp.exe and
ReportingServicesService.exe - click on attach and only select CLR
5/ Shove some breakpoints on your code (a good one is IsValidPrinter()
method) and return to the webpage for the subscriptions & make changes
if you like - the code should break on the line when the page is
rendered.
6/ When your report fires, if you have a breakpoint set for the
rendering parts i.e. PrintReport(), you can trace through this too.
Thats it. Ok now onto solving my problem. I found out that when the
subscriptions page was being rendered after creating a new
subscription, IsValidPrinter was returning the correct printers
installed under my profile (domain admin). The subscription was
created ok but when it came to run, the reportingservicesservice.exe
process is obviously running as LocalSystem account and consequently
does not know anything about my persoanally installed printers!!
Therin the problem lay.
For now, i've simply commented out the line checking for a valid
printer :
if (!IsValidPrinter(data.Printer))
throw new Exception("The printer " + data.Printer + "
is not currently installed on the server.");
within PrinterDeliveryProvider.cs. The sample then works as promised.
I then thought how about changing the LocalSystem account for the
service to my own domain account, surely it will see all the printers
then? Well no, it just refused to work, got the error:
An unhandled exception of type
'Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerDisabledException'
occurred in microsoft.reportingservices.diagnostics.dll
Additional information: The report server cannot decrypt the symmetric
key used to access sensitive or encrypted data in a report server
database. You must either restore a backup key or delete all encrypted
content and then restart the service. Check the documentation for more
information.
I'm gonna keep playing with this sample now that i'm actually getting
somewhere, i'll update the post as I get on with it.
Any microsoft guys got any comments on what i've done & how better to
do it? Particularly getting the correct printers would be great!
Cheers
Si
[quoted text, click to view] On Wed, 25 Aug 2004 14:40:23 +0100, Si <no@spam.thanks> wrote:
>Howdo,
>
>I'm trying in vain to get the Printer Delivery sample working,
>originally I was getting errors like 'this printer is not installed'
>etc, after debugging the code in vs, I managed to sort that one out.
>
>Now I cannot seem to debug the actual process that sends the jobs to
>the printer - currently attached to aspnet_wp.exe, should I be
>attaching to any other processes? I just want to follow through to the
>errors where I get an exception thrown in line 350 of
>PrinterDeliveryProvider.cs - printer is not currently installed etc
>
>If I shove a breakpoint on say IsValidPrinter(), I get a break in
>there when I go into the page for setting up a new subscription - what
>I want to do is follow it from there on.
>
>It's got to the point where I can't even get any timed subscriptions
>to fire off - got one set to go every two mins but nothing is
>generated and within the reportmanager web interface (all web based)
>under 'Last Run Status' I just get 'New Subscription'
>
>Any suggestions, Ideas, do I make sense?
>
>Cheers
>
>Si