问题
I am having some trouble trying to get a report to print from a service that does not allow UI interaction.
Currently I can do the following
Dim myReport As New MyXtraReport(myData)
myReport.CreateDocument()
'Then I attempt to do the following
DirectCast(myReport.PrintingSystem, PrintingSystem).Print
However nothing happens when I do this. I don't get any exceptions just no document is printed.
Calling
myReport.Print()
will print the correct document but with UI interaction. What am I missing or is this just not intended to be viable.
I have also tried using the myReport.PritingSystem.ExecCommand(PrintDirectly)
but it also doesn't print anything.
回答1:
You only need to call the Report's Print method:
new XtraReport1().Print();
I've tried this and it works. If it does not work, I suggest that you post a sample in the support center and we will try to help you.
来源:https://stackoverflow.com/questions/4660178/devexpress-xtrareporty-print-without-any-ui-interaction