Tracking down change in behaviour between RB7 and RB10
Hi
We are trying to track down the reasons to a specific problem which has
appeared after switching from RB7(.04) to RB10(.06).
This is the scenario:
1. Application built with RB 10.06
- A product label report exists and in the rtm-file is defined
PrinterSetup.PrinterName = 'Defailt'
- The default printer for the user is eg. a laser printer
- When printing the product label the RB printer dialog offers the default
laser printer as printer. (Correct)
- The user selects another printer, ie. the label printer from the dropdown
list and prints out the label report
- Result: The output is offset either to the left or to the right so much
that all the text of the report is not visible on the label.
Workaround: Setting the user default printer to the label printer or
changing the PrinterSetup.PrinterName in the RTM-file to be the label
printer (so that it is presented as default in the RB printer dialogue)
gives the correct output result without offsets.
2. Application built with RB 7.04
- The output is correct even if the label printer is not default for the
user or in the RTM-file.
Questions:
- Any ideas on if this might be due to some changes between RB7 and RB10?
- If we want to step through the code to see what is happening and what
might be causing this, which pas-files and which functions in these
pas-files should we consider putting break points in?
Regards,
Kjell
We are trying to track down the reasons to a specific problem which has
appeared after switching from RB7(.04) to RB10(.06).
This is the scenario:
1. Application built with RB 10.06
- A product label report exists and in the rtm-file is defined
PrinterSetup.PrinterName = 'Defailt'
- The default printer for the user is eg. a laser printer
- When printing the product label the RB printer dialog offers the default
laser printer as printer. (Correct)
- The user selects another printer, ie. the label printer from the dropdown
list and prints out the label report
- Result: The output is offset either to the left or to the right so much
that all the text of the report is not visible on the label.
Workaround: Setting the user default printer to the label printer or
changing the PrinterSetup.PrinterName in the RTM-file to be the label
printer (so that it is presented as default in the RB printer dialogue)
gives the correct output result without offsets.
2. Application built with RB 7.04
- The output is correct even if the label printer is not default for the
user or in the RTM-file.
Questions:
- Any ideas on if this might be due to some changes between RB7 and RB10?
- If we want to step through the code to see what is happening and what
might be causing this, which pas-files and which functions in these
pas-files should we consider putting break points in?
Regards,
Kjell
This discussion has been closed.
Comments
Have not heard of this before.
The unit ppProd.pas, the method TppProducer.PrintToPrinter would be one
place to put a break point. The method shows the print dialog and then
towards the bottom there is some code that checks whether the user chose a
different printer...
if
not(FPrinterDevice.Printer.PrinterSetup.IsPrinterDefEqual(FOriginalPrinterSetup))
then
begin
FResetEngineAfterPrinting := True;
Producing := False;
Publisher.Clear;
Reset;
Producing := True;
end;
The main purpose is to clear the page cache and reset the report, so that
the will regenerate the pages.
In ppPrintr.pas, there is method, TppCustomPrinter.DeviceContextChanged that
calculates the printable page area and page gutters for the printer. This
information is used to position the elements on the page.
You can also try creating a simple test case, using standard Delphi
components, RB, and the DBDemos data. Zip it up and email to
support@digital-metaphors.com. Also specify the label printer you are using
so that we can try to download a driver.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com