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

  • Question

  • User965894183 posted

    Hi

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

    Problem=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);
                 myReportDocument.Close();
                
                
    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.


    -----------------------------------------------------------------------
    Problem=2
    -----------------------------------------------------------------------
    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)
                {

                    DropDownList1.Items.Add(str);
                }
               
     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 Studio.net 2005
     Language=  C#
     Windows= Window server 2003 and Windowx XP
     IIS Version= 5.1
     Reports= Crystal reports


    Anyone knows how to resolve these issues.

    Regards
    Shuja

    Tuesday, May 13, 2008 7:30 AM

All replies

  • User965894183 posted

    Is anybody there to reply?

    waiting...

    Saturday, June 7, 2008 1:26 AM
  • User965894183 posted

    Hi Folks,

    I am getting old in waiting... Does anybody know anything? or now i should assume no answer for it.


    Thanks

    Shuja



    Sunday, August 15, 2010 5:40 PM