Jump to content

É possível mais de um subreport no reportviewer?

Nelson Sousa

Recommended Posts


Mas tenho uma dúvida quanto aos datasources.

Vou criar um para cada sub-report dentro do mesmo SubreportProcessingEvent?

Veja como faço para 1 sub-report:

   Public Sub SubreportProcessingEvent(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
	    Dim ds_Subs As DataSet
	    Dim Busca As New Cls_Dados
	    ds_Subs = Busca.RetornarDataSet(str_SQL_Sub_Report)
	    Dim rptDataSource As New ReportDataSource _
										  ("DS_Sub", ds_Subs.Tables(0))
    Catch ex As Exception
	    MessageBox.Show(ex.Message, My.Application.Info.Title, _
									 MessageBoxButtons.OK, MessageBoxIcon.Error)
    End Try
   End Sub
Edited by Nelson Sousa

Um Abraço,

Nelson Sousa

Link to comment
Share on other sites

Acabei resolvendo fazendo um loop dentro do SubreportProcessingEvent

	    For I = 0 To (int_Qtde_Subs - 1) 'Faz loop pela qtde de subs informada na int_Qtde_subs
		    ds_Subs = Busca.RetornarDataSet(str_SQL_Sub_Report(I))
		    Dim rptDataSource As New ReportDataSource("DS_Sub" & I, ds_Subs.Tables(0))

Um Abraço,

Nelson Sousa

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.