1. Roddney Colman
  2. Valentina Reports ADK
  3. Freitag, August 23 2019, 02:13 PM
  4.  Abonnieren via E-Mail
i used xojo and tray to call a report following the video sample and to conect to sql server
but the aplication crash in connection this is my code, in the line 3 give a error, please some body have idea how to fix tks a lot

try
dim conn as VConnection = new VConnection("199.99.99.99", "user", "password";)
conn.Open

dim ProjPath as FolderItem = GetFolderItem("rptingmercancias.vsp";)
dim Proj as VProject = new VProject(conn, ProjPath)

Dim DataSource as String = "Vserver://host='199.99.99.99' dbname= 'database' user='user' password= 'password' "
Dim Query as String = "qryingresomercancia"
Dim report as VReport = Proj.MakeNewReport("Ingreso_Mercaderia", DataSource,Query)
Dim data as String = report.PrintToBuffer(EVReportPrintType.kToPDF,1)

mPDF= new WebFile
mPDF.MIMEType = "application/pdf"
mPDF.Filename= "repingremer.pd"
mPDF.ForceDownload = False
mPDF.Data= data

Proj.Close
conn.Close

ShowURL(mPDF.URL)

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

end
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Roddney,

1) Is your project located on the Valentina Server or just a file near your application?
2) Is your database located on the Microsoft SQL Server?
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
sergey tks
1) my proyect is a file locate ad my xojo application folder
2) my database is sql server locate ad other computer
3) in my xojo webapp in the open event i use Valentina.InitClient
4) in my xojo webapp in the close event i use Valentina.ShutDownClient
5) i conect Valentina Studio to the same server without no problems
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Then you don't need to open VConnection, call InitClient and ShutdownClient, they are used only for Valentina Server.

Instead, you should use Valentina.InitReports in the Open event and Valentina.ShutdownReports in the Close event.

MakeNewReport expects for the query text, not name, or just pass an empty string to use the query you specified for this report in the project.

The datasource string can be generated from within the Valentina Studio on the project tab (see screenshot).


try

dim ProjPath as FolderItem = GetFolderItem("rptingmercancias.vsp")
dim Proj as VProject = new VProject( ProjPath )
Proj.Open()

Dim DataSource as String = "mssql://host='199.99.99.99' port = 1433 user='user' password= 'password' dbname= 'database'"

Dim report as VReport = Proj.MakeNewReport("Ingreso_Mercaderia", DataSource )
Dim data as String = report.PrintToBuffer(EVReportPrintType.kToPDF,1)

mPDF= new WebFile
mPDF.MIMEType = "application/pdf"
mPDF.Filename= "repingremer.pdf"
mPDF.ForceDownload = False
mPDF.Data= data

Proj.Close

ShowURL(mPDF.URL)

catch err as VException
dim errNumber as Integer = err.ErrorNumber
Dim errString as String = err.Message

end try
Anhänge
Referenzen
  1. http://valentina-db.com/docs/dokuwiki/v9/doku.php?id=valentina:products:adk:api:vproject_class:report_factory_any&s[]=mssql
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
Tks very Much i will try now
Kommentar
There are no comments made yet.
Lynn Fredricks Akzeptierte Antwort
Tks very Much i will try now


Did it work for you, Roddney?
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
Yes but when you run xojo you need put the report in the debug folder, and other problem was that we need a licence to make and save report to test
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Copying can be automated using the appropriate build step - see screenshots.
Anhänge
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
tks very much Sergey my problem now is how identify wich licence id is for ADK report is the same or have some way to identify
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
Did it work for you, Roddney?

i will put for you a xojo proyect with test if you need
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Sorry, not clear.

Serials are passed to the Valentina.InitReports method, for macOS, Windows and Linux respectively:
Valentina.InitReports( "VR4RB-M-...", "VR4RB-W-..." , "VR4RB-W-..." )

Serials for V4RB reports always have this prefix - VR4RB.
Kommentar
There are no comments made yet.
Roddney Colman Akzeptierte Antwort
now is work perfectly tks
Kommentar
There are no comments made yet.
  • Seite :
  • 1


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