1. Jochen Peters
  2. Valentina Reports ADK
  3. Sunday, July 02 2017, 09:29 PM
  4.  Subscribe via email
try
try

data = mReport.PrintToBuffer(EVReportPrintType.kToHTML, 1 )

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

Datasource error: "[FreeTDS][MSSQL Server] , Server JETPR-PC, Line 1
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.".
Comment
There are no comments made yet.
Jochen Peters Accepted Answer
Dim data As String
Dim mReport AS New VReport
Dim RepStrConn As String
Dim P1 As String

If Checkbox1.Value=True Then
P1="1"
Else
P1="0"
End If


TxtNumCliente.Text=ReplaceAll(TxtNumCliente.Text,"'","";)
TxtDateFrom.Text=ReplaceAll(TxtDateFrom.Text,"'","";)
TxtDateTo.Text=ReplaceAll(TxtDateTo.Text,"'","";)

HTMLViewer1.LoadPage("<html></html>";)

#if DebugBuild Then
RepStrConn="mssql://host='localhost' port='1433' dbname='ADG' user='adgadmin' password='123'"
#Else
//RepStrConn="mssql://host='localhost\\SQLEXPRESS' port='1433' dbname='ADG' user='adgadmin' password='123'"
RepStrConn="mssql://host='localhost\\SQLEXPRESS' port='1433' dbname='ADG' user='adgadmin' password='123'"
#endif

Session.projectPath = GetFolderItem( "adgreports.vsp" )

Session.mProject = new VProject(Session.projectPath)

Session.mProject.Open()

if Session.mProject <> nil then
Session.MSDB.vCounts = Session.mProject.ReportCount()
end if

Button1.Enabled=False
Button2.Enabled=False
try
mReport = Session.mProject.MakeNewReport(RepCall, RepStrConn)
//mReport.SetParameterValue("Param1",TxtDateFrom.text.Trim)
//mReport.SetParameterValue("Param2",TxtDateTo.Text.Trim)
//mReport.SetParameterValue("Param3",TxtNumCliente.Text.Trim)
//mReport.SetParameterValue("Param4",PopPueblos.Text.Trim)
mReport.SetParameterValue("Param5",P1)
//mReport.SetParameterValue("Param6",PopMarcas.Text.Trim)

catch e as VException
dim errNumber as Integer = e.ErrorNumber
dim errString as String = e.Message
MsgBox errString
end

Button1.Enabled=True
Button2.Enabled=True

If sPDF=False Then

try

data = mReport.PrintToBuffer(EVReportPrintType.kToHTML, 1 )

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

HTMLViewer1.LoadPage(data)
Else

try

data = mReport.PrintToBuffer(EVReportPrintType.kToPDF, 1)

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

Session.mPDF = New WebFile
Session.mPDF.MimeType = "application/pdf"
Session.mPDF.ForceDownload = True
Session.mPDF.FileName = "report.pdf"
Session.mPDF.Data = data

ShowURL( Session.mPDF.URL )

End If

Session.mProject.Close
mReport=nil
Session.projectPath=nil
Session.mProject=nil
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 1
Sergey Pashkov Accepted Answer
Do you have ORDER BY in the query?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 2
Jochen Peters Accepted Answer
yes
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 MS SQL specific.
You should do sorting in the report (Data tab, Sorting), because we use query nesting to execute expressions.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 4
Jochen Peters Accepted Answer
ok
thanks for big help
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Reports ADK
  3. # 5
  • 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