[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Convert VB.Net code snippet to C#

Posted on 2011-02-20
Medium Priority
Last Modified: 2013-12-17
Need to write this VB.net code snippet in C#.  All it does is generate a SSRS report in the report viewer control.  Will also need to know what references are needed.  Thanks!
Private Sub Display_Report(ByVal strReportServerURL, ByVal strReportPath As String)

        lblError.Text = ""

        'Make the report viewer invisible for now
        rvLMS.Visible = False

            'Turn on the parameter prompts
            rvLMS.ShowParameterPrompts = True

            'Set the report Processing Mode
            rvLMS.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote

            'Set the Report Viewer - Server URL & Report Path
            rvLMS.ServerReport.ReportServerUrl = New Uri(strReportServerURL)
            rvLMS.ServerReport.ReportPath = strReportPath

            rvLMS.Visible = True

        Catch ex As Exception
            lblError.Text = "Error: " & ex.Message & " Stack Trace: " & ex.StackTrace
        End Try

    End Sub

Open in new window

Question by:MariaHalt
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 23

Accepted Solution

wdosanjos earned 2000 total points
ID: 34938321
It should be something like this:

private void Display_Report(string strReportServerURL, string strReportPath)
        // Clear
        lblError.Text = "";

        // Make the report viewer invisible for now
        rvLMS.Visible = false;

            // Turn on the parameter prompts
            rvLMS.ShowParameterPrompts = true;

            // Set the report Processing Mode
            rvLMS.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;

            // Set the Report Viewer - Server URL & Report Path
            rvLMS.ServerReport.ReportServerUrl = new Uri(strReportServerURL);
            rvLMS.ServerReport.ReportPath = strReportPath;

            rvLMS.Visible = true;
        catch(Exception e)
            lblError.Text = "Error: " + ex.Message + " Stack Trace: " + ex.StackTrace;

Open in new window


Author Closing Comment

ID: 34938581

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question