TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shaiwal Tripathi
NA
129
5.7k
Cannot print the custom paper size in crystal report c#
May 5 2020 3:56 AM
I am trying to print custom paper size (8.5in Wt. x 5.5in Ht.)
My Printer does not allow to create custom paper size when Width greater than Height. So I decided to do it dynamically through c#. Here are the steps I have done.
Step1:- Created a custom paper size from Print Server Properties under Devices And Printers and named it JVD
Step2:- My C# Code
using
(DataSet Ds = GetPrintDetails(Dt, Con))
{
HospDataSet.Tables[
"ME_ProductSale"
].Merge(Ds.Tables[0]);
HospDataSet.Tables[
"ME_ProductSale_Detail"
].Merge(Ds.Tables[1]);
HospDataSet.Tables[
"ME_Identity"
].Merge(Ds.Tables[2]);
ReportPath = Environment.CurrentDirectory +
"\\Reports_ME\\rptProductSale.rpt"
;
rptDoc.Load(ReportPath);
rptDoc.SetDataSource(HospDataSet);
PrintDocument PD =
new
PrintDocument();
for
(
int
i = 0; i <= PD.PrinterSettings.PaperSizes.Count - 1; i++)
{
if
(PD.PrinterSettings.PaperSizes[i].PaperName ==
"JVD"
)
{
rptDoc.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)PD.PrinterSettings.PaperSizes[i].RawKind;
break
;
}
}
rpvHospitalReportViewer.ReportSource = rptDoc;
rpvHospitalReportViewer.Refresh();
}
But still not able to print custom paper size. What I am doing wrong?
Any help will be appreciable.
Reply
Answers (
1
)
.net core application session lost
Entity Framework -Database first approach