how to display the current username in crystal report? - crystal-reports

how to display the current username who executes the report in crystal report,
i have tried using CurrentCEUserName for displaying the current username, but it is not working. can anyone suggest me how to get this username into the report.

The CurrentCEUserName grabs the current username from the credentials that are used when connecting to the Business Objects Repository Server.
If you are looking to get the current user from a SQL Server that connects using Windows Authentication you will have to return the username value from the SQL Server to the Crystal Report.
e.g
Select SUser_SName() as [CurrentUser],
Column1,
Column2,
etc..
From dbo.YourTable

Related

How to achieve Default Select values in Multi-select prompt in jasper server?

Could you please help me, How to achieve Default Select values in Multi-select prompt in jasper server? for example, suppose that I have access to (India, usa, London) & other have access to India only. My requirement is multi select filter should select by default base on user value.

Crystal Reports Paramteres

My report is working in Crystal Reports designer, but when I am adding it into the Sage Sales logix it doesnt sends the parameter values to database and errors out.
I am using a command like this in the report
exec('select * from testingmyreportfunction({?Param1},{?Param2})')
Assuming that you created the parameters in command window use this query:
// Oracle
SELECT testingmyreportfunction({?Param1}, {?Param2})
FROM dual
// SQL Server
SELECT testingmyreportfunction({?Param1}, {?Param2})

Crystal Report 2008 Add Command Where Clause parameter

Crystal Version - Crystal Reports 2008 Business Objects - XI
I have written a query to populate a subreport and want to pull in a parameter to that query based on input from a user. My question is, what is the correct syntax I need to put in the first line of the 'Where' clause to accept the parameter?
I created a parameter in Add Command it is called PickDate
Here is the query I am using in Crystal Reports:
select
table2.book_no,
table2.time_stamp,
table2.restdate,
a.timestamp,
a.event_type,
a.status,
a.people,
a.new_date,
a.comments,
a.operator_id
from table1 a, table2
where table1.book_no = table2.outage_no
I have tested the query, it is pulling all the data, now I just need help adding parameter to prompt user to enter datatime.
Did you try using the Select Expert in the subreport? You should be able to say field = {?PickDate}

No data returned in Crystal Reports

I have a Crystal Report I'm working on; last week it was returning results but when I fired it up this morning I was no longer getting anything. Checking the SQL query, I show that the table name is listed twice, for some reason:
SELECT "WMS_TESTINFO"."RECORD_NAME"
FROM "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"
Any thoughts on what could have broken? I've checked that the database is connected and my data is still there.
The table name is listed twice as Crystal Reports creates an alias for every table.
This Crystal generated SQL:
FROM "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"
Is in the format of:
FROM DATABASE.OWNER.TABLENAME ALIAS
This is normal for Crystal.
I would run that SQL in SSMS (remembering to remove all of the " first) to check that the data really is still there.
If it is, check that a filter hasn't been added to the report, via the Select Expert menu opton, to filter out all the data.
Lastly, go to Database > Set Datasource Location and re-apply the connection to ensure that the report is definitely pointing at the right location.

How to validate parameter values against a data source in Crystal Reports 2008

I have a report designed in Crystal 2008. The report has a parameter field called "Member ID" that I want to use to get a string input from the user running the report. However, I want to do some sort of validation to ensure that the ID they entered is valid (it exists in a database table that I already have set up). Is there any way to do this?
I know you can set up dynamic parameters that would give the user a dropdown list of Member ID values to choose from based on the data stored in my database table. But I don't want to make the user sort through thousands of IDs in a dropdown. I just want them to manually enter an ID and then have the report check the entered value against a database table.
Is this possible?
You could just create a record selection criteria on your report and pre-limit it to just the valid IDs.
If you are using some stored proc where you pass this parameter and then get the result, then definately you can have a section where you print "no data found" or similar message if recordcount is zero, otherwise you can just display the information for that id.
My experience with crystal reports is that we should have more and more recrod fetching logic on the server then on the client. It will speed up the processing.
Regards
Parminder