Come si fa in un datareport a cambiare l'orientamento di stampa????
Da verticale a orrizontale????
Ciao e grazieeeeeeee
Come si fa in un datareport a cambiare l'orientamento di stampa????
Da verticale a orrizontale????
Ciao e grazieeeeeeee
Nel modulo del Report:
With Me
.Orientation = rptOrientLandscape
. ...
. ...
End With![]()
LM
Io sotto un pulsante della form ho messo:
Load DataReport3
DataReport3.Sections(1).Controls("Mese").Caption = UCase(Mese2)
DataReport3.Sections(1).Controls("Data").Caption = [Data2]
DataReport3.Sections(1).Controls("Esecutore").Capt ion = UCase(Esecutore2)
DataReport3.Sections(1).Controls("NFoglio").Captio n = [NFoglio2]
DataReport3.Sections(3).Controls("Finalita").Capti on = UCase(Finalita)
DataReport3.Sections(3).Controls("Descrizione").Ca ption = UCase(Descrizione2)
DataReport3.Show vbModal
Dove devo mettere quello che mi hai scritto, nel codice proprio della datareport???? Se si in che contesto
Perchè facendo doppio click nella mia datareport entrando nel codice ho solo queste stringhe:
Private Sub DataReport_Error(ByVal JobType As MSDataReportLib.AsyncTypeConstants, ByVal Cookie As Long, ByVal ErrObj As MSDataReportLib.RptError, ShowError As Boolean)
End Sub
Fammi sapere
Ciao e grazieeeeeeeeeee
Ciao,
fai così, ed imposta anche i margini del Report:
codice:... ... ... ... ... ... DataReport3.Sections(3).Controls("Descrizione").Caption = UCase(Descrizione2) With Me .Orientation = rptOrientLandscape ' Modifica secondo le tue necessità: .TopMargin = 567 .BottomMargin = 851 .LeftMargin = 0 .RightMargin = 1134 .ReportWidth = 14000 'Centra la visualizzazione del Report: If Me.WindowState = vbNormal Then .Width = Screen.Width .Height = Screen.Height .Left = (Screen.Width - .Width) / 2 .Top = (Screen.Height - .Height) / 2 End If End With DataReport3.Show vbModal![]()
LM
Mi va in errore mi dice:
Variabile non definita
E mi evidenzia: rptOrientLandscape
Ho messo le virgolette:
.Orientation = "rptOrientLandscape"
A questo punto non mi da più quell'errore ma mi scrive
Impossibile trovare il metodo o il membro dei dati
Cosa può essere????
Non è possibile (il codice che ho inviato da tempo è in uso), posta una copia delle righe di codice che hai scritto.![]()
LM
Nella form, ho un pulsante "STAMPA" alla sua pressione esegue questo:
Private Sub Command60_Click()
Set DataReport3.DataSource = rsRecordSet2
Set DataReport3.DataSource = rsRecordSet3
Dim Mese2, Data2, Esecutore2, NFoglio2, Finalita, Descrizione2 As String
Mese2 = rsRecordSet2![Mese]
Data2 = rsRecordSet2![Data1]
Esecutore2 = rsRecordSet2![Esecutore]
NFoglio2 = rsRecordSet2![N Foglio]
Finalita = rsRecordSet3![Prodcampion]
Descrizione2 = rsRecordSet3![Descrizione]
Load DataReport3
DataReport3.Sections(1).Controls("Mese").Caption = UCase(Mese2)
DataReport3.Sections(1).Controls("Data").Caption = [Data2]
DataReport3.Sections(1).Controls("Esecutore").Capt ion = UCase(Esecutore2)
DataReport3.Sections(1).Controls("NFoglio").Captio n = [NFoglio2]
DataReport3.Sections(3).Controls("Finalita").Capti on = UCase(Finalita)
DataReport3.Sections(3).Controls("Descrizione").Ca ption = UCase(Descrizione2)
With Me
.Orientation = "rptOrientLandscape"
' Modifica secondo le tue necessità:
.TopMargin = 567
.BottomMargin = 851
.LeftMargin = 0
.RightMargin = 1134
.ReportWidth = 14000
'Centra la visualizzazione del Report:
If Me.WindowState = vbNormal Then
.Width = Screen.Width
.Height = Screen.Height
.Left = (Screen.Width - .Width) / 2
.Top = (Screen.Height - .Height) / 2
End If
End With
DataReport3.Show vbModal
End Sub
Ciao e grazieeeeeeeee
Ciao marco,
io ritengo che dovresti apportare le seguenti modifiche alla routine.
Nel modulo ove è inserito il CmdButton:
Private Sub Command60_Click()
Call DataReport3.DataReport3_Load
End Sub
Nel modulo del DataReport3:
Poi, stai attento perchè in questo modo dichiari una sola variabile string (Descrizione2 As String), mentre tutte le altre sono variant. Quindi rettifica: Dim Mese2 As String, Data2 As String, ... .codice:Public Sub DataReport3_Load() On Error Resume Next Set DataReport3.DataSource = rsRecordSet2 Set DataReport3.DataSource = rsRecordSet3 Dim Mese2, Data2, Esecutore2, NFoglio2, Finalita, Descrizione2 As String Mese2 = rsRecordSet2![Mese] Data2 = rsRecordSet2![Data1] Esecutore2 = rsRecordSet2![Esecutore] NFoglio2 = rsRecordSet2![N Foglio] Finalita = rsRecordSet3![Prodcampion] Descrizione2 = rsRecordSet3![Descrizione] DataReport3.Sections(1).Controls("Mese").Caption = UCase(Mese2) DataReport3.Sections(1).Controls("Data").Caption = [Data2] DataReport3.Sections(1).Controls("Esecutore").Caption = UCase(Esecutore2) DataReport3.Sections(1).Controls("NFoglio").Caption = [NFoglio2] DataReport3.Sections(3).Controls("Finalita").Caption = UCase(Finalita) DataReport3.Sections(3).Controls("Descrizione").Caption = UCase(Descrizione2) With Me .Orientation = rptOrientLandscape ' Modifica secondo le tue necessità: .TopMargin = 567 .BottomMargin = 851 .LeftMargin = 0 .RightMargin = 1134 .ReportWidth = 14000 'Centra la visualizzazione del Report: If Me.WindowState = vbNormal Then .Width = Screen.Width .Height = Screen.Height .Left = (Screen.Width - .Width) / 2 .Top = (Screen.Height - .Height) / 2 End If End With DataReport3.Show vbModal End Sub
Ho provato il codice in apparenza funziona (manca la connessione, ecc. ... la quale ricorda che deve essere chiusa).
LM
Ho fatto come hai detto, ma niente
mi dice come prima:
A questo punto non mi da più quell'errore ma mi scrive
Impossibile trovare il metodo o il membro dei dati
e mi evidenzia la paraola .Orientation
Mi è venuta in mente una cosa:
1)Nei riferimenti sotto il menù PROGETTI devo mettere niente????
Perchè .Orientation proprio non lo vedo, se io metto il . si apre il men a tendina delle propretà ma .Orientation non esiste
2)Visto che hai provato l'esempio da te funzionante , te la senti di inviarmelo per posta cosi posso dirti con certezza anche se da me funziona
Fammi sapere
Ciao e grazieeeeeeeeeeeee