Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 8 Monaten, 3 Wochen
Letzter Beitrag:
vor 8 Monaten, 3 Wochen
Beteiligte Autoren:
Gary Williams, Fabrice Harari, Al

Report from Data Source variable

Startbeitrag von Gary Williams am 26.11.2016 14:41

Apologies, this is probably a simple question, but I have searched the help and tried different things and can't work it out.

I am building a Data Source from a query that is built from user prompts in a window.

dsReport is Data Source
sqlCommand is string // Build sqlCommand from user input
HExecuteSQLQuery(dsReport,sqlCommand)
iPintReport(reportName) // now I want to design the report to run here


I want to design a report based upon that data source, but since it does not exist when I am in the report designer how can I link the items to individual fields in the data source?

Gary

Antworten:

Hi Gary

if you want to link stuff, it has to exist. So my advice is to use the query editor instead, it's very easy.
Instead of buiding on query based on the user input, create a query in the editor with ALL the conditions, and just set the parameters to NULL for those you don't use in any given situation.

Then you get all the power of the query editor (translation for any DB, auto completion, compilation error when using a wrong name, changes when modifying the analysis, etc)

AND you can link your report to your query...

It is much more powerful and easy that way.

Best regards

von Fabrice Harari - am 26.11.2016 15:01
Hi Gary

if you want to link stuff, it has to exist. So my advice is to use the query editor instead, it's very easy.
Instead of buiding a query based on the user input, create a query in the editor with ALL the conditions, and just set the parameters to NULL for those you don't use in any given situation.

Then you get all the power of the query editor (translation for any DB, auto completion, compilation error when using a wrong name, changes when modifying the analysis, etc)

AND you can link your report to your query...

It is much more powerful and easy that way.

Best regards

von Fabrice Harari - am 26.11.2016 15:11
Hi Fabrice,

Problem is that the data is held in a legacy application and data is FoxPro 9 format.

We are trying to avoid writing any more code in FoxPro so trying to develop a reporting engine in WinDev.

I have played with views and tried to connect to the FoxPro data, but have had no success other than with HExecuteSQLQuery().

Is there a way to do a "remote view" as in some other languages? Could not see one when researching.

Gary.

von Gary Williams - am 26.11.2016 18:03
Hello Gary

You don't mention the version you are running but persistent views exist as materialized views in V20 - not sure when they were introduced.

In terms of connecting to the data, you can drag the foxpro dbf files into the analysis and they are then accessible to all the Windev file functions so you can create a query as Fabrice suggested and than assign the parameter values when reporting

Regards
Al

von Al - am 26.11.2016 22:58
"You don't mention the version you are running but persistent views exist as materialized views in V20 - not sure when they were introduced.

In terms of connecting to the data, you can drag the foxpro dbf files into the analysis and they are then accessible to all the Windev file functions so you can create a query as Fabrice suggested and than assign the parameter values when reporting"

Thanks Al,

I am in Version 21, so will try materialised views and also try the drag option!

Many thanks to you and Fabrice.

Gary.

von Gary Williams - am 27.11.2016 15:26
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.