cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I have run the the update to SP26 for some reason my parameters are no longer showing up in the parameter panel on the web crystalreportviewer after the report has initially loaded. The parameter(s) is prompted initially to run the report.

As a work around I have set HasToggleParameterPanelButton= false, HasRefreshButton=true, and ReuseParameterValuesOnRefresh=false.

<CR:CrystalReportViewer ID="Report" Runat="server" AutoDataBind="true" Height="1250px" HasCrystalLogo="False" HasRefreshButton="True" HasToggleParameterPanelButton="false" BestFitPage="True" ReuseParameterValuesOnRefresh="false" ToolPanelView="None" DisplayStatusbar="True" HasToggleGroupTreeButton="false" EnableDatabaseLogonPrompt="False" PrintMode="ActiveX" />

This does show the parameter(s) as expected. My report parameters are set to editable and when you loop through the parameterfield using the code below the Usage2 values is already set to all the available values (side note, this snip came from another post, but if you try it you will get a Not Supported exception)

foreach (CrystalDecisions.Shared.ParameterField parameterField in reportDocument.ParameterFields)
{
  parameterField.ParameterFieldUsage2 = ParameterFieldUsage2.ShowOnPanel;
}

As you can see from pic here the parameter for this report is missing from the Parameter Panel. Not sure how to fix this issue. Any suggestions would be appreciated. Thinking it might be a bug. I included my code below for reference. Prior to SP25 I was clearing the parameterfieldinfo property using Report.ParameterFieldInfo.Clear() in the report init method. This might have something to do with the missing parameters, but I have no way of testing, because if I add that back I cannot get the report to load as when you click the OK on the parameter dialog the report's ajax postback just returns the parameter dialog back instead of the rendered report.

 Private crReportDoc As ReportDocument
 Private rpt As String

    Private Sub Report_Init(sender As Object, e As System.EventArgs) Handles Report.Init
        Dim exportFormatFlags As Integer = CInt(CrystalDecisions.[Shared].ViewerExportFormats.PdfFormat Or CrystalDecisions.[Shared].ViewerExportFormats.ExcelFormat)
        Report.AllowedExportFormats = exportFormatFlags
        'Report.ParameterFieldInfo.Clear() 'started causing prompt to not go away if set 'removed 12/13/19 CR SP25 & SP26
        LoadCRV()
    End Sub
    Sub LoadCRV()
        Try
            rpt = Request.QueryString("rpt")
            If rpt Is Nothing Then Response.Redirect("~/reports/crm.aspx")
            Dim rptPath As String = Nothing
            If rpt IsNot Nothing Then rptPath = Server.MapPath("~/reports/cr/" + rpt)
            If rptPath IsNot Nothing Then
                Try
                    crReportDoc = New ReportDocument
                    crReportDoc.Load(rptPath)
                    For Each rd As ReportDocument In crReportDoc.Subreports
                        crDBLogin(rd)
                    Next
                    crDBLogin(crReportDoc)
                    Report.ReportSource = crReportDoc

                    Report.RefreshReport()
                Catch ex As CrystalReportsException
                Catch ex As Exception
                End Try
            End If
        Catch ex As Exception
        End Try
    End Sub
    Private Sub cr_Unload(sender As Object, e As System.EventArgs) Handles Me.Unload
        If rpt IsNot Nothing Then
            If crReportDoc IsNot Nothing Then
                If crReportDoc.Subreports IsNot Nothing Then
                    For Each srDoc As ReportDocument In crReportDoc.Subreports
                        If srDoc IsNot Nothing Then
                            srDoc.Close()
                            'srDoc.Clone() 'idea from web post
                            srDoc.Dispose()
                            GC.Collect()
                            'GC.WaitForPendingFinalizers() 'idea from web post
                        End If
                    Next
                End If
                crReportDoc.Close()
                'crReportDoc.Clone() 'idea from web post
                crReportDoc.Dispose()
                GC.Collect()
                'GC.WaitForPendingFinalizers() 'idea from web post
            End If
            If Report IsNot Nothing Then
                Report.Dispose()
            End If
        End If
    End Sub

Notes about my upgrade:

I ran the exe as the admin as instructed. I let it install the 64bit msi. The 32bit msi was already installed, but did not get updated. I updated it manually. The VS toolbox still has the .3500 controls referenced so I removed them and added the new items (not sure if that was suppose to happen automatically). I did remove all my references in the image below and added them back which updated the project file to the .4000 dll's.

Project Specs
x86, 4.7.2 framework

View Entire Topic
0 Likes

Yes, monitor the web server

kevin_hicks
Explorer
0 Likes

Ok don.williams I have run the processmonitor, but I have no clue what I am looking for. I ran it just on iisexpress and only when I clicked the next page button in the crystal report viewer and when it prompted for the optional parameters I clicked stop on the process montior. Captured 42000 events. Should I filter those events with just SAP in the path? I am going to start reviewing now just to see if I can find anything that makes sense.

Also, I added two additional notes to the main question. I am starting to believe this might a bug related to handling optional prompts (parameters). Thanks for the help so far!

kevin_hicks
Explorer
0 Likes

don.williams so now I am really thinking this might be a bug with SP26. Will you please see if you can reproduce the optional prompt issue?

I have attached a sample project. (sample project here) This project was created using the crystal reports website template. I have one test.rpt file. Run the project and select the Name property only. Once report loads, then click next page. You should get a prompt for Color which is the optional parameter. If you just hit ok, then window closes but still on page 1. If you select a color it updates the report, but still on page 1. Only then can you click next page and page 2 will load.

My project is a web app and this a newer website project, so I am convinced it has to be a bug. Hopefully you will get the same results.

Don't forget to add the asp_net virtual directory to the vs/applicationhost.config file so the viewer loads. I also updated the physicalPath, but you might have to update that too if VS doesn't do it for you.