Reading environment varaibles within Crystal

Is it possible to read the values of environment variables within a Crystal report?
In other words, if I set an environment variable on a PC where I am running a Crystal report, is it possible for Crystal to read the value of that variable?
Regards,
Douglas

Hi Douglas,
Fuskie is correct.  For you to do what you want, I would recommend creating a User Function Library (UFL) which will drop that function into Crystal's Formula Editor. 
The UFL is a Windows DLL you would create in VB, C++ or whatever programming language.  Compile it to a DLL and Crystal will load it and you will see your new function in the Formula Editor under Additional Functions. 
There is documentation somewhere on this Business Objects support site and samples but I've been having a hard time navigating around it recently. 
Good luck,
Brian

Similar Messages

  • Using stored procedures within Crystal Reports

    Hello all,
    Background Information:
    I am trying to teach myself how to execute a stored procedure within Crystal Reports.  This is an aspect of Crystal that my work group has not utilized before and we're trying to gather information on the subject.  We use Oracle to create and execute functions and procedures all the time, but I've never tried this within Crystal.
    I use the "Add Command" functionality within Crystal on most of my reports so that I can taylor the sql to the report.  I find this easier to do versus using the ODBC connection to the tables and writing the code through the Crystal Reports wizard.  I also frequently use functions within these sql statements that are inserted in the Add Command.
    What I'm trying to achieve:
    I have a report that needs to run as a "trial", and then later as a committed "run".  This is for a monthly billing system.  Essentially, the user will run the report as the "trial", preview the data, make any necessay corrections, and then later, run the actual billing run.  Within my application, the bills are not actually marked as "billed" until they are actually "billed', if that makes sense.  As a result, the "trial" report will need to mark the bills as "billed", generate the report, and then rollback the data (so that the bills are not "billed".  Once the actual billing reports are ran, the same report will run, but with a "commit" at the end of the report so that the bills are now "billed".
    I'm trying simple tests and failing (i.e. taking baby steps to learn what capabilities Crystal has):
    I created as simple of a procedure as I can envision.  This procedure inserts the word "test" in one of my fields for a provided account number.  When I try to run this procedure via Crystal (via New Report ->History->My ODBC Database link->Stored Procedures), Crystal asks for the account number parameter, as it should.  But I then receive the error message:
    Database Connector Error: '42000:[Microsoft][ODBC driver for Oracle]Syntax error or access violation'
    The existing ODBC connection has work great for years and years to retrieve data from tables, but this is the first time I've tried to utilize procedures.  Can anybody help?  And can anybody explain what the Stored Procedures link is supposed to do?  Am I going down the right path?
    thanks,
    Noel

    Hello,
    Make sure the Oracle client install path is in the PATH statement. And also make sure you are using an IN/OUT cursor. CR only reads the last SELECT statement. Search the Documents area on how to create a Stored Procedure.
    Also, if you are using CR XI ( 11.0 ) then upgrade to CR XI R2 and apply all service packs ( SP 6 ). Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    It may fix your issue also.
    Thanks again
    Don

  • How to read environment variable

    How do I read an environment variable within TS?
    I was thinking of calling getenv("VARIABLE_NAME") except it returns a char * and TS only allows Boolean or Numeric return type.
    I wonder if LV has any function for doing the same thing. 

    With the new ability in TestStand 4.2 to get the standard output from a command line, you can do this with a call executable step.
    Simply call cmd.exe as the executable, and pass it the following expression.  Then all you have to do is set Locals.EnvironmentVariableName to the name of the environment variable you want the value of and define where you want the standard output to be stored.
    "/C \"echo %"+Locals.EnvironmentVariableName+"%\""
    I'm attaching a sequence file that shows this.  The attachment is necessarily saved in TestStand 4.2, since it uses a feature introduced in that version.
    Josh W.
    Certified TestStand Architect
    Formerly blue
    Attachments:
    get env var.seq ‏6 KB

  • Reading data from a crystal report using crystal for eclipse

    tried both approaches listed here: [Help needed in reading data from a Crystal Report]
    but having the same issues, is this a bug or is there some workaround? cant get any results with rowsetcursor and only the first 100 no matter what i do with browsefiledvalues

    Hello,
    I have the same problem. I need to know values of last record in CrystalReports and i got only 100 records.
    Have you found solution for this problem?

  • Is it possible to read Prezi files within the iOS app?

    Hello,
    I want to implement Prezi into my iOS app. I am totally unaware that "Is it possible to read Prezi files within the iOS app?".
    If Yes, please provide some tutorial link, so that I can implement into my application.
    Thanks & regard.

    You will get a better answer in
    Developer Forums
    Use your Developer credentials to log in there.

  • I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome.

    I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome. I can't even see the acrobat reader plugin in the plugins page. Acrobat 10 is already installed in my PC. Every time I try to read a PDF file on the web, FF tries to download it instead.

    As recommended above by Bernd Alheit, I posted this on the Adobe Reader forum. There, I received the advice to repair the installation under the help menu, which I did and it fixed the problem.
    Similar to your solution but found it's a fix found under "HELP" menu and not Add/Remove.
    Thank you.

  • Copying objects within Crystal Reports Server produces an error

    When trying to copy an object from one folder to another within Crystal Reports Server XI R2, I encounter the following error:
    There was an error while writing data back to the server: Two destination property bags exist. Use the bag that is appropriate for your client's version number: SI_DESTINATION (version XI and earlier) and SI_DESTINATIONS (version XI Release 2 and later).
    I did have a copy of BOE XI installed however, this was removed prior to installing CRS XI R2
    fyi - The 'Move' of objects works fine

    Hi,
    The issue you are facing is because there are still some registry entries left behind by XI. It is always recommended to do a clean install.
    For now, you may > back up the registry > run regedit > search for traces specific to XI > delete the keys.
    hope it helps.
    Cheers,
    Subhodeep

  • How to read a variable within a VC code.  I am using BADI based VC code.

    How to read a variable within a VC code.  I am using BADI based VC code.
    Lets say I have a variable for a fiscal period that holds cumulative month.
    If user enters 03/2014 in that variable, it will have month starting from Jan till March.
    Within VC code I would like to read the last month which is
    03/2014 and based on this month I would like to do some calculation on all the records using the last month.
    Since VC code runs for one record at a time and there is no way I can store this value.
    Is there a way to go about it....any suggestions would be of great help.
    Thanks.

    Any suggestions would be highly appreciated.
    Thanks!

  • How to read Environment Variable in Java.

    Hi,
    I am trying to read a environment variable $TMP which has a value of /apps/bea/pt847/psoft5/tmp in UNIX.
    I have written the following code and getting Null pointer exception when calling the method logmessage. Any help with reading environment variable is appreciated.
    public static void logMessage(String message) {
           SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
           Date now = new Date();
           Properties p = null;   
           try
              p = getEnvVars("$TMP");
              System.out.println("the current value of TEMP is : " + p.getProperty("$TMP"));
           catch (Throwable e) {
              e.printStackTrace();
           try
           BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
           os.write(formatter.format(now));
           os.write(message);
           os.write("\n");
           os.write("tmp_env = " + p.getProperty("$TMP"));
           os.write("\n");
           os.close();
           catch(IOException _ex) { }
        public static Properties getEnvVars(String env_var) throws Throwable {
           Properties envVars = new Properties();
           Process p = Runtime.getRuntime().exec(env_var);
           BufferedReader br = new BufferedReader( new InputStreamReader( p.getInputStream() ) );
           String line = null;
           while( (line = br.readLine()) != null ) {
              int idx = line.indexOf( '=' );
              String key = line.substring( 0, idx );
              String value = line.substring( idx+1 );
              envVars.setProperty( key, value );
              // System.out.println( key + " = " + value );
           return envVars;
        }

    Updated code:
    public static void logMessage(String message) {
           SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
           Date now = new Date();
           Properties p = null;   
           try
              p = getEnvVars("$TMP");
              System.out.println("the current value of TEMP is : " + System.getProperty("$TMP"));
           catch (Throwable e) {
              e.printStackTrace();
           try
           BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
           os.write(formatter.format(now));
           os.write(message);
           os.write("\n");
           os.write("tmp_env = " + System.getProperty("$TMP"));
           os.write("\n");
           os.close();
           catch(IOException _ex) { }
        public static Properties getEnvVars(String env_var) throws Throwable {
           Properties envVars = new Properties();
           Process p = Runtime.getRuntime().exec(env_var);
           BufferedReader br = new BufferedReader( new InputStreamReader( p.getInputStream() ) );
           String line = null;
           while( (line = br.readLine()) != null ) {
              int idx = line.indexOf( '=' );
              String key = line.substring( 0, idx );
              String value = line.substring( idx+1 );
              envVars.setProperty( key, value );
              // System.out.println( key + " = " + value );
           return envVars;
        }and this is the error message..
    java.io.IOException: $TMP: not found
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:72)
            at java.lang.Runtime.execInternal(Native Method)
            at java.lang.Runtime.exec(Runtime.java:602)
            at java.lang.Runtime.exec(Runtime.java:461)
            at java.lang.Runtime.exec(Runtime.java:397)
            at java.lang.Runtime.exec(Runtime.java:359)
            at SimpleCasValidator.getEnvVars(SimpleCasValidator.java:108)
            at SimpleCasValidator.logMessage(SimpleCasValidator.java:81)

  • I used to be able to click on a .PDF document and read it directly within Firefox ... since the latest upgrade, that feature doesn't seem to work ... now, I have to download the document and read it locally ... any fixes ???

    Question
    I used to be able to click on a .PDF document and read it directly within Firefox ... since the latest upgrade, that feature doesn't seem to work ... now, I have to download the document and read it locally ... any fixes ???

    Go to Options>Applications>click on, in your case, Adobe Acrobat entries and select "Use Adobe Acrobat(in Firefox)" or as you wish.

  • Un set ORACLE_HOME & TNS_ADMIN environment varaibles

    AIX: 5.2
    DB: 10g Rel 2
    Do we need to un set ORACLE_HOME & TNS_ADMIN environment varaibles prior to Oracle installation?
    I
    $ echo $SHELL
    /usr/bin/ksh
    DN

    If you already have some other oracle installed on that box then make sure to change ORACLE_HOME otherwise set it to where you want the binaries to be and TNS_ADMIN also is not going to effect the installation. If you unset it then while installing you need to specify the path for oracle binaries and if you set it then installer will pick the path from that variable.
    Daljit Singh

  • Within JBuilder, Reading Environment Variable From a BATCH File

    Hi ppl:
    Following my scenario without JBuilder. I would like to be able to do the same with JBuilder, so that I can run my application from within.
    1. In the DOS window, I run a config.bat file that sets up a whole bunch of environment variables and then calls another script file that sets up another whole bunch to set up environment for a third party API (C++ based).
    2. My application uses native methods to call the third party API which uses the environment variables set in step 1.
    I know how to set the environment varialbes in JBuilder (Project Parameters, VM). However, I don't know how I can call a batch file that does the same. I don't want to set up the third party variables in JBuilder manually, since the script that sets them up checks on a few things to customize the environment.
    I also know how to run a batch file from JBuilder, but that does not set the environment for the application. It seems like the batch file is run in a separate process.
    Any ideas?
    Kamran

    It seems like the batch file is run in a separate process.Yes, it is. That's a design feature of Windows. The environment variables that a process creates are available to any subprocess, but when the process ends, the environment variables vanish. That's because they are part of the process, not global variables as you might wish.
    So that's why your non-JBuilder scenario works; your C++ program is running in a subprocess of the process that defined the environment variables. And your JBuilder scenario doesn't work because the batch file it runs is in a process whose parent process is Windows, not JBuilder.

  • Display problem when reading Traditional Chinese in Crystal Report 2008

    Hi All,
    I have tried to connect MS SQL 6.5 to build up a report. However, I encounter a problem when read Traditional Chinese. all chinese characters turn into adnormal characters. I wonder it is problem of SQL Server or some setting that I may not know. In addition, I can able to read chinese in the application program , ISQL / Query Analyzer. Please help to give idea and suggestion to fix this. Thanks
    SQL Server: MS SQL Server  6.5
    Client OS: Window XP ( Traditional Chinese Version)
    Server OS: Window NT and Window Server 2000
    Stsyou

    Hi
    If you are using a Chinese language build database, Crystal Reports English build might not display the characters properly as non english databases include one byte characters as ASCII code character and double-byte characters as their own language code character.
    Traditional Chinese, Simplified Chinese, Japanese (Kanji, Hiranga, and Katakana), Korean and Vietnamese use double-byte characters.
    However, a possible workaround to this issue is to verify that the encoding on the database client is configured according to the examples below. Also, you will need to install the language pack in the English environment.
    CONFIGURATION EXAMPLES:
    Shift-JIS for a Japanese database
    Big5 for a Traditional Chinese database
    GB2312 for a Simplified Chinese database
    iso-2022-kr for a Korean database
    Windows 1258 for a Vietnamese database
    EXAMPLE SCENARIO:
    An Oracle database saves non-English language data such as Japanese.
    The Windows operating system is English.
    STEP TO CONFIGURE THE CHARACTER CODE IN THE ENVIRONMENT SETTING
    (This step is based on the details of the EXAMPLE SCENARIO.)
    1. Configure the system environment on the database client side to 'Shift-JIS' as the character code set in the Environment Setting.
    This results in the NLS_LANG variable set to Japanese_Japan.JA16SJIS under the registry HKEY_Local_Machine\Software\Oracle\Homeo.
    STEPS TO INSTALL LANGUAGE PACK IN AN ENGLISH ENVIRONMENT
    (These steps are based on the details of the EXAMPLE SCENARIO.)
    1. Add languages to the computer system by clicking:
    Control Panel > Regional Options > General
    2. Select the check box for 'Traditional Chinese', 'Simplified Chinese', 'Japanese', 'Korean' or 'Vietnamese'.
    3. Click 'Apply'.
    4. When you are prompted, insert the Windows CD-ROM to install the language pack.
    5. Restart the computer.
    Upon completing these steps, you are able to display the languages characters in the Crystal Reports Designer in a Windows English environment.
    ==========
    NOTE:
    If the database table and field names use non-English language characters, Data Explorer in CR will not correctly display these names. However, when you preview the report, the non-English data displays correctly.
    ==========
    Configuring the database client according to the examples and installing the language pack will display the characters successfully. However, there are cases when this workaround does not resolve the issue.
    For further information about CR and double-byte languages, refer to knowledge base articles, c2008083 and c2008349.
    Hope this helps!!!
    Regards
    Sourashree

  • Hyperlinks within Crystal Reports

    Hello,
    I am using Crystal Reports to create a statement. We would like to include hyperlinks in our report. We have already created hyperlinks within the report. The hyperlinks are only operational when I click within the subreport. I want to process my report to a PDF and have the hyperlinks work. Any Suggestions? I am currently working in Crystal 8.5 (we have 10 but our database is not matching up).

    As an alternative, at least one of the 3rd-party Crystal Reports Manager tools listed at http://www.kenhamady.com/bookmarks.html can use visible or hidden (white font) formulas anywhere within a Crystal report (including inside subreports) to create file, web, or email links at that same location within the pdf export of the report. Optionally, an image (such as a .png button image can be added to provide a GUI for the link.

  • Read environment variable

    Hi all,
    is there any standard way to read an environment variable (not a java system property) within the SAP J2EE Engine? There is no standard way to so in Java, at least not in Java 1.4.
    Thanks in advance,
    Matthias

    mmmmhhhh
    you are right.
    Maybe in 1.5 System.getenv is "un-deprecated".
    By the way there is a funny solution.
    Execute a OS command like to prompt by CODE and parse the result.
    LOOK HERE!
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4199068

Maybe you are looking for

  • Unable to log in to SAP ES workplace HU2 system; Client 800

    Hi, I'm unable to access the below SAP IDES system using the link https://esworkplace.sap.com System  - HU2 Client *   - 800 User *    - P610131 I get this message.  User account not in validity date. To log on please register on SCN: http://www.sdn.

  • How to set up Bonding on CentOS 6.2 with Linux Integration Services 3.4

    Having a hard time setting up bonding to work on a vm running CentOS 6.2. LinuxICv34.iso is installed.  Using three network adapters. Prior to os install I configured the three Network Adapters with the following settings: ***Via Virtual Switch Manag

  • Mac on Windows SMB Share- IDLK files disappearing allowing several users to access the same file

    Hi, We have a volume licensing agreement with Adobe and have around 16 Adobe CS6 licenses all used on Macs. The network is based around Windows servers and shares which the Macs connect to via an SMB connection to the server. The issue we're having i

  • Agent 2.2 with OpenSSO

    I have setup IIS agent 2.2 with OpenSSO 8. I occasionally get a blank page after login when I try to access the protected application. I see the following in the agent log. Any ideas on what might be wrong? 2010-10-06 14:14:48.079 Debug 2288:18ee7b8

  • Lightroom 4 on Macbook Air

    I just upgraded to Lightroom 4 on my Macbook Air, on my downloads page of Adobe it shows this I am just curious as to why it says not applicable. Here is my system info: Thank you for any help.