Good morning \ afternoon \ night
I already know that there are some topics related to the same issue that I am raising, but none of them participated exactly in the same conditions that led to the same event, what do you mean?
Well, come on!
- I imported from another project Datasets as well as their respective rpts and the report forms.vb.
- I added the other application's application as a reference in the project.
- I went into the Datasource Location Set of rpts and changed the Class Name to the current project.
The need to import these existing items is that the application in question will need to generate the same reports as the other.
I have implemented a few more things in the project and everything is fine, but at the time of generating the report it asks for a Dataset login and password in which I play the information handled. I have several Datasets for multiple reports.
Thanks in advance for your participation.
Here is an example of one of the types of calls to generate the report.
Sub ResultadoProgesterona(ByVal C As String, ByVal N As String, ByVal Imprimir As Boolean)
Dim SqlStr As String = "SELECT UTILIZAD"
Dim Con As New SqlConnection(myConnStr)
Con.Open()
Dim SqlAdapter As New SqlDataAdapter()
Dim DtSet As New DataSet
SqlAdapter.SelectCommand = New SqlCommand(SqlStr, Con)
SqlAdapter.Fill(DtSet, "ExameItem")
Dim row As DataRow
row = DtSet.Tables(0).NewRow()
DtSet.Tables(0).Rows.Add(row)
RelatorioProgesterona.RelProgesterona1.SetDataSource(DtSet)
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(0))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(1))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(6))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(3))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(4))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", N)
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(5))
RelatorioProgesterona.RelProgesterona1.SetParameterValue("", DtSet.Tables(0).Rows(0).Item(2))
If Imprimir Then
RelatorioProgesterona.RelProgesterona1.PrintToPrinter(1, False, 1, 1)
Else
CarregaForm(RelatorioProgesterona, pprincipal)
RelatorioProgesterona.WindowState = FormWindowState.Maximized
End If
DtSet.Dispose()
DtSet = Nothing
SqlAdapter.Dispose()
SqlAdapter = Nothing
Con.Close()
Con.Dispose()
Con = Nothing
End Sub