Jump to content
Nelson Sousa

É possível mais de um subreport no reportviewer?

Recommended Posts

Nelson Sousa

Olá pessoal,

Estou usando o VS2010 no WIN7.

É possível a colocação de mais de um subreport num relatório pai?

Em caso positivo, como faze-lo?


Um Abraço,

Nelson Sousa

Share this post


Link to post
Share on other sites
Nelson Sousa

Ok,

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)
    Try
	    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))
	    e.DataSources.Add(rptDataSource)
    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

Share this post


Link to post
Share on other sites
Nelson Sousa

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))
		    e.DataSources.Add(rptDataSource)
	    Next


Um Abraço,

Nelson Sousa

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.