1. Roddney Colman
  2. Valentina Reports ADK
  3. 金, 8月 23 2019, 02:13 PM
  4.  メールで購読
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.

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