1. Roddney Colman
  2. Valentina Reports ADK
  3. Friday, August 23 2019, 02:13 PM
  4.  Subscribe via email
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
Comment
There are no comments made yet.
Roddney Colman Accepted Answer
now is work perfectly tks
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 1
Sergey Pashkov Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 2
Roddney Colman Accepted Answer
Did it work for you, Roddney?

i will put for you a xojo proyect with test if you need
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 3
Roddney Colman Accepted Answer
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
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 4
Sergey Pashkov Accepted Answer
Copying can be automated using the appropriate build step - see screenshots.
Attachments (2)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 5
Roddney Colman Accepted Answer
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
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 6
Lynn Fredricks Accepted Answer
Tks very Much i will try now


Did it work for you, Roddney?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 7
Roddney Colman Accepted Answer
Tks very Much i will try now
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 8
Sergey Pashkov Accepted Answer
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
Attachments (1)
References
  1. http://valentina-db.com/docs/dokuwiki/v9/doku.php?id=valentina:products:adk:api:vproject_class:report_factory_any&s[]=mssql
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 9
Roddney Colman Accepted Answer
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
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 10
Sergey Pashkov Accepted Answer
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?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 11
  • 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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories