15,886,110 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10989312 (Top 16 by date)
Member 10989312
4-Apr-15 2:51am
View
No printer(Optimised for Screen Display) option is unchecked only and below dropdown list contain "\\ADMIN\HP LaserJet 1020" printer name.
Member 10989312
2-Apr-15 12:22pm
View
Yes, i tried, but i am getting same error.
Member 10989312
2-Apr-15 12:21pm
View
Yes, i am able to print all documents from my system
Member 10989312
2-Apr-15 7:50am
View
Thanks for your reply, I tried the below lines i am getting the error. ".Invalid printer specified."
cryPrntRpt.PrintOptions.PrinterName = @"\\\\ADMIN\\HP LaserJet 1020";
Member 10989312
3-Jan-15 4:38am
View
i placed the code after report export line, it was showing that the printer name as "Send To OneNote 2013" and there is no exception.
Member 10989312
3-Jan-15 2:03am
View
i am not getting any error... in the button click event after print code i am exporting to pdf, and the pdf file is storing on d:\pdf folder successfully.
protected void BtnApprove_Click(object sender, EventArgs e)
{
ReportDocument cryPrntRpt;
cryPrntRpt = new ReportDocument();
cryPrntRpt.Load(Server.MapPath("~\\CrReports\\CrPrintReport.rpt"));
cryPrntRpt.SetDatabaseLogon("UNM", "PWD", @"SRVNM", "MYDB");
cryPrntRpt.PrintToPrinter(1, false, 0, 0);
try
{
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
cryPrntRpt.PrintToPrinter(1, false, 0, 0);
CrDiskFileDestinationOptions.DiskFileName = "D:\\PDF\\" + Regno.ToString() + ".PDF";
CrExportOptions = cryPrntRpt.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
cryPrntRpt.Export();
}
catch (Exception ex)
{
//Message(ex.ToString());
}
con.Close();
}
Member 10989312
3-Jan-15 1:38am
View
i tried with the above code, problem not sloved...i am not getting any error also...
Member 10989312
3-Jan-15 1:13am
View
Report is showing on pageload and it is also exporting to pdf, after displaying the report on button click event (Approve Button) i want to take printout.
protected void Page_Load(object sender, EventArgs e)
{
ConnectionInfo myConnectionInfo = new ConnectionInfo();
myConnectionInfo.ServerName = "SRVNM";
myConnectionInfo.DatabaseName = "MYDB";
myConnectionInfo.UserID = "UNM";
myConnectionInfo.Password = "PWD";
setDBLOGONforREPORT(myConnectionInfo);
}
private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
{
TableLogOnInfos mytableloginfos = new TableLogOnInfos();
mytableloginfos = CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
{
myTableLogOnInfo.ConnectionInfo = myconnectioninfo;
}
//ReportDocument cryPrntRpt;
cryPrntRpt = new ReportDocument();
cryPrntRpt.Load(Server.MapPath("~\\CrReports\\CrPrintReport.rpt"));
cryPrntRpt.SetDatabaseLogon("UNM", "PWD", @"SRVNM", "MYDB");
}
Member 10989312
11-Nov-14 11:45am
View
Oh.... Very Very Thanx Mr.Richard its working. I added the FileStream in Using block. its working.
Member 10989312
11-Nov-14 11:31am
View
I am very sorry. I dnt have much knowledge in asp.net. In processExplorer i found that
Process: w3wp.exe
PID : 5168
Type : File
Name : C:\Mypdf\CC35.Pdf
Member 10989312
11-Nov-14 11:16am
View
After memoryStream.Close(); and before sending the mail i am using the below code for saving pdf file in my local systme.
var output = new FileStream(Path.Combine("c:\\myPDF\\", "CC" + result + ".pdf"), FileMode.Create);
var writer1 = PdfWriter.GetInstance(document, output);
Member 10989312
11-Nov-14 11:13am
View
i am not getting any error in my code. In email also i can open the attachment but the same file is stored on my local drive(C:\Mypdf) folder. When i try to open the pdf file from my local drive folder i am getting the error.
Member 10989312
11-Nov-14 11:04am
View
Yap.. I tried, now i am getting There was an error opening this document. This file is already open or in use by another application
Member 10989312
11-Nov-14 10:52am
View
when i open the pdf file i am getting "Adobe Reader could not open 'CC21.PDF' because it is either not a supported file type of because the file has been damaged(for example, it was sent as an email attachment and was't correctly decoded).
Member 10989312
11-Nov-14 10:42am
View
The email is sent successfully with pdf attachment file but i am not able to store it in my local system folder.
Member 10989312
11-Nov-14 10:39am
View
var output = new FileStream(Path.Combine("c:\\myPDF\\", "CC" + result + ".pdf"), FileMode.Create);
var writer1 = PdfWriter.GetInstance(document, output);
Dear Afzaal Thanx for your reply. The pdf file is stored in C:\MyPdf folder but not able to open.
Show More