Parameter-settings? or...
Chi Fai Cheung
Hi all,I would like to know how to print the value of some parameter that the user input in a form for choosing data. I have to say that the data are not SBO-data (Trimergo-addon).
1. What i did is make an query with layout type 'User Query'
"SELECT T0.project_number, T0.description, T1.description as Artikel FROM trimergo.planning T0 INNER JOIN trimergo.project_articles T1 ON T0.planning_key = T1.planning_key"
2. Define the Form type: 'TRI_F_PROJCT'
3. Define Parameter with Item type: TriProjectnr, E_ProjNum
4. When i run this i got all the data
When i make this query:
SELECT project_number FROM trimergo.planning WHERE project_number = '[%PR]'
I got the following error:
1). [Microsoft][ODBC SQL Server Driver][SQL Server]Must specify table to select from. 2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement 'Received Alerts' (OAIB) (s) could not be prepared.
Hope someone give me some help for this issue.
Thanks in advance,
Chi Fai
Philipp Knecht
Hi Chi FaiWhen you use:
SELECT project_number FROM trimergo.planning WHERE project_number = '[%PR]'
Then your parameter should also be called PR (Column Key (In Queries))
I would suggest you to use another parametrename. Why not ProjNr or so. So your query has to look then like:
SELECT project_number FROM trimergo.planning WHERE project_number = '[%ProjNr]'
The error you get is B1 specific. The query should work when started later with the layout. But to also make it work in B1 just add Tablealiases to the Query meaning:
SELECT T0.project_number FROM trimergo.planning T0 WHERE T0.project_number = '[%ProjNr]'
Also make sure that you assign your freshly entered formtype to this parameter in the Parameterform.
And as always. Best way to check if an parameter is readen out correctly is to just put in on the layout, make an printdefinition for the formtype and test it directly from the Form.
hth
Chi Fai Cheung
Thanks Philipp,I have changed the parameter name and now it's shows the choosen projectnumber. The other problem is, is that not show all the articles, just show 1 article.
The query below i have linked it to the Layout Designer:
SELECT T0.project_number, T0.description as Projectomschr, T1.object_key as Klantnr, T3.CardName, T2.description FROM trimergo.planning T0 INNER JOIN trimergo.planning_relations T1 ON T0.planning_key = T1.planning_key INNER JOIN trimergo.project_articles T2 ON T0.planning_key = T2.planning_key INNER JOIN OCRD T3 ON T1.object_key = T3.CardCode where T0.project_number = '[%TriProjectnr]'
Then in the Layout Designer the field of the article i selected the following:
GetData "B1_Data.SWA_LD_Trimergo_Planning_DemoTEST2.description")
Other words how to show all the articles for the choosen project?
Philipp Knecht
Hi Chi FaiYou use an DataBand (advancedDataBand) don't you?
If yes then set the datasource of this databand to the corresponding datasource.
And then use the Data from the band not from GetData("...").
-> It has to look like : dataBand1("Field1")
hth
Chi Fai Cheung
[quote]"Philipp"]Hi Chi Fai
You use an DataBand (advancedDataBand) don't you?
If yes then set the datasource of this databand to the corresponding datasource.
And then use the Data from the band not from GetData("...").
-> It has to look like : dataBand1("Field1")
hth
[/quote]
Hi Philipp,
In my layout i can't see in the databand the values what i want. The value what i have now comes from the 'Data Sources --> B1_Data1--> my query'
Attachment
[url=http://www.coresystems.ch/wp-content/../wp-content/forum-image-uploads/vicichief/scr2.JPG]scr2.JPG[/url]
Philipp Knecht
Hi Chi FaiThe DataSource Property needs to be set to an Table not to an single Field (Didn't know that this is even possible...)
In your example to this ...Trimergo_TEST - DataSource.
(Just doubleclick on it in the drop down list in the datasource property)
You can check the correct assigning of a dataource by selecting it from DataSources/Bands. When it haves a + Sign besides it its correct.
fyi:
You don't have to name your queries SWA_LD...
hth
Chi Fai Cheung
[quote]"Philipp"]Hi Chi Fai
The DataSource Property needs to be set to an Table not to an single Field (Didn't know that this is even possible...)
In your example to this ...Trimergo_TEST - DataSource.
(Just doubleclick on it in the drop down list in the datasource property)
You can check the correct assigning of a dataource by selecting it from DataSources/Bands. When it haves a + Sign besides it its correct.
fyi:
You don't have to name your queries SWA_LD...
hth
[/quote]
hehehe, puhpuh Finally i got what i want, thanks Philippe.
0
Please sign in to leave a comment.
Comments
0 comments