Home End User

Setting document name from the report

edited March 2009 in End User
Hi

I need to set the document name from fields in the data pipelines as in :-

Report.PrinterSetup.DocumentName := Customer['JobNo'] + ' - ' +
Customer['CustCode'];

If I put this code in the BeforePrint it works a treat when you print from
the built in preview form but when it's printed without previewing with :-
ppReport.DeviceType := dtPrinter;
ppReport.Print();

It doesn't work and the original name is used.

I have tried pretty much all the possible options for the report and some
will actualy get called and do a change but it seems that at that point the
data is unavailable because i just get " - ".

Thanks
Phil

Comments

  • edited March 2009

    This is a timing issue, the BeforePrint event occurs too late.


    Try using the OnInitializeParameters event. I tested with RB 11 and that
    event seems to work well - however be aware that this event occurs prior to
    the datapipelines being opened.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2009
    Yes that is what I found.

    So looks like it is not possible then?

    thanks



  • edited March 2009
    "Philip Colley" wrote in message
This discussion has been closed.