Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 9 Jahren, 1 Monat
Letzter Beitrag:
vor 9 Jahren, 1 Monat
Beteiligte Autoren:
Paulo Oliveira, Milton, Nirav

Writing code in reports

Startbeitrag von Nirav am 10.01.2009 07:21

Hi Guys,

I am writing code in report as I dont want to use UI.

I have written some code in Opening of reportname

HExecuteSQLQuery(Look,"SELECT id ,name FROM master WHERE code =9 ORDER by id")

I want to assign this id,name to the columns in the report.

Lets say I have 2 columns, like id and name. I want to assign the values that come from the above query to the report and print it.

Thanks for the time.

Antworten:

Hi Nirav,

I would execute my query with code such as -

iInitReportQuery(MyReport,gJobCode,MyParameter1,MyParameter2 etc)
iPreview(i100,MyReport)
iPrintReport(MyReport)

Then, in the body of the report I would assign the results of the Query, whether it is an SQL or another query doesn't matter, and then I would make these result fields hidden if I wanted to do further calculations.

Then I would create "Calculated" fields in the report to display whatever information I required.

To populate these calculated fields it is sometimes better to put the calculation code in the main report area under the "Data Read" area which will run when the report is first opened. For example -

IF MyQueryFIELD1=0 OR MyQueryFIELD1="" THEN
CALCULATION1=MyQueryFIELD1
END



HTH

Milton


von Milton - am 10.01.2009 09:43
Just look in the help for "Report, Program a report entirely"

von Paulo Oliveira - am 12.01.2009 12:07
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.