I have read many post about this here on stackoverflow(most links to Microsoft are not displaying the page for help to explain this as of Jan 9 2018 ) and even did a bypassprintpreview.cs file and everything seems to work except for a few issues.
My question is what is the best practice to skip the ReportViewer and send to the default printer in a C# MVC Project.
Is this printing it to a PDF then send to the printer, Drawing it out then printing or are there NuGet packages that anyone can recommend.
I found a solution for this question in this link How to print directly without showing report viewer in rdlc report, i used this class and it work for me in Windows Forms Application and Web Application but my web application was Hosted on IIS so this did not work for me because the app was not able to access the client installed printer, so the best solution for me was in this video, I created i console application 'PrintDirect' and Registered protocol on system to access this console application and send the parameter by anchor link like this
click to print order 1906187<br />
I hope the solution is clear
Related
I have got an application that needs to print reports at a distant location connected via the internet. Since there is no network printer we have to send reports generated through email and wait for someone to print them.
I was thinking if I can use windows service to automate the task
I've got the following options
get data from SQL Server base on filters transferred from distance location to generate crystal report and print it to the default printer.
get the report in pdf format from distance location & print it to the default printer
is any one of the options possible.
I'm asking for some help here since I've not created a windows service up till now for anything
Your guidance is highly applicated
Thanks a lot
Amit Saraf
Yes, your application can use the Crystal runtime and trigger a printout or an export of a report without any display to the screen.
Alternatively, the application can use a command line API of several cheap/free 3rd-party Crystal tools (typically, they are called viewers or schedulers) to achieve the same thing. The command line API would allow you to specify the rpt file, parameters, login info, printer destination, export format, export file, etc.
Yess window services generate and print the crystal report:
Firstly you have install the packages from nuget but you have use VS.
Step 1: Create the Database
Step 2: Create the Window Service
Step 3: Install the Windows Service
Also help from this link:
http://aspalliance.com/1917_Automate_delivery_of_Crystal_Reports_With_a_Windows_Service.3
a while back i made a C# Windows Forms which generates PDF report by using itextsharp.
Also, I made phonegap app that communicate with SQL Server that can DELETE, UPDATE and SELECT from database and it's working fine.
Now here is my question
How can I send data from Phonegap application to C# windows form, which run on the server side, to generate A PDF report?
This is what I found out so far and i'm not sure if i am going in the right direction
1.Re-write the code of C# Windows form to asp.net form
2.make a C# webservice which can receive data from phonegap and use asp.net to generate a PDF Report.
3.webservice should be at server side running 24/7
All I want is that "something" should be at the server side waiting for data, once it receives data it should make a pdf report out of it.
Thank you and I hope that was not confusing.
I just need to be pointed at the right direction.
Finally I found the answer i was looking for.
These are the main points I mentioned on my question:
I made C# Desktop app for generating PDF report using iTextsharp
I want a Phonegap app to generate PDF report by sending data to C# desktop application.
The answer simply is to make C# web service and consume this web service from phonegap. it took me some time but it's working perfectly.
I am using Bartender Enterprise Automation edition for Label Printing. As of now, Bartender is installed on machines on which we intended to print the labels from.
Now, I have an windows forms C# application, which invokes Bartender Engine and prints the labels.
If a machine does not have Bartender Install on it, my app can not print the labels.
So, is there a way to install Bartender on a single machine (let's say our production server which is up and running 24 X 7 and on local network connected to each and every machine ) and whenever "Print Label" button is pressed from my Windows Forms application, necessary data and Label Template file (.btw) will be sent to that machine and that remote machine will print the labels for me.
this way I won't require to install bartender each and every machine in my company. I did try looking for the solution online but there isn't much documentation for this online.
Please share some knowledge if someone have explored in this area.
Bartender do have support for Web Print Server , I am not sure if it is available for the version you mentioned.
It works like this : https://www.barcodesinc.com/news/?p=3203
http://www.seagullscientific.com/media/101387/web-based-barcode-and-label-printing.pdf
These are some helpful links related to this topic :
I have been working on this and seeking solution as you have asked but no luck. Unfortunately you have to install BarTender suite on each client. My organization has purchased enterprise license 2016 and I thought that Print Portal and Print Maestro might solve this problem but they both are developed for different purpose.
I haven't tried both of them yet. If you find anything, let me know. Thanks
You should be able to solve this with using BarTender Integration. Integration is used to automatically print labels without having a user see BarTender. If you can export your data to a csv file and drop it in a folder BarTender Integration will be able to pick it up and print it to the correct template. The integration will run from a server so you don't need to install it on every computer.
I have an idea, since you do not like to install Bartender all over the machines in your company. Then i suggest you to create another windows form c# application to communicate with the one you have originally to print labels.
You should be able to print labels to different printers through local network.
PC A
Installed Bartender and Have the windows form c# application to print labels
PC B
Do not have Bartender installed
Have another windows form c# application to send information to PC A
I have a web forms application that creates a PDF and sends it to the client. It was all well and dandy until I uploaded the aplication to Windows Server 2012 R2. The problem might be some printer settings on the server (this is my first time working with a server).
The problem is Server 2012 doesn't support Windows Print to PDF, which I used on local machine and it worked great.
I gave a shot to CutePDF Writer: installed it and set it to default printer in Printers and devices. When I run the application, I get the following error:
System.Drawing.Printing.InvalidPrinterException: No printers are installed
I tried this and it generates the PDF but fails and I get an error when I try to open the PDF:
PrintDocument.PrinterSettings.PrinterName = "CutePDF Writer";
This line returns "true":
PrintDocument.PrinterSettings.IsDefaultPrinter
while this line returns "Default printer is not set.":
PrintDocument.PrinterSettings.PrinterName
I gave a shot with this, but returns "false":
Setting the default Printer for windows using c#
Please help!
The answer is trying a different approach. I shouldn't have tried working with the virtual printer (i haven't found a way to make it work).
To create a PDF from code, the best way is using iTextSharp.dll. With that you need a handful of code. Yes, I had to implement the report-creating and printing logic all over again, but it was actually easyer than the previous approach. iText is pretty straightforward and easy to use!
How can I print PDF directly to a printer with (asp.net) C#?
I actually want to print the PDF directly without showing a dialog on the server side in asp.net c#
You'll be hard pressed to make this from asp.net if the server isn't residing in the same LAN as the client and can have the same printers installed, this due to security functions inside the web browsers not allowing websites to print to a local machine. You might get a solution for this if you implement some ActiveX Component or Java applet to run this (even seen it in Silverlight, but that's going away).
Something like http://www.vbgold.com/index.shtml#AdvancedPDFPrinter might help you achieve what you're looking for.