-
Custom Paper size did not work on IIS for printing a crystal report
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
Similar Threads
-
By danmbuen in forum ASP.NET
Replies: 0
Last Post: 06-20-2007, 06:09 AM
-
By gsreejit_79 in forum VB Classic
Replies: 2
Last Post: 04-28-2006, 12:55 PM
-
Replies: 1
Last Post: 11-08-2005, 09:42 AM
-
By kdotb in forum VB Classic
Replies: 0
Last Post: 08-08-2005, 01:59 PM
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|