How can I pass parameters into stored procedure programmatically? - c#

I have a report in which I want to pass the parameters using a stored procedure. Now I have certain variables in which the value is static. I want to pass those values as the parameters into the Telerik report. e.g I have a DropDownList in which I have three values Sales Person, Customer and Product. Now I want to pass the selected index as a parameter to the telerik report designer. As I am new to this I do not know that what values I should pass in the designer and what values I have to pass pro-grammatically. I have designed the report but when set the value of parameter = new Report Parameter it gives me error that object reference not set to the instance if the object. Can anyone please help me.
I am using Telerik report designer inside the visual studio and Telerik report viewer for displaying the report.
http://blogs.telerik.com/telerikreportingteam/posts/09-03-14/telerik-reporting-connecting-to-stored-procedures.aspx
I have followed this link but it is OBSOLETE now.
http://www.telerik.com/help/reporting/how-to-sqldatasource-sct-storedprocedure.html
and while following the other link I get confused at the 10th point.

Related

How to add dynamic hyperlink in RDLC report wizard c# Windows Application

I want to add a dynamic hyperlink on click (action) on client Name with hyperlink expression value of url i.e. Dataset field. Dataset is retrieving the data but Fields!.url.Value doesn't retrieve value also field is not clickable. That means i am using wrong syntax. I have inserted static link and it's working.
Any help will be appreciable Thanks.
This is the report, i am retrieving it's data from data set
This the dataset that contains the url field
this the expression i want to set

Show parameter values inside table RDLC Report

I need to show parameters values inside table of rdlc report. When I put static text it is showing but parameter's values showed empty.
I need to show data in below format which can b easily done using table.
You can show report parameters using this syntax:
=Parameters!YourParameterName.Value

FastReport custom object as Datasource

I developed a simple print report in FastReport to print some details in table object.
Now I want to let my users to design and adjust their print report so I store report XML in database and load in FastReport Designer to user.
now to bind information in table.
We must add datasource in designer from database only and after that a connection is open and select all records to user and ...
My problem is that I want to use Custom Entity Object as Datasource for report not database table. How can I do that?
So if possible when the user opens report designer he can adjust column remove or add and drag new columns from datasource to report table and when save that report.
I run print by passing list to RegisterData function of report and it is ok.
You can pass list of any objects to the RegisterData method, look at the DataFromBusinessObject example.

Combine two datasets in one Crystal Report

I want to create a type of Summary report for an account. The report should have a chart of account data from one data source AND a grid of different account data from another data source.
I want to use all of the data from table one where account_ID = X AND I want to use all of the data from table two where account_ID = x.
Crystal Reports will let me add two different datasources, but It wants to link them to create a sub report in a Master / Details kind of way. I need to report on ALL of the data in table one, and all of the data in table two.
I'm a bit confused on how to do that.
Note: When I'm doing this for one report only, I just create a datatable from a view filtered by the account_ID and then set that as the datasource for the report. That way the heavy lifting is done before Crystal Reports gets the data. Again, not sure how to do that for two different datasources.
If the datasets are different enough that a JOIN doesn't make sense, you'll want to use a sub-report. First, create the report as if you were only using one of the data sets. Then, insert a sub-report where you want the second grid to show up (go to Insert --> Subreport); usually putting it in a new section. Build the sub-report using only the second dataset -- it may help to think of it as a full report in itself, as if the main report didn't exist.
Right-click the sub-report "field" in the main report and select Change Subreport Links. Add the account_ID field and you'll automatically get a parameter, Pm-Table.account-ID, and basic select expert in the sub-report itself.
Double-click it, and you'll get a new tab for just the sub-report. In the long run, you'll want most of the sections suppressed, so the output is just the grid.
Once all that is done, running the main report will display both sets of results.

Binding data on ReportViewer

I am developing a Report using ReportViewer with ASP.NET and C#.
I'm binding data from a DataSource to a Tablix object using the .RDLC design view.
Inside this Tablix, there's a field that must me filled with one field from de datasource OR another one depending of an expression.
The expression in the field I am trying to use to achieve that is:
=IIf(IsNothing(Fields!PREMIO_CALCULADO_1.Value), Fields!PREMIO_CALCULADO_1.Value,Fields!RECUPERACAO_CALCULADA_INI_1.Value)
If the Field "PREMIO_CALCULADO_1" is null, then fill it with "RECUPERACAO_CALCULADA_INI".
I'm not having compilation errors but when I execute the report where this value should be there is an #error tag.
Am I doing something wrong with that expression?
Thank you very much.
It looks like you have the return values in the wrong position.
Just add a NOT before IsNothing.

Categories

Resources