1. Roddney Colman
  2. Valentina Reports ADK
  3. Пятница, Август 23 2019, 02:13 PM
  4.  Подписаться через 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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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?
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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
Вложения
Ссылки
  1. http://valentina-db.com/docs/dokuwiki/v9/doku.php?id=valentina:products:adk:api:vproject_class:report_factory_any&s[]=mssql
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
Tks very Much i will try now
Комментарий
There are no comments made yet.
Lynn Fredricks Ответ принят
Tks very Much i will try now


Did it work for you, Roddney?
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
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
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Copying can be automated using the appropriate build step - see screenshots.
Вложения
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
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
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
Did it work for you, Roddney?

i will put for you a xojo proyect with test if you need
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Roddney Colman Ответ принят
now is work perfectly tks
Комментарий
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.