Due liste nello stesso report

mercoledì 25 giugno 2008 - 09.45

anza Profilo | Newbie

Ciao a tutti,
vi sembrerà una domanda banale. Devo necessariamente inserire nello stesso report due report di dettagli diversi provenienti da due tabelle diverse.

Il problema è che se aggiungo una nuova sezione dettagli e vi inserisco i dati da visualizzare mi si mischiano. Vi faccio un esempio

TAB1
PIPPO
PLUTO
TOPOLINO

TAB2
1
2
3


Se inserisco due righe dettagli il risultato è:
pippo
1
pluto
2
topolino
3

Io invece vorrei

PIPPO
PLUTO
TOPOLINO

1
2
3

Mi sono spiegato ??? Grazie

Anonimo Profilo | Senior Member

Devi necessariamente crearti un report che contiene due sotto report ognuno dei quali ha il suo dettaglio.

Team Icon - Software Engineering
------------------------------
Unicredit Global Information Services Spa
Chief Solution Architect

anza Profilo | Newbie

OK Grazie

anza Profilo | Newbie

Non riesco pero' a esegure una RecordSelectionFormula sul subreports USO VB6





Set Report = crApp.OpenReport(link_REPORT & "rintr_1.rpt")
Report.EnableAsyncQuery = True
Report.DiscardSavedData
Set Report1 = crApp.OpenReport(link_REPORT & "Rintracciability.rpt")
Report1.EnableAsyncQuery = True
Report1.DiscardSavedData

For X = 1 To Report.Database.Tables.Count
Report.Database.Tables.Item(X).ConnectionProperties.DeleteAll
Report.Database.Tables.Item(X).ConnectionProperties.Add "Provider", "SQLNCLI"
Report.Database.Tables.Item(X).ConnectionProperties.Add "Data Source", Reportserver
Report.Database.Tables.Item(X).ConnectionProperties.Add "Database", ReportDB
Report.Database.Tables.Item(X).ConnectionProperties.Add "User ID", ReportLogin
Report.Database.Tables.Item(X).ConnectionProperties.Add "Password", ReportPassw
Report.Database.Tables.Item(X).ConnectionProperties.Add "UseDSNProperties", True
Next X

For X = 1 To Report1.Database.Tables.Count
Report1.Database.Tables.Item(X).ConnectionProperties.DeleteAll
Report1.Database.Tables.Item(X).ConnectionProperties.Add "Provider", "SQLNCLI"
Report1.Database.Tables.Item(X).ConnectionProperties.Add "Data Source", Reportserver
Report1.Database.Tables.Item(X).ConnectionProperties.Add "Database", ReportDB
Report1.Database.Tables.Item(X).ConnectionProperties.Add "User ID", ReportLogin
Report1.Database.Tables.Item(X).ConnectionProperties.Add "Password", ReportPassw
Report1.Database.Tables.Item(X).ConnectionProperties.Add "UseDSNProperties", True
Next X


Report.RecordSelectionFormula = "{Contenitori_op_test.figlia} = '" & Text1 & "'"
Report1.RecordSelectionFormula = "{Contenitori_operazioni.figlia} = '" & Text1 & "'"

Me.cr1.ReportSource = Report1


cr1.ViewReport
Set Report1 = Nothing
Set crApp = Nothing
DoEvents
cr1.Refresh

freeteo Profilo | Guru

ciao,
ho visto il tuo messaggio privato, purtroppo non uso vb6 da parecchio, quindi non saprei aiutarti dettagliatamente.
Però dal tuo codice vedo che non apri il sottoreport, ma un altro report, non c'è qualche metodo tipo "OpenSubReport" del report principale (che a quanto vedo è la variabile "Report1" che è quella che poi passi al viewer...

Qualcosa tipo:
Set sottoreport = Report1.OpenSubReport("nomeSottoReport"); sottoreport.RecordSelectionFormula = ....

ciao.

Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5