1. Jochen Peters
  2. Valentina Reports ADK
  3. Tuesday, August 01 2017, 03:50 AM
  4.  Subscribe via email
if i run this 2 or more time wait 2 second ir crash the xojo app web no idea way and no error code

Dim data As String
Dim mReport AS New VReport
Dim RepStrConn As String
Dim P1,P2,P3,P4,P5,P6 As Boolean
Dim fun1,MyQuery,SqlStr01 As String
Dim x as Integer

P1=False
P2=False
P3=False
P4=False
P5=False
P6=False

MyQuery=""

MyQuery=SelecRep(PopReportes.Text.Trim)

If RepCall.len=0 Then Exit Sub

If Checkbox1.Value=True Then
fun1="0"
Else
fun1="1"
End If

TxtNumCliente.Text=ReplaceAll(TxtNumCliente.Text,"'","";)
TxtDateFrom.Text=ReplaceAll(TxtDateFrom.Text,"'","";)
TxtDateTo.Text=ReplaceAll(TxtDateTo.Text,"'","";)

HTMLViewer1.LoadPage("<html></html>";)

If InStr(MyQuery,"f1";) > 0 Then
P1=True
End If

If InStr(MyQuery,"f2";) > 0 Then
P2=True
End If

If InStr(MyQuery,"c1";) > 0 Then
P3=True
End If

If InStr(MyQuery,"p1";) > 0 Then // Pueblo o Ciudad
P4=True
End If

If InStr(MyQuery,"s1";) > 0 Then /// Estatus de socio 0=Activo y 1=Inactivo
P5=True
End If

If InStr(MyQuery,"m1";) > 0 Then /// Marca de Gasolina
P6=True
End If


If MyQuery.Trim.Len=0 Then
MsgBox "**** Report Name No Found ****"
Exit Sub
End If

If (P1=True) or (P2=true) Then

If (TxtDateFrom.Text.Trim.len > 7) and (P1=True) Then
MyQuery=Replace(MyQuery,"f1",TxtDateFrom.text.Trim)
Else

If (P1=True) Then
MsgBox "*** Entre la Fecha 1 ***"
Exit Sub
End If

End If


If (TxtDateTo.Text.Len > 7) and (P2=true) Then
MyQuery=Replace(MyQuery,"f2",TxtDateTo.Text)
Else
If (P2=true) Then
MsgBox "*** Entre la Fecha 2 ***"
Exit Sub
End If

End If

End If

If P3=True Then
If TxtNumCliente.Text.Trim<>"" Then
MyQuery=Replace(MyQuery,"c1",TxtNumCliente.text.Trim)
Else
MsgBox "*** Entre Num. Cliente ***"
Exit Sub
End If
End If

If P4=True Then
//If TxtNumCaja.Text.Trim<>"" Then
//MyQuery=Replace(MyQuery,"caja1",TxtNumCaja.text.Trim)
//Else
//MsgBox "*** Entre Num. Cliente ***"
//Exit Sub
//End If
End If

If P5=True Then
If fun1.len=1 Then
MyQuery=Replace(MyQuery,"s1",fun1.Trim)
Else
MsgBox "*** Entre Num. Cliente ***"
Exit Sub
End If
End If

If P6=True Then
If fun1.len=1 Then
MyQuery=Replace(MyQuery,"m1",PopMarcas.Text.Trim)
Else
MsgBox "*** Entre Num. Cliente ***"
Exit Sub
End If
End If


If MyQuery.Trim="" Then Exit Sub

HTMLViewer1.LoadPage("<html></html>";)

#if DebugBuild Then
RepStrConn="mssql://host='localhost' port='1433' dbname='ADG' user='adgadmin' password='dragon64goku15'"
#Else
//RepStrConn="mssql://host='localhost\\SQLEXPRESS' port='1433' dbname='ADG' user='adgadmin' password='11'"
RepStrConn="mssql://host='localhost\\SQLEXPRESS' port='1433' dbname='ADG' user='adgadmin' password='11'"

#endif

projectPath = GetFolderItem( "adgreports.vsp" )

mProject = new VProject(projectPath)

mProject.Open()

if mProject <> nil then
session.MSDB.vCounts = mProject.ReportCount()
end if

Button1.Enabled=False
Button2.Enabled=False

try

mReport = mProject.MakeNewReport(RepCall, RepStrConn,MyQuery)

catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
MsgBox "** Make Report error " + errString
MsgBox "** Make Report error num =" + Str(errNumber)
end

Button1.Enabled=True
Button2.Enabled=True

If sPDF=False Then

try

data = mReport.PrintToBuffer(EVReportPrintType.kToHTML, 1 )

Exception err as VException
dim errNumber as Integer = err.ErrorNumber
dim errString as String = err.Message
MsgBox errString
end

HTMLViewer1.LoadPage(data)
Else

try

data = mReport.PrintToBuffer(EVReportPrintType.kToPDF, 1)

Exception err as VException
dim errNumber as Integer = err.ErrorNumber
dim errString as String = err.Message
MsgBox errString
end

Session.mPDF = New WebFile
Session.mPDF.MimeType = "application/pdf"
Session.mPDF.ForceDownload = True
Session.mPDF.FileName = "report.pdf"
Session.mPDF.Data = data

ShowURL( Session.mPDF.URL )

End If

mProject.Close
mReport=nil
projectPath=nil
mProject=nil

For x=1 to 2500

Next
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Please try to enable V4RB log in the Open event of the application:
Valentina.DebugLevel = EVDebugLevel.kLogParams

You will find "vlogs" folder near to the executable, it will contain log files like V4RB_Log_20170728_214808.log.
Attach this file here, please.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 1
Jochen Peters Accepted Answer
ok
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 2
Jochen Peters Accepted Answer
hi
the error is if you use varchar(255) in any field of table crash the app with out a error i change to nvarchar(255) and all works and no crash
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 3
Sergey Pashkov Accepted Answer
Hi Alexis
Happy to hear you've found the workaround.

I'm still unable to reproduce it.
Maybe it is related to the collation property of the field, but I've tried a few of them. Or maybe related to data.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories