1
Good morning late evening
I already know that there are some topics related to this same issue that I am raising, but none participated in exactly the same conditions that led to the same event, as well as?
Well, come on!
- I imported the Datasets as well as their respective rpts from another project and.Vb report forms.
- I added as a reference in the project the . exe of the other application.
- I went to Set Datasource Location of the 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 implemented a few more things in the project and everything right, but when generating the report asks for login and password of the Dataset in which I play the information handled. I have several Datasets for various reports.
Thanks in advance for any participation.
Follow the example of one of the call types 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
Andrew, there is no problem in yourself posting the answer to your problem. Please publish the answer to your problem (as an answer). Then everyone will know that their doubt has been resolved and will be able to consult their methods.
– Rubico