Monday, March 19, 2012

Error in sample PrinterDeliveryProvider.cs?

The Deliver method in the sample returns false if the delivery is successful
and never sets the Notification.Retry flag. Both seem to contradict the
documentation. Please confirm that the sample is wrong and the
documentation is right.
Thanks,
- SteveThat is true. The documentation is correct. The printer delivery extension
sample should be changed to reflect the documentation.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Stephen Walch" <swalch@.proposion.com> wrote in message
news:OpQ$ZirXEHA.3512@.TK2MSFTNGP12.phx.gbl...
> The Deliver method in the sample returns false if the delivery is
successful
> and never sets the Notification.Retry flag. Both seem to contradict the
> documentation. Please confirm that the sample is wrong and the
> documentation is right.
> Thanks,
> - Steve
>|||One more thing. To make the sample more accurate, I would recommend changing
the retry flag to a success flag, like:
public bool Deliver(Notification notification)
{
bool success = false;
// Set the status of the notification to pending
notification.Status = "Processing...";
try
{
// Build user data
Setting[] userSettings = notification.UserData;
SubscriptionData subscriptionData = new SubscriptionData();
subscriptionData.FromSettings(userSettings);
// Print the report
PrintReport(notification, subscriptionData);
// If delivery is successful return false
success = true;
}
catch (Exception e)
{
// Set the status of the notification if an error occurs
// and attempt retry
notification.Status = "Error: " + e.Message;
success = false;
}
finally
{
// Finally, save the notification information
notification.Save();
}
return success;
}
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Stephen Walch" <swalch@.proposion.com> wrote in message
news:OpQ$ZirXEHA.3512@.TK2MSFTNGP12.phx.gbl...
> The Deliver method in the sample returns false if the delivery is
successful
> and never sets the Notification.Retry flag. Both seem to contradict the
> documentation. Please confirm that the sample is wrong and the
> documentation is right.
> Thanks,
> - Steve
>|||Don't you also want to set the Retry flag?
catch (Exception e)
{
// Set the status of the notification if an error occurs
// and attempt retry
notification.Status = "Error: " + e.Message;
notification.Retry = true;
success = false;
}|||Hi,
During to build "Sample Printer Delivery Extension", the document write:
2.Issue the following command to create the sample delivery extension
Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll.
csc /t:library /out:Microsoft.Samples.ReportingServices.PrinterDelivery.dll
*.cs /r:Microsoft.ReportingServices.Interfaces.dll
During to build "Sample Printer Delivery Extension", the
How should I Implement this command? Please give me advice, thanks for your
time!
Angi|||CSC is the C# compiler which ships with the .Net Framework. It should be
installed on your computer if you installed the .Net Framework v. 1.1.4322.
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"angi" <angi@.microsoft.com> wrote in message
news:uCWemPUbEHA.3752@.TK2MSFTNGP12.phx.gbl...
> Hi,
> During to build "Sample Printer Delivery Extension", the document write:
> 2.Issue the following command to create the sample delivery extension
> Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll.
> csc /t:library
/out:Microsoft.Samples.ReportingServices.PrinterDelivery.dll
> *.cs /r:Microsoft.ReportingServices.Interfaces.dll
> During to build "Sample Printer Delivery Extension", the
> How should I Implement this command? Please give me advice, thanks for
your
> time!
> Angi
>|||You can also build it by opening the .SLN file in Visual Stidio.NET 2003.
-Steve
"angi" <angi@.microsoft.com> wrote in message
news:uCWemPUbEHA.3752@.TK2MSFTNGP12.phx.gbl...
> Hi,
> During to build "Sample Printer Delivery Extension", the document write:
> 2.Issue the following command to create the sample delivery extension
> Microsoft.Samples.ReportingServices.PrinterDeliverySample.dll.
> csc /t:library
/out:Microsoft.Samples.ReportingServices.PrinterDelivery.dll
> *.cs /r:Microsoft.ReportingServices.Interfaces.dll
> During to build "Sample Printer Delivery Extension", the
> How should I Implement this command? Please give me advice, thanks for
your
> time!
> Angi
>

No comments:

Post a Comment