Custom Paper size did not work on IIS for printing a crystal report

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Custom Paper size did not work on IIS for printing a crystal report

  1. #1
    Join Date
    May 2007

    Custom Paper size did not work on IIS for printing a crystal report


    I am facing two problems in web based application running on local intranet enviornment using 2.0 and IIS 5.1

    I have to print a receipt on letter half size. This size is not available by default. so I add the new paper size in
    Printer and Faxes->File->Server Properties with the name of Letter half(height = 5.5" and width=8.5").

    The following code i used to print the recipt.

    for (int a = 0; a < printDoc.PrinterSettings.PaperSizes.Count; a++)

    if (printDoc.PrinterSettings.PaperSizes[a].PaperName == "LetterHalf")

    rawKind = (int)printDoc.PrinterSettings.PaperSizes[a].GetType().GetField("kind", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(printDoc.PrinterSettings.PaperSizes[a]);



    myReportDocument.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
    myReportDocument.PrintToPrinter(1, false, 0, 0);

    The code works fine when i run the code in development enviornment. but when i publish this site to IIS then it does not get the paper size and print the receipt on full letter size paper.

    I have to get the list of all printers(Local and network) installed on the server. For this purpose, I use the following code.

    foreach(string str in System.Drawing.Printing.PrinterSettings.InstalledPrinters)


    The code works fine when i run in the development enviornement but when the site is published on the IIS then it only shows the local printers installed not network printers.
    So how i can get all the printers (local and network) when running on IIS.

    Enviornment= Visual 2005
    Language= C#
    Windows= Window server 2003 and Windowx XP
    IIS Version= 5.1
    Reports= Crystal reports

    Anyone knows how to resolve these issues.


  2. #2
    Join Date
    Aug 2009

    Custom Paper Size setting in IIS using Crystal Reports

    Hi Shuja

    Any update on your problem,

    We are also facing the same kind of problem.

    Please help us if you got the solution


  3. #3
    Join Date
    Jul 2012

    Any Answer?

    Dear shujamughal & rajkumar.balan,

    Any update for your issue?
    Since I'm facing the same problem in here..
    Could you please help?


Similar Threads

  1. Crystal report printing in VS but not in IIS
    By danmbuen in forum ASP.NET
    Replies: 0
    Last Post: 06-20-2007, 06:09 AM
  2. how to redistribute crystal report 11
    By gsreejit_79 in forum VB Classic
    Replies: 2
    Last Post: 04-28-2006, 12:55 PM
  3. Replies: 1
    Last Post: 11-08-2005, 08:42 AM
  4. Problem with changing paper size in VB6+WinXP
    By kdotb in forum VB Classic
    Replies: 0
    Last Post: 08-08-2005, 01:59 PM
  5. Replies: 1
    Last Post: 06-14-2002, 03:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center