1. Roddney Colman
  2. Report Editor
  3. Freitag, November 22 2019, 06:55 PM
  4.  Abonnieren via E-Mail
i use valentina with sql server is work fine but i need filter some report data how can i send my query in run time
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Roddney,

1) You can add a condition to MakeNewReport call

For example, normally the report shows all invoices


my_project.MakeNewReport(
"report_1",
"mssql://...",
"SELECT * FROM invoices" )


But it also can show a subset or even a single invoice with a specified ID


my_project.MakeNewReport(
"report_1",
"mssql://...",
"SELECT * FROM invoices WHERE invoice = 1" )


2) In the latest versions (like 9.3+) you can use parameters for this task if you define the query in report like:

SELECT * FROM invoices $!P( pFilter )


$!P( pFilter ) will be replaced with condition (or an empty string if not specified)

And then you don't need to specify your base query again, just pass an empty string for it:


my_report=my_project.MakeNewReport(
"report_1",
"mssql://...",
"" )


Add condition when necessary

my_report.SetParameterValue( "pFilter", "WHERE invoice = 1" )
Kommentar
There are no comments made yet.
  • Seite :
  • 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