Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I have problem of Custom paper size 8.5*6.00 in my crystal report. I have developed in VS 2008 and it working fine in my local but after i deploy in II7 server 2008 its taking default letter size, my code for custom size is as below,



System.Drawing.Printing.PrintDocument doctoprint = new System.Drawing.Printing.PrintDocument();
int rawKind = 0;
for (i = 0; i <= doctoprint.PrinterSettings.PaperSizes.Count - 1; i++)
{
if (doctoprint.PrinterSettings.PaperSizes[i].PaperName == "DC")
{
rawKind =
Convert.ToInt32(doctoprint.PrinterSettings.PaperSizes[i].GetType().GetField("kind", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(doctoprint.PrinterSettings.PaperSizes[i]));
// break;
// }
//}
rawKind = GetPaperSizeID();
rpt.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
CrystalReportViewer1.ReportSource = rpt;
Posted
Comments
Member 10308099 5-Sep-14 7:45am    
HI,
I have tried the link below given by you but m not getting my custom paper size, still its taking default letter only....
Set custom paper size in crystal report on web server in asp.net c#[^]

1 solution

 
Share this answer
 
Comments
Member 10308099 5-Sep-14 7:37am    
HI,
I have tried the link below given by you but m not getting my custom paper size, still its taking default letter only....
Set custom paper size in crystal report on web server in asp.net c#[^]
thatraja 5-Sep-14 8:28am    
Member 10308099 5-Sep-14 9:44am    
Hi Thatraja,
I tried with "No Printer" as you told but also m not getting the expected result. Kindly give me the solution. i searched lot for this issue but i didnt get solved yet.
thatraja 5-Sep-14 9:46am    
Let me search & update, give me some time
Member 10308099 5-Sep-14 9:49am    
Thanks ,
some more information on my issue, earlier i deployed my application in server 2003(32 bit), it was working fine . but when i migrated to server 2008(64 bit) and iis7, m facing this issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900