logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
cyracks  
#1 Posted : Sunday, July 5, 2020 3:31:01 PM(UTC)
cyracks

Rank: Member

Groups: Registered
Joined: 6/5/2020(UTC)
Posts: 12
Slovenia

Thanks: 4 times
Hello,

as shown on the picture bellow I would like to use CommonRestriction in Pre SQL statement, but whatever I do CommonValue is always set to NULL.

CommonValue

https://pasteboard.co/Jgg9ASp.png

1) I set Pre SQL statement. Restriction name as well as column name in database is c_name
2) When report is executed I set restriction to d
3) SQL profiler shows that CommonRestriction is not replaced with d but with NULL. Why ?

Is this a bug or am I doing something wrong ?

Regards,
Toma┼ż
epf  
#2 Posted : Monday, July 6, 2020 8:24:18 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 922
Switzerland

Thanks: 14 times
Was thanked: 154 time(s) in 148 post(s)
I made a quick test and it seems to work for me (checked with the debugger), can you check the report in attachment
common value.srex (4kb) downloaded 3 time(s).

Edited by user Monday, July 6, 2020 8:27:32 AM(UTC)  | Reason: Not specified

cyracks  
#3 Posted : Monday, July 6, 2020 10:41:47 AM(UTC)
cyracks

Rank: Member

Groups: Registered
Joined: 6/5/2020(UTC)
Posts: 12
Slovenia

Thanks: 4 times
That is true, but instead of Common Restrictions and Values in Model Definition I would like to use Drop Row Element restriction (right click on column and Prompt at run time), so that restriction can be used in Sub-Reports. Is that also possible ?

My scenario is that reports shows document detail and is opened from some other report. Caption of a document name is not as it is written in a database so I have to make small modification before SQL query is executed.

In Pre SQL statement:
Quote:

insert into #tInterface(c_name, c_value)
select 'c_doc_id', dbo.fGetID({CommonValue_c_doc_name})


This way Name can be changed to ID, which is later used in join

In FROM Clause I would add:
Quote:

FROM (Table1 INNER JOIN Table2
ON Table1.c_doc_id = Table2.c_doc_id
and Table2.c_doc_id in (select c_value from #tInterface where c_name = 'c_doc_id')
)...


If Name is used it takes 15 seconds for query to complete, if ID is used then 0 seconds.

Edited by user Monday, July 6, 2020 10:43:11 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.