Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 20
  1. #1

    [VB6] DatReport, orientamento

    Come si fa in un datareport a cambiare l'orientamento di stampa????

    Da verticale a orrizontale????

    Ciao e grazieeeeeeee

  2. #2
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    Nel modulo del Report:
    With Me
    .Orientation = rptOrientLandscape
    . ...
    . ...
    End With
    LM

  3. #3

    Scusami

    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

  4. #4
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    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

  5. #5

    Noooooo

    Mi va in errore mi dice:

    Variabile non definita

    E mi evidenzia: rptOrientLandscape

  6. #6

    Ho fatto

    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????

  7. #7
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    Non è possibile (il codice che ho inviato da tempo è in uso), posta una copia delle righe di codice che hai scritto.
    LM

  8. #8

    Ecco

    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

  9. #9
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    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:
    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
    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, ... .
    Ho provato il codice in apparenza funziona (manca la connessione, ecc. ... la quale ricorda che deve essere chiusa).
    LM

  10. #10

    Niente

    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

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.