1. Jochen Peters
  2. Valentina Reports ADK
  3. Wednesday, June 08 2016, 02:48 AM
  4.  Subscribe via email
Hi
If any way to get Record Count after pass the query to the report engine

i have some problems i get blank pages and i need to now if record on the report

thanks
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
No, it's impossible in code.

Does the same query work in Valentina Studio?

--
The very common problem is that Xojo produces strings without encoding sometimes,
which can't be understood by V4RB plugin.


// We compose a query:
Dim query As String = "SELECT * FROM person WHERE id = " + lst.Text

// And it is Nil-encoded:
If query.Encoding = Nil
MsgBox( "Encoding was Nil" )

// Fix encoding
query = DefineEncoding( query, Encodings.UTF8 )
End If
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 1
Sergey Pashkov Accepted Answer
1) What is the version of V4RB plugin installed?
2) In a few latest versions SQL in this case will be executed at the PrintToDisk stage, so need to surround it with Try-Catch block

try
mReport.PrintToDisk( f, EVReportPrintType.kToPDF)
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
MsgBox "Report Printing Error " + errString
end
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 2
Jochen Peters Accepted Answer
no is DeskTop Xojo App

this error show some time so i close the app and the it works
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 3
Sergey Pashkov Accepted Answer
It is a web application, right? Running as standalone or as CGI with Apache? On which OS?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 4
Jochen Peters Accepted Answer
nop
only the application
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 5
Sergey Pashkov Accepted Answer
And is the project not opened in Valentina Studio at the same time?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 6
Jochen Peters Accepted Answer
yes
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 7
Sergey Pashkov Accepted Answer
It is a local project without VServer, right?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 8
Jochen Peters Accepted Answer
look this error
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 9
Jochen Peters Accepted Answer
i have the las update V4RB
ok
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 10
Jochen Peters Accepted Answer
Dim RepStrConn As String
Dim mReport AS New VReport
Dim SqlStr01 As String
Dim vCounts As Integer

SqlStr01=""

RepStrConn="postgresql://host='" + vServerIP + "' port='5432' dbname='" + vServerDbName + "' user='gapos' password='home@2011'"

SqlStr01="Select *,userinfo.name as Username,vendorinfo.name as SupName ,companyinfo.name as StationName From companyinfo, recivedhd INNER join reciveddt On recivedhd.cntid=reciveddt.cntid INNER join vendorinfo on recivedhd.suplidorid=vendorinfo.id INNER Join userinfo ON recivedhd.userid=userinfo.userid Where recivedhd.cntid=" + OrderId + " Order By linenum "

mprojectPath = GetFolderItem( "OrdenCompras.vsp" )

mProject = new VProject(mprojectPath)

try
mProject.Open()
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
MsgBox "Open Reports" + errString
end

if mProject <> nil then
vCounts = mProject.ReportCount()
Else
MsgBox "*** mProject is nil ***"
end if

try
mReport = mProject.MakeNewReport("Ordenes01", RepStrConn, SqlStr01 )
catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
MsgBox "Report Load Query" + errString
end


if mReport <> nil then
Dim fName As String
fName="InvOrder"+Trim(CompCity)+"_"+Orderid+".pdf"
dim f as folderItem=GetFolderItem( "C:\GasRb\"+fName)

//Dim dd As Variant
//dd=f.AbsolutePath
// Create temporary file
'dim f as folderItem
'f =getSaveFolderItem( "*.pdf", "report.pdf" ) <=== Esto te permite guardar el pdf donde quieras
///

mReport.PrintToDisk( f, EVReportPrintType.kToPDF)
For v as Integer=0 to 1000

Next

SendInfoEmails(vSalePersonName,"**PDF Reports**",CompName,f.AbsolutePath)

Else
MsgBox "*** Record no Found ***"
end if
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 11
Sergey Pashkov Accepted Answer
Can you please show a code where you compose a query, pass it to MakeNewReport and print to target format?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 12
Jochen Peters Accepted Answer
Blank
No data only lines and reports labels
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 13
Sergey Pashkov Accepted Answer
So report is completely blank? Or contains something?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 14
Jochen Peters Accepted Answer
No get Nil msg
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 15
Sergey Pashkov Accepted Answer
Ok, then what about encoding?

Is it OK and you don't get a message that it is NIL?

// We compose a query:
Dim query As String = "SELECT * FROM person WHERE id = " + lst.Text

// And it is Nil-encoded:
If query.Encoding = Nil Then
MsgBox( "Encoding was Nil" )

// Fix encoding
query = DefineEncoding( query, Encodings.UTF8 )
End If
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 16
Jochen Peters Accepted Answer
yes is on XOJO

yes same query work in Valentina Studio
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 17
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories