Filter Section in Crystal Report - crystal-reports

I am creating report in SAP crystal report 2013. In SSRS their is a separate section for filter parameters. Can I have that sort of Search Criteria section in crystal report. Basically I want to provide the date and other inputs and clicking "Refresh" button it should fetch data from the database according to the inputs provided. Can someone please suggest some link/documentation on how to add a filter area in a report.

As correctly said by #Arvo you need to use parameter fields but most important you need to use those parameters in Record Selection Formula to retrive the required data. This will make sure that selected data is only retrived by that performance increases
For E.g create a parameter ID and now to to record selection formula by Report -> selection formulas -> record and write the condition as
databasetable. id ={?ID}
Then only the required data selected through parameter will be retrived else full data will be retrived from database

Related

SSRS report need to show n-time based on dataset rows

I have designed two pages and each page have different table.Currently my dataset return only one user details.So i have bind all details in table.
Requirement
In case data set return two user details ,need to print two user details.First two pages for first user and second two page for second user.
Is this possible in SSRS report? If yes please guide me.
As you already have a report working for a single user then I would normally do this with subreports.
Asumming your current report accepts a userid or similar as a parameter....
Create a new new report.
Add a dataset that returns a list of users that you want to produce the report for
Add a table and set its dataset property to the name of the dataset you just created.
You can remove the header row and all columns except one from the table
In the remaining cell, right-click and choose "insert Subreport"
Right-click the subreport placeholder and choose properties
Choose your original report as the subreport
Click the parameters tab and choose the subreport property name on the left side, choose the field from your dataset that contains the userid (or whatever value you pass as a parameter) on the right side.
That's pretty much it, when you run the new report, it will produce 1 row per user, in each row it will run your subreport.
You will need to use a matrix, specifically row groups, grouping by using user details, and possible inserting a page break between each instance. This should get you going in the right direction.

Jaspersoft Studio: Force input parameter of subreport to be entered manually

In my main report I get a (small) list of string values from the data base. I then want to use this list for selecting records in a subreport, along with other input parameters:
The user shall be able to select records based on a range of begin and end date -- this is easy using an input parameter of type java.util.Date with "Is For Prompting" set to true. Another criteria shall be one or more items from a list showing values from a data base field. I could define the list in the report template, but then I'd have hard-coded strings (filled from the data base, but at definition time only).
Now the dilemma is: If I define the input parameters in the main report, I cannot get the values for the list beforehand; if I define them in the subreport, I get no prompt at all, so there's no way to set any of them.
So the report requires values for start and end date, and a list of string values to select from (multiple itmes can be selected). This list shall be built from values from the data base. In the subreport all these values shall be joined into a filter for the records. A user shall be able to define the dates and select items from the list manually before executing the report.
Is there a way to achieve this?
After some more hours of trial & error, and some more research, of course, I found that the keyword is "Query-based Input Controls". This documentation describes their creation on the JasperReports Server. Such input controls can be edited in Jaspersoft Studio as well, however, they actually work on the server only. Anyway, this is the solution to my problem.

Filter list of values input control base on user role or attribute in jasper reports server

I have a question about passing list of values input control from JasperReports Server to JasperReports's report as parameter. There are more than 100 users which has the same report design layout that I should design more than 100 reports which the same query but different on filter condition.
I would like to design only 1 report and in list of values input control, I will predefine all condition values, but when user login I wish to show only some line of list of values that belong to this user. So that user can view only data that belong to their location in report.
Could anybody tell me how to filter on list of value or other ways that I could pass such user attribute to report's parameter?

How do I do a CR-type formula in SQL Server Reporting services?

In Crystal Reports, I could define a formula that would evaluate for each detail line. For example, if I had a query that would return a PatientId, an ObsTerm name, and an ObsTerm value, I could define a formula called {#Hispanic} that had the value:
If {Command.OBSNAME} = "HISPANIC" Then
{Command.OBSVALUE}
Else
" "
Then, in the group footer, I could take Maximum({#Hispanic}, {Command.PATIENTID}) to see if I had gotten a value returned for the patient's ethnicity - either I'd get the value (assume only one, since that's how I built the query) or a blank.
I'm trying to convert a CR report over to SSRS 2008R2: how would I do the above? Thanks.
Add a calculated field to your data source (called 'Hispanic' or whatever) with a formula of:
=IIF(Fields!OBSNAME.Value="Hispanic",Fields!OBSVALUE.Value,"")
In your report, add a parent group to your detail row and type [Max(Hispanic)] into a field in the group row. You may then want to hide the detail row and show only the aggregate data. I think there's probably a much easier way to do what you want but it's not clear from your question.
I made the transition from Crystal to SSRS and it is a hard road. You need to unlearn all your Crystal (especially formatting).

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