1. Jochen Peters
  2. Valentina Reports ADK
  3. Суббота, Июнь 06 2015, 08:08 PM
  4.  Подписаться через email
Hello
where i put Vshared Lib on linux my app is no working it need vshare libs.

where i can download vshare libs for linux ubuntu
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
ok
thanks
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
1.
vCounts is = 1

Is it wrong number of reports in your project?

2.
/Users/alexiscolonlugo/Documents/HomeDev.org/ADG/adgdb.db

Is it path on linux system? On linux users' folders are usually located at /home/username

3.
I've prepared a sample project of what you are trying to do,
it works on mac and linux, only a path to SQLite database was different.

SQLite database is located in user's Documents directory.
Project is located near to linux executable.

try
//________________________________________________________________________________
// PREPARE PROJECT

Dim projectPath As FolderItem = GetFolderItem( "sqlite_project.vsp" )
Dim project As VProject = New VProject( projectPath )

project.Open

//________________________________________________________________________________
// PREPARE DATASOURCE

Dim query As String = "SELECT * FROM table1"
Dim datasource As String = "sqlite:///home/user/Documents/sqlite_datasource.db"

//________________________________________________________________________________
// GENERATE REPORT

Dim report As VReport = project.MakeNewReport( "Report_1", datasource, query )

If report = Nil Then
MsgBox( "Report not generated" )
Return
End

//________________________________________________________________________________
// PRINT REPORT

Dim html As String = report.PrintToBuffer( EVReportPrintType.kToHTML, 1 )

HTMLViewer1.LoadPage( html )

catch e as VException
MsgBox( e.ErrorNumber.ToText + ": " + e.Message )
end
Вложения
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
the vCounts is = 1
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
same error no works
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
It should look like this:
sqliteDb="sqlite:///Users/alexiscolonlugo/Documents/http://HomeDev.org/ADG/adgdb.db";;
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
sqliteDb="sqlite://Users/alexiscolonlugo/Documents/http://HomeDev.org/ADG/adgdb.db";

File "Users/alexiscolonlugo/Documents/http://HomeDev.org/ADG/adgdb.db"; is not open.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
And what about opening a project?
It can throw an exception too, so to be sure you can add try-catch around it and check a message if any.


Session.projectPath = GetFolderItem( "adgreports.vsp" )

Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()


Maybe the app can't find a VSP file?

It would be much easier to debug your application in Xojo IDE right in Linux. Is it possible?
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
this is my code

Sub PrintRec(TransId As String)

Dim data As String
Dim mReport AS New VReport
Dim SqlStr01 As String
Dim sqliteDb As String
Dim vCounts As Integer

SqlStr01=""
#If TargetMacOS Then
#if DebugBuild then
sqliteDb="sqlite://Users/alexiscolonlugo/Documents/http://HomeDev.org/ADG/adgdb.db";
#ELSE
DbMain.DatabaseFile = GetFolderItem("C:\ADG\adgdb.db";)
#endif
#endif

#If TargetLinux Then
sqliteDb="sqlite://usr/local/apache2/htdocs/adg/adgdb.db"
#endif


//sqliteDb="sqlite://Users/alexiscolon/Documents/http://HomeDev.org/ADG\/adgdb.db"

SqlStr01="Select * From PayInfo INNER JOIN SocioInfo on PayInfo.SocioNum = SocioInfo.SocioNum Where Cnt='" + TransId + "'"

Session.projectPath = GetFolderItem( "adgreports.vsp" )

Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()

if Session.mProject <> nil then
vCounts = Session.mProject.ReportCount()
end if
//MsgBox "Load Rep OK "+ str(vCounts)

try
mReport = Session.mProject.MakeNewReport("Pagos", sqliteDb, SqlStr01 )
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
end


try
data = mReport.PrintToBuffer(EVReportPrintType.kToHTML, 1 )
catch err as VException
dim errNumber as Integer = err.ErrorNumber
dim errString as String = err.Message
end

HTMLViewer1.LoadPage(data)

End Sub
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Unhandled exception, usually means that some try-catch block is missing.
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
I have this error when i run the app


Unhandled VException
Message:

Stack:

WebPagos.WebPagos.PrintRec%%o<WebPagos.WebPagos>s
WebPagos.WebPagos.SavePagos%%o<WebPagos.WebPagos>
WebPagos.WebPagos.Toolbar1_ButtonAction%%o<WebPagos.WebPagos>o<WebToolbar>o<WebToolbarButton>
Delegate.IM_Invoke%%o<WebToolbar>o<WebToolbarButton>
AddHandler.Stub.28%%o<WebToolbarButton>
WebToolbar._ExecuteEvent%b%o<WebToolbar>sA1v
WebControl.!_ExecuteEvent%b%ssA1v
WebSession._HandleEvent%%o<WebSession>so<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i4%o<WebSession>so<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%o<WebApplication>o<_HTTPServer.HTTPRequestContext>
_CGIGateway.GatewayRequestThread.Event_Run%%o<_CGIGateway.GatewayRequestThread>
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Here you get VReport instance:



try
mReport = Session.mProject.MakeNewReport("Pagos", sqliteDb, SqlStr01 )
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
end



But have you examined this exception, was it thrown?
Комментарий
There are no comments made yet.
Jochen Peters Ответ принят
Dim data As String
Dim mReport AS New VReport
Dim SqlStr01 As String
Dim sqliteDb As String
Dim vCounts As Integer

SqlStr01=""
'#If TargetMacOS Then
'#if DebugBuild then
'sqliteDb="sqlite://Users/alexiscolon/Documents/http://HomeDev.org/ADG/adgdb.db";
'#ELSE
'DbMain.DatabaseFile = GetFolderItem("C:\ADG\adgdb.db";)
'#endif
'#endif

#If TargetLinux Then
#if DebugBuild then
sqliteDb="sqlite://usr/local/apache2/htdocs/adg/adgdb.db"
Session.projectPath = GetFolderItem( "adgreports.vsp" )
#Else
sqliteDb="sqlite://usr/local/apache2/htdocs/adg/adgdb.db"
#endif
#endif

//sqliteDb="sqlite://Users/alexiscolon/Documents/http://HomeDev.org/ADG\/adgdb.db"

SqlStr01="Select * From PayInfo INNER JOIN SocioInfo on PayInfo.SocioNum = SocioInfo.SocioNum Where Cnt='" + TransId + "'"



Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()

if Session.mProject <> nil then
vCounts = Session.mProject.ReportCount()
end if
MsgBox "Load Rep OK"

try
mReport = Session.mProject.MakeNewReport("Pagos", sqliteDb, SqlStr01 )
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
end


try
data = mReport.PrintToBuffer(EVReportPrintType.kToHTML, 1 ) <<< it crash nil
Exception err as VException
dim errNumber as Integer = err.ErrorNumber
dim errString as String = err.Message
end

HTMLViewer1.LoadPage(data)
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Also make sure you have see part "Deployment on Linux" for Xojo ADK in WIKI.
It explains how to deploy compiled APP to Linux computers of your users.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello, Alexis

As I've said before this library is installed into /usr/local/lib/vcomponents folder during the installation of V4RB deb package on Linux.

But be sure to install V4RB of the same version (5.8.5, for example) both to your Mac, where you compile an app, and to Linux, where you run it. Application can't work if a version mismatch occur.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


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