Quantcast
Channel: SCN : All Content - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2935

N-up DataWindow issue

$
0
0

Hi everyone

 

I have N-up Datawindow with two rows per detail band to show general information with photo from players of my table.

 

 

To put the photo of each player I have a function with FOR .. NEXT to get the BLOB value for each player and save it into file and then set the file name into field "foto"...... My issue it's when a Player has not photo, I assign to him a default file (LOGO_LIGA.jpg'), but show me the photo for the first player

 

 

I attached a file to see it ... the second player has not photo and show me the same photo for the first player.

 

The Function to get the photo from table... I'm working with Powerbuilder 11.5 Build 2506

 

Blob abl_foto

Integer li_cuantos

Integer li_equipo, li_jugador

 

n_cst_filesrvwin32 lnv_file

lnv_file = Create n_cst_filesrvwin32

filedelete('fotojugador.jpg')

 

dw_detalle.SetRedraw(False)

For li_cuantos = 1 TO dw_detalle.RowCount()

    li_equipo = dw_detalle.GetItemNumber(li_cuantos,"jugador_expulsado_id_equipo")

    li_jugador = dw_detalle.GetItemNumber(li_cuantos,"jugador_expulsado_id_jugador")

    SELECTBLOB jug_foto INTO :abl_foto

    FROM jugador

    WHERE id_cliente = :gi_cliente AND id_sucursal = :ii_sucursal AND id_torneo = :ii_torneo AND id_equipo = :li_equipo AND id_jugador = :li_jugador ;

    If Sqlca.Sqlcode <> 0 OR Isnull(abl_foto) Then

        SetNull(abl_foto)

        dw_detalle.object.foto[li_cuantos] ='LOGO_LIGA.jpg'

    Else

        lnv_file.of_filewrite( 'fotojugador'+String(li_cuantos)+'.jpg', abl_foto, False )

        dw_detalle.object.foto[li_cuantos] = 'fotojugador'+String(li_cuantos)+'.jpg'

    End If

NEXT

dw_detalle.SetRedraw( True)  


Viewing all articles
Browse latest Browse all 2935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>