KB-30516: Multiple queries per report.

Question:

Can I have more than one query per report?

Solution:

No; reports in E3 can only have one query. If you need to use different SQL commands, just pass them to the report’s query via scripts:

Example 1 – “Button 1” (print values from tag demo1):

Set Report = Application.LoadReport(“[Report1]”)
Set Query = Report.Item(“Query1”)

Query.SQL = “SELECT Historic.E3TimeStamp,Historic.TagDemo1 FROM Historic ORDER BY Historic.E3TimeStamp ASC”
Query.Table = “Historic”
Query.OrderBy = “Historic.E3TimeStamp ASC”
Query.Fields = “Historic.E3TimeStamp,Historic.TagDemo1”
Query.DataSource = “Database1”

Query.Execute()
Report.Export “PDF”,”testeelipse1.pdf”

Example 2 – “Button 2” (print values from tag demo2):

Set Report = Application.LoadReport(“[Report1]”)
Set Query = Report.Item(“Query1”)

Query.SQL = “SELECT Historic.E3TimeStamp,Historic.TagDemo2 FROM Historic ORDER BY Historic.E3TimeStamp ASC”
Query.Table = “Historic”
Query.OrderBy = “Historic.E3TimeStamp ASC”
Query.Fields = “Historic.E3TimeStamp,Historic.TagDemo2”
Query.DataSource = “Database1”

Query.Execute()
Report.Export “PDF”,”testeelipse2.pdf”

NOTE: Attached is a sample application developed with E3 version 3.1 Build 270.

Attachments:

KB30516en.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *