VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx"
Begin VB.Form FOptReporte 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Reporte de Artículos"
   ClientHeight    =   3135
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4065
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3135
   ScaleWidth      =   4065
   StartUpPosition =   2  'CenterScreen
   Begin Crystal.CrystalReport crReporte 
      Left            =   2370
      Top             =   240
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   348160
      PrintFileLinesPerPage=   60
      WindowShowSearchBtn=   -1  'True
   End
   Begin VB.CommandButton cmdCancelar 
      Caption         =   "&Cancelar"
      Height          =   735
      Left            =   2460
      Picture         =   "FOptReporte.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2220
      Width           =   1425
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "&Aceptar"
      Height          =   735
      Left            =   2460
      Picture         =   "FOptReporte.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   1440
      Width           =   1425
   End
   Begin VB.Frame frmOrden 
      Caption         =   "Ordenado por :"
      Height          =   1215
      Left            =   210
      TabIndex        =   8
      Top             =   1710
      Width           =   2025
      Begin VB.OptionButton optDescr 
         Caption         =   "Descripción"
         Height          =   285
         Left            =   210
         TabIndex        =   4
         Top             =   810
         Width           =   1635
      End
      Begin VB.OptionButton optCodigo 
         Caption         =   "Código"
         Height          =   255
         Left            =   210
         TabIndex        =   3
         Top             =   420
         Value           =   -1  'True
         Width           =   1065
      End
   End
   Begin VB.Frame fraGrupo 
      Caption         =   "Agrupados por :"
      Height          =   1395
      Left            =   210
      TabIndex        =   7
      Top             =   150
      Width           =   1995
      Begin VB.OptionButton optSag 
         Caption         =   "Sin agrupar"
         Height          =   285
         Left            =   210
         TabIndex        =   2
         Top             =   990
         Width           =   1155
      End
      Begin VB.OptionButton optScat 
         Caption         =   "Sub Categoria"
         Height          =   255
         Left            =   210
         TabIndex        =   1
         Top             =   660
         Width           =   1635
      End
      Begin VB.OptionButton optCat 
         Caption         =   "Categoria"
         Height          =   315
         Left            =   210
         TabIndex        =   0
         Top             =   270
         Value           =   -1  'True
         Width           =   1485
      End
   End
   Begin VB.Image Image1 
      Height          =   720
      Left            =   2880
      Picture         =   "FOptReporte.frx":0614
      Stretch         =   -1  'True
      Top             =   390
      Width           =   600
   End
End
Attribute VB_Name = "FOptReporte"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdaceptar_Click()
On Error GoTo TrataError

Screen.MousePointer = 11
If optCat.Value Then
    crReporte.ReportFileName = GstrReportesInv + "rpt_Articulos_x_Categoria.rpt"
Else
    If optScat.Value Then
        crReporte.ReportFileName = GstrReportesInv + "rpt_Articulos_x_SubCategoria.rpt"
    Else
        crReporte.ReportFileName = GstrReportesInv + "rpt_Articulos.rpt"
    End If
End If

  crReporte.WindowTitle = "Reporte de Articulo"
  crReporte.Formulas(1) = "formusuario=stringvar strusuario; strusuario:='" & GCUSERID & "'"
  crReporte.Formulas(2) = "formscreen=stringvar strscreen; strscreen:='01.010.00'"
  
  If optCodigo.Value Then
    crReporte.SortFields(0) = "+{VW_ARTICULOS.CDARTICULO}"
  Else
    crReporte.SortFields(0) = "+{VW_ARTICULOS.DSARTICULO}"
  End If
  
  crReporte.WindowState = crptMaximized
  crReporte.WindowShowPrintSetupBtn = True
  crReporte.Action = 1
  crReporte.Reset
  Screen.MousePointer = 0
  Exit Sub
  
TrataError:
  Screen.MousePointer = 0
  MsgBox "No se puede generar reporte", vbExclamation, "Error"
End Sub

Private Sub cmdcancelar_Click()
    Unload Me
End Sub
