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

How to print current user name and db name on report?

edited April 2004 in General
I don't know exactly where this request should go, but anyway.

I want to print the current user name and db name at the foot of every
report page. In sql server, the functions are "SELECT USER_NAME()" AND
"SELECT DB_NAME()". I'm very new to sql and reportbuilder so any tips are
appreciated.

Comments

  • edited April 2004
    Hi Rob,

    By default, a Report object will find every instance of a DataPipeline on
    your form (or in DADE) and allow you to access the data from it. Since the
    query you describe below probably only returns one record there is no need
    to traverse any data so you could simply place the query inside a TADOQuery
    object, then access the data directly from a pipeline connected to that
    query. Inside the report you can show these values using a DBText or DBMemo
    component. Below is how the data flow works in ReportBuilder when working
    with ADO (using BDE is very similar)

    TADOConnector --> TADOQuery --> TDataSource --> TppDBPipeline --> TppReport

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.