Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Preventing printersetup.printername from changing

edited July 2011 in General
Hi,

When I load template from file, reportbuilder changes printe name to
default if it doesn't find printer which is saved to template.

for example in invoice.rtm there is customers specific printer in
printersetup and i'd like to keep it. But this code change my default
printer to invoice1.rtm. Is there any way to prevent changing?

ppreport1.Template.FileName := '\\mk\c\data\invoice.rtm';
ppreport1.Template.LoadFromFile;
ppreport1.Template.Format := ftAscii;
ppreport1.Template.FileName :='\\mk\c\data\invoice1.rtm';
ppreport1.Template.SaveToFile;

thanks
mika

Comments

  • edited July 2011
    If the printer driver is not installed on your machine, then RB changes the
    Report.PrinterSetup.PrinterName to 'Default' and uses your Windows default
    printer. No way to prevent that behavior. However, you could install a
    printer driver on your machine with the same as the customer. You don't need
    have the printer, just install the driver and give it the same name.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2011
    Thanks for reply.
    Is there any tool to convert binary templates to ascii templates, so
    one could easily look what is current printer name?

    mika



    On Wed, 6 Jul 2011 07:45:13 -0500, "Nard Moseley \(Digital
  • edited July 2011
    At the bottom of this rbWiki article are downloadable examples of converting
    templates from binary to text.

    http://www.digital-metaphors.com/rbWiki/DADE/Fundamentals/Convert_Template_BDE_to_ADO



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.