Current filter:
                                You should refresh the page.
                                  • --dxPrnPg.pas

                                    procedure TdxPrinterPage.ApplyToPrintDevice;
                                    var
                                      APaperInfo: TdxPaperInfo;
                                    begin
                                      if dxPrnDev.dxInitPrintDevice(False) then
                                      begin
                                        dxPrnDev.dxPrintDevice.ColorMode := not GrayShading;
                                        dxPrnDev.dxPrintDevice.Orientation := Orientation;
                                        dxPrnDev.dxPrintDevice.SelectPaper(DMPaper);
                                        if DMPaper >= DMPAPER_USER then
                                        begin
                                          APaperInfo := TdxPaperInfo(dxPrnDev.dxPrintDevice.Papers.Objects[dxPrnDev.dxPrintDevice.PaperIndex]); //AV Code
                                          APaperInfo.Width := PageSizeLoMetric.X;
                                          APaperInfo.Height := PageSizeLoMetric.Y;
                                        end;
                                        dxPrnDev.dxPrintDevice.SelectBin(PaperSource);
                                      end;
                                    end;

                                    Hello.

                                    I am getting access violation when creating TForm that includes a TdkxGridDBBandedTableView  - That is if the Default Printer is invalid (network printer not found on server) on my machine. The bold source-code line above is the one that throws the AV error.

                                    Best Regards
                                    Johann

                                Show all comments
                                • dk Hugbunadur 01.12.2018

                                  When debugging I found out that dxPrnDev.dxPrintDevice.Papers is NIL.

                                • AlexE 01.12.2018
                                • Paulo (DevExpress Support) 01.15.2018

                                  Hello Johann,

                                  Would you please specify your Windows 10 build version? Do you have the latest update installed? Do you have any default printer in your system? Thanks in advance.

                                • dk Hugbunadur 01.16.2018

                                  I have Default Printer that is a Network printer. I am using  HP Universal Printing PCL 5 but that is not the problem. The problem is that the printer who is selected as Default is currently unavailable (I get error if I try to go to Properties on it  in Windows).
                                  I have latest update of Windows 10.
                                  One thing that I did not mention earlier, I have also TdxComponentPrinter dropped on my form.

                                • Paulo (DevExpress Support) 01.17.2018

                                  Thanks. Would you please put a break point to this procedure, get the values of the following properties and provide them in your next comment?

                                  dxPrintDevice.PrinterCount = ???

                                  dxPrintDevice.PrinterIndex = ???

                                  dxPrintDevice.DeviceMode = ???

                                • Vasyl Kovalisko 11.09.2018

                                  Hi,

                                  I have exectly the same problem.
                                  So mainly this issue can be easyly reproduced when you set in Windows settings default printer to be printer that has status "Printer not found, unable to connect".

                                  I have attached exception file.

                                  Did you find any solution for this issue?

                                • Vasyl Kovalisko 11.09.2018

                                  And here is a screenshot of selected default printer that provoke this issue.

                                  Note: in case I change default printer to any other that has "online" status - the issue will not reproduce anymore. But I can't be sure that customer always has a right printer selected in Windows settings.

                                  Any idea how to solve this issue?

                                • Paulo (DevExpress Support) 11.09.2018

                                  Hello Vasyl,

                                  Would you please clarify how did you manage to get this printer status? If I disable my network printer, I just get the "Offline" status for it, but this does not produce an error in the ApplyToPrintDevice method.

                                  P.S.: Please ensure that you are using the latest version of our controls (18.1.6).

                                • Vasyl Kovalisko 11.14.2018

                                  Hello Paulo,

                                  My version of Developer Express VCL Products 17.2.3 .

                                  So I had network printer HP LaserJet P3005dn somewhere on [UASRV06] and this printer was setup like default for my PC. Then in some day our administrato r phisicly removed this printer (due to some repairing required) and add new Canon printer instead. So, like a result, this "old" printer HP LaserJet P3005dn got status <<Printer not found on server, unable to connect>>.

                                • Paulo (DevExpress Support) 11.15.2018

                                  Thanks, Vasyl. For now we cannot reproduce this behavior. Please try to reproduce the same behavior with the attached application. Does it also produce the error?

                                • Vasyl Kovalisko 11.19.2018

                                  Hello, Paulo.
                                  Yes, this problem is reproducing all the time even on your application when I selected printer with status <<Printer not found on server, unable to connect>>.
                                  And no problem when normal printer selected.

                                • Paulo (DevExpress Support) 11.20.2018

                                  Thanks, Vasyl. We cannot reproduce this behavior for now. However, we have found a place in our source code that may cause such issues in certain cases. Would you please perform a small test? Put a breakpoint into the following code line of the TdxPrinterPage.ApplyToPrintDevice method:

                                  [Delphi]
                                  APaperInfo := TdxPaperInfo(dxPrnDev.dxPrintDevice.Papers.Objects[dxPrnDev.dxPrintDevice.PaperIndex]);

                                  When the compiler stops in this line, get the dxPrnDev.dxPrintDevice.DeviceMode property value. Is it nil in your scenario?

                                • Vasyl Kovalisko 11.29.2018

                                  yes, it is nil (see attched screenshot)

                                • Paulo (DevExpress Support) 11.30.2018

                                  Thanks, Vasyl. We are working on this problem, but it may take some time to examine and trace sources.

                                • Paulo (DevExpress Support) 12.03.2018

                                  It seems that we have found an appropriate solution. Would you please modify the dxInitPrintDevice function in the dxPrnDev.pas unit in the following manner and test the result:

                                  [Delphi]
                                  function dxInitPrintDevice(ARaiseException: Boolean): Boolean; begin Result := True; try Result := (dxPrintDevice.Printers.Count > 0) and (dxPrintDevice.Handle <> 0) and (dxPrintDevice.DeviceMode <> nil); except Result := False; if ARaiseException then raise; end; end;
                                • Dr. Michael K. Trubetskov 12.12.2018

                                  Hello,

                                  As I can see, this fix is not included in the release 18.2.2

                                  Yesterday I received a bug report from one of my customer with the stack trace leading to exactly this place. The problem appeared with his network printer was not available, and it can happen quite often with notebooks. After reconfiguration of the printer the problem disappeared.

                                  Are there chances to see this fix in future releases?

                                  Best regards,
                                     Michael

                                • Paulo (DevExpress Support) 12.12.2018

                                  Hello Michael,

                                  You are right. This patch is not included into the 18.2.2 version of our controls. The point is that we cannot reproduce the problem on our machines. In this ticket, I have asked to test our patch, but no one responded. Would you help us test it? Modify the dxInitPrintDevice function in the dxPrnDev.pas unit as I described above, run our installer in Recompile mode, and test the result. Does this patch resolve the issue?

                                • Dr. Michael K. Trubetskov 12.12.2018

                                  Hi Paulo,

                                  Unfortunately this happened at a computer of our customer, and he fixed this by reconfiguration of the network printer BEFORE I provided him with the software based on this patch. Therefore I am in the same position as you...

                                  I will try to play with printers a bit, but first I need to reproduce this problem. It happened in "Windows 7 Tablet PC x64 Service Pack 1 build 7601", maybe it is important.

                                  Best wishes,
                                     Michael

                                • Dr. Michael K. Trubetskov 12.12.2018

                                  Hi Paulo,

                                  One more update: I just received one more bug report from completely different customer with the same stack trace. In this case the software was compiled with v. 17.2.8. OS is "Windows 7 x64 Service Pack 1 build 7601".

                                  It is interesting to admit that this issue started to appear just recently. Maybe some Microsoft update changed the way how the printers are managed?

                                  The issue looks not reproducible with VMWare and unfortunately I have no devices with Windows 7 around. Later I will try to experiment with Windows 10 notebooks.

                                  Best regards,
                                     Michael

                                • Vasyl Kovalisko 01.23.2019

                                  Hello, Paulo.

                                  Sorry for this delay of response. Finally I found time to try this fix.

                                  This modification of dxInitPrintDevice function in the dxPrnDev.pas unit made a fix for this exception.

                                  After applying this codeResult := (dxPrintDevice.Printers.Count > 0) and (dxPrintDevice.Handle <> 0) and (dxPrintDevice.DeviceMode <> nil);no issue anymore.

                                  Can we expect to get this fix in next release?

                                • Paulo (DevExpress Support) 01.24.2019

                                  Thanks, Vasyl. Yes. We are planning to integrate this patch into our future builds (18.1.9 and 18.2.5).

                                1 Solution

                                Creation Date Importance Sort by