Link to home
Start Free TrialLog in
Avatar of glo-dba
glo-dba

asked on

SSRS ignoring url parameter

I'm rendering a SSRS report via a url.  It accepts the first parameter in the url, but ignores the second parameter (and the third parameter), but uses fourth parameter.  The first three parameters are cascading parameters; ProgramAreas determine Divisions, and Divisions determine Employees.  The Division in the url is in the drop down.  I believe that this did work at one time, but does not work any longer.  All parameters are integers.  Any ideas?

http://lulu/ReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fTimekeeperTrainingReports%2frptTimekeeperTrainingCascadingParms&rs%3aCommand=Render&SelectedProgramAreas=4&SelectedDivisions=1&SelectedEmployees=11326&MinimumHours=99999

Thanks
Avatar of PedroCGD
PedroCGD
Flag of Portugal image

Check the parameters names (is case sensitive) and give feedback
Avatar of glo-dba
glo-dba

ASKER

I copied the parameter names from the url and the report, thencompared them character by character.  They are the same, capitalization and all.
Check my example:
Try understand the Function generateReportLink

In the web.config I have:

 
 
 
 
 
 



And in asp page I have this:

Protected Sub butCallReport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles butCallReport.Click
Dim intEmpresa As Integer = Me.txtEmpresa.Text
Dim intTipoEmpresa As Integer = Me.txtTipoEmpresa.Text
Dim intEstado As Integer = 0
Dim strMne As String = Me.txtMnemonica.Text
Dim strDes As String = Me.txtDesignacao.Text
Dim dtDataInicial As DateTime = Me.txtDataInicial.Text
Dim dtDataFinal As DateTime = Me.txtDataFinal.Text
'Inicializacao Report2
Dim intTipoUser As Integer = 0
Dim intAmbiente As Integer = 0
'Incializacao Report4
Dim intUserId As Integer = 119
Dim strPathReport1 As String = "" 
Dim strPathReport2 As String = "" 
Dim strPathReport3 As String = "" 
Dim strPathReport4 As String = "" 
Select Case Me.cmbDestino.Text
Case "ActiveX"
strPathReport1 = "frmReport.aspx?prmReport=1&prmEmp=" & intEmpresa & "&prmTipoEmpresa=" & intTipoEmpresa & "&prmEstado=" & intEstado & " &prmMne=" & strMne & "&prmDes=" & strDes & " &prmDataIni=" & dtDataInicial & "&prmDataFin=" & dtDataFinal
strPathReport2 = "frmReport.aspx?prmReport=2&prmEmp=" & intEmpresa & "&prmTipoUser=" & intTipoUser & "&prmEstado=" & intEstado & "&prmUserId=" & strMne & "&prmDes=" & strDes & "&prmDataIni=" & dtDataInicial & "&prmDataFin=" & dtDataFinal & "&prmAmb=" & intAmbiente
strPathReport3 = "frmReport.aspx?prmReport=3&prmEmp=" & intEmpresa
strPathReport4 = "frmReport.aspx?prmReport=4&prmUserId=" & intUserId
Case "XHTML"
Dim strPathPrm1 As String = "&prmEmpresa=" & intEmpresa & "&prmTipoEmpresa=" & intTipoEmpresa & "&prmEstado=" & intEstado & "&prmMnemonica=" & strMne & "&prmDesignacao=" & strDes & "&prmDataInicial=" & dtDataInicial & "&prmDataFinal=" & dtDataFinal
Dim strPathPrm2 As String = "&prmEmpresa=" & intEmpresa & "&prmTipoUtilizador=" & intTipoUser & "&prmEstado=" & intEstado & "&prmUserId=" & strMne & "&prmDesignacao=" & strDes & "&prmDataInicial=" & dtDataInicial & "&prmDataFinal=" & dtDataFinal & "&prmAmbiente=" & intAmbiente
Dim strPathPrm3 As String = "&prmEmpresa=" & intEmpresa
Dim strPathPrm4 As String = "&prmUserId=" & intUserId
strPathReport1 = generateReportLink("ReportString", "rptEmpresaLista", strPathPrm1)
strPathReport2 = generateReportLink("ReportString", "rptUtilizadoresLista", strPathPrm2)
strPathReport3 = generateReportLink("ReportString", "rptEmpresaDetalhe", strPathPrm3)
strPathReport4 = generateReportLink("ReportString", "rptUtilizadorDetalhe", strPathPrm4)
End Select
Select Case Me.cmbReport.Text
Case "Empresa Lista" : Response.Redirect(strPathReport1)
Case "Utilizador Lista" : Response.Redirect(strPathReport2)
Case "Empresa Detalhe" : Response.Redirect(strPathReport3)
Case "Utilizador Detalhe" : Response.Redirect(strPathReport4)
End Select
End Sub
Function generateReportLink(ByVal myAppSetReportRoot As String, ByVal myAppSetReportFolder As String, ByVal myParameters As String) As String
Dim strReportRoot As String = System.Configuration.ConfigurationManager.AppSettings(myAppSetReportRoot)
Dim strReportFolder As String = System.Configuration.ConfigurationManager.AppSettings(myAppSetReportFolder)
Dim strReportFolderRep As String = Replace(strReportFolder, "/", "%2f", 1)
Dim strReportPath As String = strReportRoot + "/?" + strReportFolderRep + myParameters + "&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=false"
Return strReportPath
End Function


