RDL report to show sort selection - c#

Is there any way I can print the sorting option in a text box? For example, if my table has a "Status" column and I chose to sort by "Status", then I can print the word "Status" in a text box. This is the RDL report.

hopefully this is what you're trying to achieve?
Indicate parameter sort option with default values:
Then create a textbox and simply drag the parameter inside the textbox that should look like this:
Then when you try to preview the report and select a sort option, something like below should appear:
Hopefully this helps.

IF you are using a parameterized report where the sorting can change simply capture the the parameter in a text box or often what I do is create another dataset that is
Select #parameter1
Union select #parameter2
Union Select #parameterN
Then display that in another tablix (or cell depending on how many you have)

Related

Splitting csv strings and display it in different fields?

So basically I'm designing a report which can record name and amount of individuals. Now, I have no idea how to implement this on my cr report. But I need to split the csv strings and put all the splitted value as columns.
Here is my sample cell
I have 2 sample columns, Name and amounts. Both columns represent individual cell. Name is a single cell seperated by newline and same as amount.
In my desired output, I need to split all the values inside cell "Name" and put it in different column in Crystal Report and i also need to display the values of "Amount" Below the "Name". Which splitting is needed
Can this be theoretically be done? Any help is appreciated!
Thank You!
Yes, simply use the menu option of Insert, CrossTab... to insert a crosstab in the report header or footer.
Select Name as the column field.
Select Amount as the field to summarize.

How to change sorting option in a rdlc report programmatically?

I have a report with 1 group, sorted by date. This is how it looks:
Link to image (Fecha is date)
Id like to have in my form 2 radio buttons which will tell the report how to sort the rows. How can i change the sorting to a different field programmatically?
You can use ReportParameter to sorting programmatically a report.
You have only two RadioButton so you can set an expression like this as SortBy:
=IIf(Parameters!SortByField1.Value, Fields!Field1.Value, Fields!Field2.Value)
SortByField1 is a Boolean parameter and you can set it with this code:
ReportParameter SortByField1 = new ReportParameter("SortByField1", YourRadioButtonToSortByField1.Checked);

highlight particular row in Crystal Report based on column value C#.net

how to highlight particular row in Crystal Report based on column value C#.net
After Generate Report I want to Highlight all the Records with Value in the column (Assume "Status") values="OK"
If there is a way to do this using in C#.NET
In your crstal report right click the relevant field object you want to highlight and select the "Format Field.." option. In the border tab tick the "Background" check box and you can enter a condition to select the background color of the field. The script looks something like bellow.
(comment: {user1.username} --> user1 is the table and username is my column.)
if {user1.username}='ok' then
crGreen
You can use a formula in order to change text properties as shown in here:
Change color of text object using formula in Crystal Reports
Edit:
To highlight you can go to the borders tab and activate the background color checkbox. Then add the formula to add any check you want to do before.
If you want to highlight all the row you can always apply same formula to all fields in the row

Crystal Reports Omitting Data

This might be a pretty simple question but I'm a Crystal Reports newbie...I have a report where I want specific pages that have a corresponding column omitted. So for example say it has someone's name and information on every page, how would I use a column that for example has the state on it, to omit certain results, like I don't want any pages in the report generated from states that have the "state column" from the database equal to like "TX" or something. This isn't what I'm actually doing, but it's an example of the functionality I want.
I'm thinking it would be in either the group or record selection formulas but I'm not sure how to go about putting it together to not create a page for the results when a certain column is equal to a value.
-Thanks from a total Crystal Reports noob.
So each page of the report is one record in the result set (someone's name and information) and you want to exclude some pages based on the value of one of the columns?
Perhaps I'm not understanding the problem correctly but can't you just change the datasource query?
WHERE state <> 'TX'

hide columns in crystal report at run time?

how to hide columns in crystal report at run time?
thanks for any suggistions.
Option 1: use conditional-suppression logic to hide/show redundant fields
Use a parameter field to drive the suppression formulae for the desired fields.
If you want to eliminate blank spaces between fields, then you'll need to stack the fields on top of each other and suppress them appropriately. In your example, column 2 would contain field2 and field3 (both suppressed) and column 3 would contain field2 and field3 (both suppressed). The suppression logic, in your example, would continue to suppress both fields in column 2, but would show field3 in column 2 (field2 in column 2 would still be suppressed).
Option 2: use 'placeholder' formula field
Each column of data that could be suppressed would be a formula field. Each formula field would use SELECT CASE logic to choose the desired field to display. A 'hidden' field would simply return a null value. Your SELECT CASE logic would be written to ensure that values are filled from left to right. The formatting will need to be done in the formula rather than on the formula field itself.
Option 3: use the SDK to dynamically-change the report.
Use the CR .Net SDK or the older CRAXDRT API to dynamically-modify the columns' visibility and positioning.
If you use this option, however, your deployment options will be more restricted.
You could use parameters (which values can be set during runtime) and use them on the objects' suppress formula.
just for sharing I found a great and simple article at
http://www.codeproject.com/KB/cs/Dynamic_Crystal_Report.aspx
that using parameters in crystal report to dynamically load data from a database into Crystal Report and show specifying which field (Columns of a particular table) should be displayed in the repor according to user choice.
Dani.

Categories

Resources