Filtered list Link from report

Belias
Member Posts: 2,998
hi, i think this is not possible, but someone of you maybe found a workaround...
basically, i have to run something similar to a drilldown from a report of mine: i know how to run hyperlinks from a report, and i'm abusing it since i started to design reports for the 3 tier...the problem is that now, for the first time, i should run a page (the sales lines page), filtered for some fields.
as i said, i know to use recref with getposition in order to get the bookmark of the interested record, but here i have to show 3-4 records based on some filters...have you got an idea?
P.S.: i can use a singleinstance codeunit as a last resource: you know, set some parameters in the codeunit during the onprereport, check those parameters when running the page and filter the page consequently.
but here the problem is: when clear the parameters in order to make the user able to run the page normally?i guess i have to create a new page just for it...which is bad...
I hope i explained clearly, thanks in advance
basically, i have to run something similar to a drilldown from a report of mine: i know how to run hyperlinks from a report, and i'm abusing it since i started to design reports for the 3 tier...the problem is that now, for the first time, i should run a page (the sales lines page), filtered for some fields.
as i said, i know to use recref with getposition in order to get the bookmark of the interested record, but here i have to show 3-4 records based on some filters...have you got an idea?
P.S.: i can use a singleinstance codeunit as a last resource: you know, set some parameters in the codeunit during the onprereport, check those parameters when running the page and filter the page consequently.
but here the problem is: when clear the parameters in order to make the user able to run the page normally?i guess i have to create a new page just for it...which is bad...
I hope i explained clearly, thanks in advance
0
Comments
-
Have you played around with GETVIEW/SETVIEW ?Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
yes, it was my first try, but it doesn't work: and this does make sense, because the "bookmark" parameter refers to one record only, but the getview/setview doesn't change the "focus", but just sets filter...
anyway, yesterday night i've got an idea...i'll post it here as soon as it works0 -
BAM!Down in the basket!BAM!Down in the basket! (Peter Griffin)
the workaround is easy and not so ugly: just create a report for the only purpose of running a page in the onpredataitem trigger. the report must be processingonly and the "usereqform" property must be false: here's a sample.OBJECT Report 77777 Page runner { OBJECT-PROPERTIES { Date=15/11/10; Time=10.01.37; Modified=Yes; Version List=; } PROPERTIES { UseReqForm=No; ProcessingOnly=Yes; } DATAITEMS { { PROPERTIES { DataItemTable=Table18; OnPreDataItem=BEGIN IF GETFILTERS <> '' THEN BEGIN PAGE.RUN(0,Customer); CurrReport.QUIT; END ELSE CurrReport.BREAK; END; OnAfterGetRecord=BEGIN IF GETFILTERS = '' THEN CurrReport.BREAK; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=846; } CONTROLS { } } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } REQUESTPAGE { PROPERTIES { } CONTROLS { } } CODE { BEGIN END. } RDLDATA { } }
from your RTC, you can then run this link, and append your favourite filters, for example (in my procedure i'll always add the %22 escape, just to be sure...dynamicsnav:////runreport?report=77777&filter=Customer.%22Name%22:A*
the good thing is that you can use the same report to manage multiple page launching...just add your favourite dataitems and manage their execution with getfilters, for example...take a look to the sample for more info
Cool huh? 8)0 -
I'm now thinking about a method to make the link creation less "bloody", and i thought about a function that gets 2 parameters: table name and filterstring.
Ideally, i call this function like thismyfunction(mytable.TABLENAME,mytable.GETFILTERS)
but now i have to find a way to transform the filterstring from (for example)No.: A, Name: Anb*&filter=Customer.%22No.%22:A&filter=Customer.%22Name%22:Anb*
here's the function...
FNTAppendFilter(pTXTTableName : Text[50];pTXTFilterValue : Text[1024])TXTFilters := '&filter=%22' + pTXTTableName + '%22.' + '%22'; FOR i := 1 TO STRLEN(pTXTFilterValue) DO BEGIN CASE pTXTFilterValue[i] OF ',': BEGIN TXTFilters += DELCHR(lTXTValue,'<>',' ') + '&filter=%22' + pTXTTableName + '%22.' + '%22'; lTXTValue := ''; END; ':': BEGIN TXTFilters += DELCHR(lTXTValue,'<>',' ') + '%22' + FORMAT(pTXTFilterValue[i]); lTXTValue := ''; END; ELSE BEGIN lTXTValue += FORMAT(pTXTFilterValue[i]); END; END; END; TXTFilters += DELCHR(lTXTValue,'<>',' '); //this is the last part, between the last ":" and the end of the string
ATTENTION!!THIS CODE WORKS ONLY IF THE CAPTION OF THE FIELD IS THE SAME AS THE NAME OF THE FIELD. TO PARTIALLY SOLVE THE ISSUE, GO TO
http://www.mibuso.com/forum/viewtopic.php?f=23&t=44707
(sorry for the cross posting)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions