none
Trying to generate reports (Crystal Reports) from a remote sql server with VB.net RRS feed

  • Question

  • Hey guys, I need help with Crystal Reports. 

    I'm trying to generate reports from a remote database using a connection string. Everyting is working okay with the connection, it's just with the reports the problem.

    I have a stored procedure in my sql database with one parameter. I'm using Crystal's wizard to make a local connection to bring the stored procedure, but by code, I'm giving it my connection string saved in mysettings.

     Dim svrcon = My.Settings.ServerCon
        Dim cn As New SqlConnection(svrcon)

    Try Dim dt As New DataTable Dim iden As String = TextBox1.Text Using cn As New SqlConnection(svrcon) cn.Close() Using query As New SqlCommand("BSolicitante_Reportes @id = '" & iden & "'", cn) cn.Open() Dim reader As SqlDataReader = query.ExecuteReader dt.Load(reader) Dim rpt As New RptPrueba_2 rpt.SetParameterValue("@id", iden) CrystalReportViewer1.ReportSource = rpt End Using End Using Catch ex As Exception MessageBox.Show("Error: " & ex.ToString) End Try

    The parameter is taken from textbox1.text.

    "BSolicitante_reportes" is my stored procedure.

    Once I try to generate the report from a client PC, it shows me the database login...

    THE LOGIN IMAGE: https://social.msdn.microsoft.com/Forums/getfile/1423754

    Please help! 

    Thursday, April 4, 2019 6:11 AM

All replies

  • Hi,

    According to your description, your issue is more related about Crystal Reports. And this forum is discussing and asking questions about the vb.net.

    Ask in the following forum.

    https://help.sap.com/bocr

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 4, 2019 8:43 AM