Crystal Report link report parameter with stored procedure parameter - stored-procedures

I am using a third party program that will run Crystal Report. This program will pass a set of parameters to the Crystal Report, for example ReportNumber. I have to create a parameter with name of ReportNumber to be able to get the value. When the program runs and calls Crystal Report, it will automatically fill in this parameter value, so there will no longer be a popup to enter the parameter.
Then, I have a stored procedure in the Crystal Report. When I add this SP to CR, it will automatically create parameter e.g. #ReportNumber. If I run the report, it will show a popup to enter #ReportNumber as the SP requires it. My question is how do I link the parameter ReportNumber with #ReportNumber, such that I do not need to input it again?
It will be great if the solution does not use subreport, because I need to put subreports as well. This is due to CR does not support subreport inside subreport.

Related

How to pass parameter from main report to subreport

I have a main report. It´s working fine. My problem is in the sub report. In my sub-report I have a procedure with startdate and enddate. I would like to know if it is possible I can use the same date range from main report in my sub-report. I got a solution, but my solution needs to input the date range in main report and the same date range in my sub-report
Right-click on the sub-report object and choose Change Sub-report Links, then select how the parameter is to be used by the sub-report.
you can watch this YouTube video explains how to change sub-report Links
you can read this post too about the same subject
you need to create the same parameters in sub report that you have created in main report and link those parameters using sub report links, Which you can get my right click the sub report in main report.
once you link both paramterts same input will be passed to sub report aswell.
To pass that date range to the subreport do a right click on it and Change Subreport Link. On Subreport Links window search for your parameters in the left side and move them to the right one, make sure once you have them on the right one the option for Select data in subreport based on field: is unchecked for those 2 parameters. Then click OK and open the subreport. Once inside the subreport, go to Report/Selection Formulas/Record... to open the record selection formula. Under your Report Fields you will see the 2 parameters and you will be able to pass them to the date field you have in your subreport.

SSRS stored procedure with parameters as dataset not working

In my report i use 3 stored procedures. All of them are using parameters, and 2 of them work perfect and the third one is not, which i really do not understeand.
Stored procedure takes 2 parameters
SPgetData #reportnr,#username
The parameter #username is also used by the 2 other SP's
If I call in dataset Query Text then it works, but then I have to specify the parameters by hand like :
SPgetData '001','Administrator'
If I try to set Text to
SPgetData #reportNr,#username it opens the screen to enter the values by hand..
This is really very strange as 2 other procedures work perfectly with exact the same setup (As Stored Procedure with reportParameters...
This is not a limitation problem of 3 procedures or something because I tested this on a another report.rdl file and it didn't work also...
I figured this one out.
I just need to call the procedure via Text like :
SPgetData #reportNr,#Username
then when I get the screen to fill in defaults, I fill in working default values.
On the parameter tab, I attach the report parameters to the query parameters.
When I open the report, it uses the report parameters :)

SSRS Render Report through URL

I have a report that is being passed parameters through the URL, but would like to have the report load by default before the user has to click the 'View Report' button. I have rs:Command=Render in the URL but this doesn't seem to be doing it. Is there another tag that I am missing here? The URL is currently as follows:
https://server/subfolder/viewreport.aspx?Report%Name&rs:Command=Render&Parameter1=Value1&Parameter2=Value2
The report comes up with the appropriate values selected by default, as passed above, but it does not run until I hit View Report. Do I need to specify all the other parameters in the report through the URL in order for it to run by default, even though those parameters already have default values?
Found it, the report renders automatically as long as all parameters have a 'Default' value specified. Two text parameters in the report needed to have their default expressions set to =""

Jasperreport about Hyperlink to second report

I hava two report in the this file C:\tomcat\webapps\vivicloud\vivitrend\src\main\jasperreports: main report "dailyOrderReport.jrxml" / second report "dailyOrderReportDetail2.jrxml"
Main report have a ${sequence} field. I want to click the main report ${sequence} field can transfer parameter and link to "dailyOrderReportDetail2".
In the sequence filed I config the hyperlink and detail is
Hyperlink Target :self
Hyperlink Type: ReportExecution
Link parameter :
Parameter Name Expression
_report "repo:dailyOrderReportDetail2"
sequence $F{sequence}
But can not to link to dailyOrderReportDetail2.
In what you are trying to do i think you should skip the "repo:" in front of your linked report. And check that the relative path to your second report dailyOrderReportDetail2.jrxml is correct.
Check the first answer here for a step by step mini tutorial on how to do it (using servlets), or see a similar approach on this blog.
Hope this helps you get in the right direction, or at least gives you some pointers.
If both report are already running in JasperReport Server then problem must be in relative path of second report.
just check relative path of the second report must be written in red color and give the full path like:-
"repo:/path of the second report "
I know this is late, but might help someone else in the future.
I'm guessing you mean kind of like a drill-down report. Make sure all the parameters are exactly the same in the second report that need to pass over from the first report.
NOTE: You will not use the .jrxml file of the "sub report". The second report needs to be actually published with input controls and all.
Click the field you want to be the hyperlink
Click hyperlink in properties tab
Link Target : Blank
Link Type : ReportExecution
Parameters (very important)
1. Parameter: _report
Expression: path of published report (not .jrxml)
2. parameter: your choice :
Expression: Whatever carries over
now when you publish this main report and you click on the hyperlink, it will run the second report with the parameters set.

Passing Parameters To report using url address

I'm developing some reports for Main Page in Dynamics Ax, however the problem i've got is connected with SSRS. Typical scenario i have report A and report B, i need to open report A when clicking on report B. Opening report itself is correct, but passing parameters is more tricky. After some research i got to the point when I want to run report A in browser using the adress
http://(server address)/Reports/Pages/Report.aspx?ItemPath=/Dynamics/Reports.VendorsOpenTransactionsCount.AutoDesign1&rs:Command=Render&VendOpenTrans_dataAreaID=dor&VendOpenTrans_p1=2011-07-21&VendOpenTrans_p2=2011-07-21
and then i get report displayed(main window) but non of the parameters are validated into proper textboxes, and changing the value of them doesn't have any impact.
can anyone here help me with that "challenge"
Actually, I believe the critical difference is whether you are passing parameters (via URL) to a report that is using database engine or the SSAS - the analytical engine as a data source.
If your data source is the analytical engine then your parameter should be given in the 'dimension format', rather than in the precise format, like &parmname=140, etc. Allow me to explain using specific example and using SSAS data source for this illustration (there is plenty of solutions available on the net for the database engine based solution, including Microsoft postings).
My server name is FRELASM.
So, I have SSAS data source called DealerSource (not visible here).
I have parameter defined in the parameter's section of the SSRS as: #DwDimDealerCorpDlrNbr
In SSAS I have the following dimension:
[Dw dim Dealer] that has attribute: [Corp Dlr Nbr] ==> giving: [Dw dim Dealer].[Corp Dlr nbr]
What I want is to show a report for a single dealer 'number' (but it is a text field, hence the leading zeros) equal to 00140. So, I am looking for Corporate dealer number=00140.
The parameter passing DOES NOT WORK if I use this [this would be find against database engine, but it does not work with SSAS).
What you need is this:
replace constant 00140 with [dimension].[attribute].[value]
do not use & character, rather replace it with: %26.
So, the working version is this.
Can you take a look at this page: http://msdn.microsoft.com/en-us/library/ms155391.aspx
It explains about when you can pass parameters via URL. Maybe your parameters are not set to Prompt for user input. HTH.

Resources