Results 1 to 5 of 5

Thread: VB.Net 2015 ReportViewer change Server (Production Server)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    VB.Net 2015 ReportViewer change Server (Production Server)

    I developed VB.Net 2010 application, with some Reports in Microsoft Report Viewer 2010. During programming time, we successfully created a DataSet and correctly use for Design a new Microsoft Report Viewer .rdlc, pointing to an SQL Server 2012 EXPRESS on local database in Developer Computer. Everything works fine. But when we try to deploy the .exe application in Production Environment, SQL SERVER 2012R2, pointing to de Production DATABASE. The Report Viewer still pointing to the Developer computer. Unsuccessfully tried some tricks from internet. Not working. Really appreciate some help.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: VB.Net 2015 ReportViewer change Server (Production Server)

    Is there anything in the config file that specifies where the data comes from? How are you loading the report in code?

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    Re: VB.Net 2015 ReportViewer change Server (Production Server)

    I'm Not using a Config file.
    In the main program created a Connection to Production Server

    Data Source=SRVADM2008;Initial Catalog=CentrolubDB;User ID=sa;Password=123

    Use a DataSet and DataAdapter: CentrolubDBDataSetOts.Ots
    Ots is the Table and OtsId is the Id of the record I want to Report

    Used a Wizard to create the Report ReportLabel.rldc
    Created a Form Containig the Control ReportViewer1
    Pass an xOtsId containing the Id

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Dim rptparamEmpresa As New ReportParameter("paramCompanyName", cnfDescrip)
    ReportViewer1.LocalReport.SetParameters(rptparamEmpresa)
    If xOtsId<>0 Then
    Me.OtsTableAdapter.FillByOtsId(Me.CentrolubDBDataSetOts.Ots, xOtsId)
    Me.ReportViewer1.RefreshReport()
    End If
    End Sub

    But the ReportLabel.rldc when loading still searching the Development Laptop.
    What is wrong?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: VB.Net 2015 ReportViewer change Server (Production Server)

    Quote Originally Posted by adelmastro View Post
    I'm Not using a Config file.
    That's probably your issue. You should be. It appears that you have created a typed DataSet. When you do that, the connection string is stored in the config file by default. The reason for that is so that you are able to do exactly what you want to do now: change the connection string. If there is a config file present, the connection string will be read from there, so you can modify it in the config file any time to use a different database.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    Re: VB.Net 2015 ReportViewer change Server (Production Server)

    I found the app.config file, edited and workd fine. At last. Thank you so much jmcilhinney.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width