Cannot print on x64 Windows Server 2008 after update 30.03.2009
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello!
Do you have already a patch or need you time to create this?
Thanks.
Do you have already a patch or need you time to create this?
Thanks.
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello Jan,
wih Stimulsoft.Report.StiOptions.Engine.HideExceptions = false; and Stimulsoft.Report.StiOptions.Engine.HideMessages = true;
results are comparable:
08.04.2009 17:10:04:294 ;TRACE ;IFCPrinter.StaticPrintReportLocal on printer "infotec IS 2122 PCL 6": CASE 1
08.04.2009 17:10:04:373 ;ERROR ;System.ComponentModel.Win32Exception: The handle is invalid
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
at DE.KLD.IDS.FCPrinter.FCPrinter.StaticPrintReportLocal(StiReport aReport, FCPrinterOptions aPrinterOptions, Boolean aAllowPrinterDialog, String aWantedPrinterName) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 790
at DE.KLD.IDS.FCPrinter.FCPrinter.InternalPrintStiReport(StiReport aReport, PrinterType aPrinterType, String aWantedPrinterName, String aFormularName, String aMandant, FCPrinterCategories aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 1422
at DE.KLD.IDS.FCPrinter.FCPrinter.DoPrintReport(DataSet aDataSet, PrinterType aPrinterType, String aReportFileName, String aFormularName, String aMandant, FCPrinterCategories aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 1256
at DE.KLD.IDS.IDSReports.IDSReportRecord2.PrintReport(Int32 aHierId, Int32 aRecordId, Int32 aRecordNumber, String aRecordType, IDSSheetCollection aSheetCollection, IDSFieldCollection aHeaderFieldCollection, IDSFieldCollection aFieldCollection, PrinterType aPrinterType, String aImageType, String aFormularName, Int32 aClientID, Int32[] aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\IDSReports\IDSReportRecord2.cs:line 436
at DE.KLD.IDS.IDSReports.IDSReportRecord2.PrintReport(IDSRecord aRecord, String aRecordType, IDSSheetCollection aSheetCollection, IDSFieldCollection aHeaderFieldCollection, IDSFieldCollection aFieldCollection, PrinterType aPrinterType, String aImageType, String aFormularName, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\IDSReports\IDSReportRecord2.cs:line 216
at CSharpValid.CSharpValid.ValidProc(Fields Fields) in D:\TFSProjects\FCServer\Main\IdsApplications\Payment\Sources\VeriDlls\ForcedPrintout\Class1.cs:line 151
Is it possible, you don't catch the exception and showing dialog box (which results in exception for service application) or throwing the exception for logging?
Thanks
wih Stimulsoft.Report.StiOptions.Engine.HideExceptions = false; and Stimulsoft.Report.StiOptions.Engine.HideMessages = true;
results are comparable:
08.04.2009 17:10:04:294 ;TRACE ;IFCPrinter.StaticPrintReportLocal on printer "infotec IS 2122 PCL 6": CASE 1
08.04.2009 17:10:04:373 ;ERROR ;System.ComponentModel.Win32Exception: The handle is invalid
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
at DE.KLD.IDS.FCPrinter.FCPrinter.StaticPrintReportLocal(StiReport aReport, FCPrinterOptions aPrinterOptions, Boolean aAllowPrinterDialog, String aWantedPrinterName) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 790
at DE.KLD.IDS.FCPrinter.FCPrinter.InternalPrintStiReport(StiReport aReport, PrinterType aPrinterType, String aWantedPrinterName, String aFormularName, String aMandant, FCPrinterCategories aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 1422
at DE.KLD.IDS.FCPrinter.FCPrinter.DoPrintReport(DataSet aDataSet, PrinterType aPrinterType, String aReportFileName, String aFormularName, String aMandant, FCPrinterCategories aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\FCPrinter\FCPrinterLibrary\FCPrinter.cs:line 1256
at DE.KLD.IDS.IDSReports.IDSReportRecord2.PrintReport(Int32 aHierId, Int32 aRecordId, Int32 aRecordNumber, String aRecordType, IDSSheetCollection aSheetCollection, IDSFieldCollection aHeaderFieldCollection, IDSFieldCollection aFieldCollection, PrinterType aPrinterType, String aImageType, String aFormularName, Int32 aClientID, Int32[] aCategories, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\IDSReports\IDSReportRecord2.cs:line 436
at DE.KLD.IDS.IDSReports.IDSReportRecord2.PrintReport(IDSRecord aRecord, String aRecordType, IDSSheetCollection aSheetCollection, IDSFieldCollection aHeaderFieldCollection, IDSFieldCollection aFieldCollection, PrinterType aPrinterType, String aImageType, String aFormularName, String aUser, String aCommand) in D:\TFSProjects\FCServer\Main\IdsBasisApi\IDSReports\IDSReportRecord2.cs:line 216
at CSharpValid.CSharpValid.ValidProc(Fields Fields) in D:\TFSProjects\FCServer\Main\IdsApplications\Payment\Sources\VeriDlls\ForcedPrintout\Class1.cs:line 151
Is it possible, you don't catch the exception and showing dialog box (which results in exception for service application) or throwing the exception for logging?
Thanks
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello Alex,
Please try to print on any other printer. Exception will be same?
> Is it possible, you don't catch the exception and showing dialog box (which results in exception for service application) or throwing the exception for logging?
with Stimulsoft.Report.StiOptions.Engine.HideExceptions = false; and Stimulsoft.Report.StiOptions.Engine.HideMessages = true; method .StiExceptionProvider.Show(Exception exception) only re throw exception (in patch which i sent to you).
Thank you.
Please try to print on any other printer. Exception will be same?
> Is it possible, you don't catch the exception and showing dialog box (which results in exception for service application) or throwing the exception for logging?
with Stimulsoft.Report.StiOptions.Engine.HideExceptions = false; and Stimulsoft.Report.StiOptions.Engine.HideMessages = true; method .StiExceptionProvider.Show(Exception exception) only re throw exception (in patch which i sent to you).
Thank you.
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello Jan!
I've done this already!
The result is:
08.04.2009 17:10:04:294 ;TRACE ;IFCPrinter.StaticPrintReportLocal on printer "infotec IS 2122 PCL 6": CASE 1
08.04.2009 17:10:04:373 ;ERROR ;System.ComponentModel.Win32Exception: The handle is invalid
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
bevore done this, result was:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.
Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
I's the same on all printers
Now I've, probably, really bad news. There are some issues in Windows Server 2008 what makes life difficult.
I wrote other very simple service, which only prints some lines of text with standart .net methods
The throws also an Exception:
08.04.2009 19:08:20:638 ;ERROR ;The handle is invalid
08.04.2009 19:08:20:685 ;ERROR ;at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at DE.KLD.IDS.FCTest.FCTestService.RunningMethod() in D:\TFSProjects\FCServer\Main\IdsBasisPgm\ClassLibrary1\FCTestService.cs:line 139
at DE.KLD.IDS.FCTest.FCTestService.Work() in D:\TFSProjects\FCServer\Main\IdsBasisPgm\ClassLibrary1\FCTestService.cs:line 105
The problem with StiExceptionProvider was, it does cut the call stack and it was impossible to identificate the source of exception.
The service cant' print for some reasons, but a standalone console program can.
Now it's the question, how to deal with this problem. There are some search result about this issue and it looks like some products implements a workarounds, but I've not found, what the workarounds are.
Thanks!
I've done this already!
The result is:
08.04.2009 17:10:04:294 ;TRACE ;IFCPrinter.StaticPrintReportLocal on printer "infotec IS 2122 PCL 6": CASE 1
08.04.2009 17:10:04:373 ;ERROR ;System.ComponentModel.Win32Exception: The handle is invalid
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
bevore done this, result was:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.
Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Stimulsoft.Base.StiExceptionProvider.Show(Exception exception)
at Stimulsoft.Report.Print.StiPrintProvider.Print(StiReport report, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int16 copies, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(Boolean showPrintDialog, PrinterSettings printerSettings)
at Stimulsoft.Report.StiReport.Print(PrinterSettings printerSettings)
I's the same on all printers

Now I've, probably, really bad news. There are some issues in Windows Server 2008 what makes life difficult.
I wrote other very simple service, which only prints some lines of text with standart .net methods
Code: Select all
private void PrintMethod()
{
printDocument1 = new PrintDocument();
stringToPrint = "First line\n\rSecond line\r\nThird line";
Font = new Font("Arial", 10);
printDocument1.PrintPage += printDocument1_PrintPage;
printDocument1.DocumentName = "Test Document from Service";
PrinterSettings iPrinterSettings = new PrinterSettings();
iPrinterSettings.PrinterName = "HP Color LaserJet 3800";// "infotec IS 2122 PCL 6";
printDocument1.DefaultPageSettings.PrinterSettings = iPrinterSettings;
printDocument1.PrinterSettings = iPrinterSettings;
printDocument1.Print();
}
PrintDocument printDocument1 = new PrintDocument();
string stringToPrint = "First line\n\rSecond line\r\nThird line";
Font Font = new Font("Arial", 10);
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
int charactersOnPage = 0;
int linesPerPage = 0;
// Sets the value of charactersOnPage to the number of characters
// of stringToPrint that will fit within the bounds of the page.
e.Graphics.MeasureString(stringToPrint, this.Font,
e.MarginBounds.Size, StringFormat.GenericTypographic,
out charactersOnPage, out linesPerPage);
// Draws the string within the bounds of the page
e.Graphics.DrawString(stringToPrint, this.Font, Brushes.Black,
e.MarginBounds, StringFormat.GenericTypographic);
// Remove the portion of the string that has been printed.
stringToPrint = stringToPrint.Substring(charactersOnPage);
// Check to see if more pages are to be printed.
e.HasMorePages = (stringToPrint.Length > 0);
}
08.04.2009 19:08:20:638 ;ERROR ;The handle is invalid
08.04.2009 19:08:20:685 ;ERROR ;at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at DE.KLD.IDS.FCTest.FCTestService.RunningMethod() in D:\TFSProjects\FCServer\Main\IdsBasisPgm\ClassLibrary1\FCTestService.cs:line 139
at DE.KLD.IDS.FCTest.FCTestService.Work() in D:\TFSProjects\FCServer\Main\IdsBasisPgm\ClassLibrary1\FCTestService.cs:line 105
The problem with StiExceptionProvider was, it does cut the call stack and it was impossible to identificate the source of exception.
The service cant' print for some reasons, but a standalone console program can.
Now it's the question, how to deal with this problem. There are some search result about this issue and it looks like some products implements a workarounds, but I've not found, what the workarounds are.
Thanks!
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Possibly related to Operating System permissions and the Windows account the Service is started under? Maybe the account does not have permission to print or read printer information.
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello Alex,
1. Try to print to any other printer. This error occurs?
2. Try to set for all textboxes in report TextQuality property to WYSIWYG value. In this mode report engine does not use gdi+ and all drawing processed though gdi. May be it help.
Thank you.
1. Try to print to any other printer. This error occurs?
2. Try to set for all textboxes in report TextQuality property to WYSIWYG value. In this mode report engine does not use gdi+ and all drawing processed though gdi. May be it help.
Thank you.
Cannot print on x64 Windows Server 2008 after update 30.03.2009
Hello Jan and Brendan,
1. the service is configured to run under the same account as user that runs the sandalone program - this is Administrator with all rights.
2. Problem still exists on all printers.
3. TextQuality property of all textboxes will be setted programmatically to WYSIWYG value since long time because of other reasons, this looks not be an problem.
4. It's sure, tah GDI+ dont use GDI internally, or resides on some other functions, that GDI+ also?
Here some really interesting threads I've found around this problem:
Printing problem with 2.0 Framework?
StartDoc giving error "The handle is invalid"
Thanks.
1. the service is configured to run under the same account as user that runs the sandalone program - this is Administrator with all rights.
2. Problem still exists on all printers.
3. TextQuality property of all textboxes will be setted programmatically to WYSIWYG value since long time because of other reasons, this looks not be an problem.
4. It's sure, tah GDI+ dont use GDI internally, or resides on some other functions, that GDI+ also?
Here some really interesting threads I've found around this problem:
Printing problem with 2.0 Framework?
StartDoc giving error "The handle is invalid"
Thanks.