HELPED?!
Avatar of glo-dba

ASKER

It didn't help.  I'm generating my url through MS Access/MS VB:

Private Sub lnkIndividualEmployeeTrainingReport_Click()

Dim txtURL As String

txtURL = "http://lulu/ReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fTimekeeperTrainingReports%2frptTimekeeperTrainingCascadingParms&rs%3aCommand=Render&SelectedProgramAreas=" & Forms![frmCurrentUser]![dwProgramAreaID] & "&SelectedDivisions=" & Forms![frmCurrentUser]![dwDivisionID] & "&SelectedEmployees=" & Forms![frmCurrentUser]![dwEmployeeID] & "&MinimumHours=99999"

Application.FollowHyperlink txtURL

End Sub

Which generates this url:

http://lulu/ReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fTimekeeperTrainingReports%2frptTimekeeperTrainingCascadingParms&rs%3aCommand=Render&SelectedProgramAreas=4&SelectedDivisions=1&SelectedEmployees=11326&MinimumHours=99999

Any other suggestions?

Thanks
Avatar of glo-dba

ASKER

The url worked fine; but I get the same results.  The Program Area is populated correctly, but the Division (and Employee) are not selected:

http://lulu/ReportServer/Pages/ReportViewer.aspx?%2fDevelopment%2fTimekeeperTrainingReports%2frptTimekeeperTrainingCascadingParms&SelectedProgramAreas=4
&SelectedDivisions=1&SelectedEmployees=11326&MinimumHours=99999


Thanks again...
Go directly to your report server by http://lulu/ReportServer
Select the report
and open it..

you can see the report from here?
paste here the url you have in address bar
cheers
Avatar of glo-dba

ASKER

I only have access to the Development directory.  I can access it from:
http://lulu/ReportServer?%2fDevelopment

This is the url when I open the report:
http://lulu/ReportServer?%2fDevelopment%2fTimekeeperTrainingReports%2frptTimekeeperTrainingCascadingParms&rs:Command=Render

Thanks
Dvelopment\TimekeeperTrainingReports is the folder in SSRS, right?
rptTimekeeperTrainingCascadingParms is the reportname, right?

This report has paarmeters?
You see this report in IE from http://lulu/ReportServer?%2fDevelopment ?
Avatar of glo-dba

ASKER

This is the level I have access to:
http://lulu/ReportServer?%2fDevelopment

I then select this directory:
TimekeeperTrainingReports

Then I select this report:
rptTimekeeperTrainingCascadingParms

The report has default begin and end dates, which are populated.

The SelectedProgramArea parm is populated with 4, but the SelectedDivision and SelectedEmployee parms are not populated.  If I select Division 1 and Employee 11326 from the drop downs and view the report it uses the hidden parm SelectedMinimumHours to render the correct report.

Thanks
its' possible to send the report file and the database scripts related to this problem!?
cheers!!
ASKER CERTIFIED SOLUTION
Avatar of Tone' Shelby
Tone' Shelby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello...checking in on you. How are you coming along. Do you need further assistance / information  on this...thanks!