I need to be able to print reports from the server, and pick a printer. I have an app that is deployed on Android tablets and they need to be able to print out guest passes once they complete a registration. I can’t seem to find any real info on how to do this. I do not/cannot have any real dialog or preview, needs to be fast including printing. Don’t want to create a windows app that sit’s on the server and polls the database to see if it should print something. There must be an easier way.
Print from ASP.NET
Tagged: ASP.Net Printing.
kareztt1 4 weeks, 1 day ago
Here is some sample code
Dim objReport As New GuestPass
It causes a blank page to be spit out on the printer. The report has a label and rectangle on it. So it is not “running” the report even though debugging indicates that it is.
Deepak Sharma51p 4 weeks, 1 day ago
To print the report directly to the printer without viewing it. you may use the code as follows:
Dim rpt = New SectionReport1() rpt.Run(False) Dim sectionDocument = rpt.Document sectionDocument.Print(True, True, False)
In case you face any issues printing the report, you may test it by viewing it and then printing it from the viewer.
SylWalker 1 week, 2 days ago
I’m having a similar problem in WPF, using MVVM. I have added the above code, but can’t find a ‘Print’ method on rpt.Document, only on rpt.Document.Printer. When stepping through the code the ‘rpt.Run(False)’ statement caused the report to be rendered as expected.
I have included using statements for ActiveReports, and ActiveReports.Extensibility.Printing.
AbdiasM195p 1 week, 1 day ago
The rpt.Document.Print method is available in the ActiveReports namespace itself. Do you get an error on running the application? Can you please attach a screen shot?
SylWalker 3 days, 5 hours ago
I can’t compile – I’m getting a syntax error on the “rpt.Document.Print();” statement. The error is:
“‘SectionDocument’ does not contain a definition for ‘Print’ and no extension method ‘Print’ accepting a first argument of type ‘SectionDocument’ could be found(are you missing a using directive of an assembly reference?)
My class has ‘using GrapeCity.ActiveReports;’, and a reference to ‘GrapeCity.ActiveReports.v11′ as well as several other Active Reports dlls.
AbdiasM195p 2 days, 10 hours ago
Please try removing all the AR references and re-adding them in your application. It may be caused due to a mis-match in the version of dlls. If the issue persists, can you please share your application here? You can delete the bin and obj folders and zip it to reduce the size.
SylWalker 2 days, 5 hours ago
We figured out how to fix the problem.
I’m in a WPF application, so I had a reference to the WPF viewer, GrapeCity.ActiveReports.Viewer.Wpf.v11; evidently, the print functionality is included with the WinForms viewer, GrapeCity.ActiveReports.Viewer.Win.v11.
AbdiasM195p 1 day, 13 hours ago
Yes, the GrapeCity.ActiveReports.Viewer.Win.v11 dll is required for the Print method to work as mentioned here – http://arhelp.grapecity.com/webhelp/AR11/index.html#PrintMethodsInActiveReportsDeveloper.html
I assumed you had this added in your project already. It was a miss. I’m glad it’s working for you now.
You must be logged in to reply to this topic.