New Blog Post: PDF/A and Metadata

What is PrinterSetUp.DevMode

edited May 2013 in End User
Hi

ReportBuilder 14.07 Ent, Advantage Database, Delphi XE2

I have an end user report application where reports are loaded from file.
They preview and print to file correctly but will not print to a printer
coming up with the following message "Windows cannot print due to a problem
with the current printer setup." I could not see anything wrong with any
printer settings so compared the .rtm file with another application where i
do not have any problem. It was immediately obvious that the problem
reports all had a PrinterSetup.DevMode setting (see below) whereas my good
ones do not. If i remove that section then the report prints no problem.
However if i go back in and change the report the section gets reinstated
and i am back to the printing problem.

I can guess from the name that PrinterSetUp.DevMode is something to do with
development (?) but why does it appear and more importantly how can i avoid
it?

Thanks

Tim Murfitt


object repPlayer: TppReport
PassSetting = psTwoPass
PrinterSetup.BinName = 'Default'
PrinterSetup.DocumentName = 'Report'
PrinterSetup.Orientation = poLandscape
PrinterSetup.PaperName = 'A4'
PrinterSetup.PrinterName = 'Default'
PrinterSetup.SaveDeviceSettings = True
PrinterSetup.mmMarginBottom = 10000
PrinterSetup.mmMarginLeft = 10000
PrinterSetup.mmMarginRight = 10000
PrinterSetup.mmMarginTop = 10000
PrinterSetup.mmPaperHeight = 210000
PrinterSetup.mmPaperWidth = 297000
PrinterSetup.PaperSize = 9
PrinterSetup.DevMode = {
B4080000430061006E006F006E0020004D004700360031003000300020007300
6500720069006500730020005000720069006E00740065007200200028004300
000000000104060CDC00D80703DF8103010009009A0B3408640001001401FDFF
0200010000000100010041003400000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0100000002000000010000000100000000000000000000000000000000000000
D8070000424A444D060C00000000000044040000AD000000AD00000000000000
000000000100000008520000047400002C01000054010000604F0000E4700000
2C01000054010000604F0000E470000008520000047400002C01000054010000
54010000F4010000604F0000E47000002C0100005401000054010000F4010000
2C0100005401000054010000F4010000604F0000E47000005802580218004400
5200410046005400000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000530061006D0070006C00650020003100000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000001027000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000020000000300000003000000000000000200010000000000
0000000000000000000000000000020003000900090000000300000003000000
0200000000000000000000000000000000000000010000000100000003000000
1401000003000000000000000100000000000000000000000000000000000000
0000000003000000020000000100000000000000010000000000000000000000
6400000009000000085200000474000000000000090000000852000004740000
0000000002000000000000000100000001000000000000000000000000000000
0000000000000000000000000000000000000000930000000000000000000000
480A000001000000010000002C00000000000000000000000000000001000000
0000000001000000FFFF00000000000000000000000000000A00000000000000
0000000000000000000000000100000000000000000000000000000000000000
0100000000000000000000000000000000000000000000000000000001000000
00000000FFFF0000000000000000000000000000020000000000000000000000
0000000001000000000000000100000000000000000000000000000000000000
00000000085200000474000000000000010000007F0000007F0000007F000000
7F00000000000000010000000000000000000000E7030000FF00000000000000
0000000000000000000000000000000000000000000000000000000001000000
0000000000000000000000000B01000001000000090000000000000000000000
000000000000000000000000000000000B010000000000000000000000000000
0100000000000000000000000A00000000000000000000000000000000000000
E703000000000000000000000000000000000000000000000000000000000000
0000000005000000000000000000000002000000000000000200000001000000
0000000000000000000000000000000000000000E80300000000000001000000
000000000000000000000000000000000000000000000000430061006E006F00
6E0020004D004700360031003000300020007300650072006900650073002000
5000720069006E007400650072002000280043006F0000000104060CDC00D807
03DF8103010009009A0B3408640001001401FDFF020001000000010001004100
3400000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000010000000200000001000000
0100000000000000000000000000000000000000723850DE}
Template.FileName =

Comments

  • edited May 2013
    After further experimenting i have discovered that if i edit the .rtm to
    include PrinterSetup.DevMode = {00000000} then i can print ok and the
    setting does not get overwritten when the report is modified. I have
    therefore half resolved my problem (i can print) but i am still left with
    the problem of having to edit the .rtm file.

    Any one with ideas how i can completely resolve the problem?

    Thanks

    Tim Murfitt



  • edited May 2013
    In the Report properties below, I notice

    PrinterSetup.SaveDeviceSettings = True

    Use the object inspector to set SaveDeviceSettings to False. Save the
    report and again do a View | As Text and the DevMode should no longer
    appear. If you modify the PrinterSetup.DeviceSettings then
    SaveDeviceSettings will flip to True. The DeviceSettings property should
    only be used to set printer model specific features, like stapler, etc.

    The Windows API 'DevMode' structure is used by Windows and the Printer
    Driver to define the printer setup. The name DevMode is short for
    DeviceMode.



    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2013
    Nard

    Thanks. Problem resolved.

    Tim


This discussion has been closed.