Skip to Content
author's profile photo Former Member
Former Member

Passing Connection from Crystal Report to a UFL


I was creating a User function library in c#. I had a question about passing connection string to the UFL function. Is there a way to pass that from the crystal report to UFL ? Based upon the connection string passed to UFL and some parameters, I need to do a look up on the database and return back a value.

Please advise,


Amit Nath

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Dec 13, 2011 at 03:16 PM

    Not sure I understand the question; In order to connect the report to a database, you must have already passed in a connection string(?). E.g.; you know the conn string, so why not pass it into the UFL, then do what ever yo need to from there?


    Follow us on Twitter

    Got Enhancement ideas? Try the [SAP Idea Place|]

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Amit,

      There is no formula form you can use in CR to get the connection string. You said you do set the connection string so it must be in a variable somewhere in your app so you can use it in your UFL. You won't be able to piggy back on the existing connection though, your UFL will create a new connection to the server. It's like a subreport, each subreport makes it's own connection also.


  • Posted on Dec 14, 2011 at 12:59 AM

    You'll likely need to use a Crystal Reports parameter, or multiple parameters, to pass the information you need to the UFL. Keep in mind this is note a secure way to pass information like passwords because they could be available to anyone who has access to the .rpt file if you choose to export to Crystal Reports format.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.