Parameterized Views for User Reports

I would like to be able to define a view such as:
create view dept_emps(p_dept in varchar2) as
select * from emps where dept = p_dept);
and use this view to define a SQL Dev drilldown report with SQL such as:
select * from dept_emps(:DEPT)
where :DEPT is a bind variable passed from a selected depts report row.
Oracle apparently does not support parameterized view definitions as suggested above, but I have found an article by Tom Kyte on the issue of parameterizing views, where Tom suggests using DBMS_SESSION.SET_CONTEXT (called within a user package) to set context values that can be retrieved in a view using the SYS_CONTEXT function. I can get this approach to work at the SQL prompt to work around the lack of formal view parameters. I have a package which defines a procedure which sets context values that I can then retrieve within a view using the SYS_CONTEXT function.
To use this approach when defining a SQL Developer user report, the SQL for the report would need to be logically something like (which works fine at an SQL prompt):
exec ssuper_context.set_ctx('DEPT', :DEPT) - - Call user procedure to assign context variable 'DEPT' with bind value from parent report
select * from dept_emps
where view dept_emps uses function SYS_CONTEXT to return the value for context variable 'DEPT'.
SQL Developer complains about this as the SQL for a user-defined report. Can anyone suggest how I might pass a bind value from a selected parent record to a view which implements a drilldown report?
TIA Jon

I met CSI at a kongress a few weeks ago and pressed them a bit on how this works. Eventually they fezzed up about the table read but mentioned that in the next release being developed it would be different...
Problems with this is that the FM has a couple of limitations, so you cannot read all tables correctly... so you end up reading some of the wrong ones or taking the easy ones.
Another option is to let the database itself do the hard work, to get back to the performance aspect.
Anyway, for neither of these two do you need any tcode, so indeed we are drifting off topic...

Similar Messages

  • Reuse Crystal report Viewer For different reports - unload cache

    So I am migrating from crystal reports basic to crystal reports 2008. I have hit a stumbling block. Rather than have a new page and report viewer for each report I decided it would be easier to have one report viewer and send to it in session variables the report I wish to run and appropriate parameters. This seemed to work fine in CR basic.
    Now I have upgraded the viewer works fine for the first report I run however it then caches this report and doesn't seem to clear it down, if the new report has different parameters I will get a parameter error. If I run a report requiring the same parameters I will get the original report not an updated one.
    I believe I need to leave the CrystalReportSource cache on in order to page the report (correct me if I am wrong)
    I have taken a few snippets of code, is this possibly running too late in page life cycle have I missed something or is there a way to force a cache clear:
    protected override void OnLoad(EventArgs e) {
    //setup report in viewer with correct db logon
                    CrystalRepSource.Report.FileName = report;
                    SetupLogonInfo(CrystalRepSource);
                    //add parameters
                    AddParam(paramFields, pfItem1, dcItem1, "@year", year);
                    AddParam(paramFields, pfItem2, dcItem2, "@school", school);
                    AddParam(paramFields, pfItem3, dcItem3, "@division", division);
                    AddParam(paramFields, pfItem4, dcItem4, "@progArea", progArea);
                    AddParam(paramFields, pfItem5, dcItem5, "@type", SessionHandler.record_type);
                    AddParam(paramFields, pfItem6, dcItem6, "@filterText", "School = \'" + school +
                                                            "\' Division = \'" + division
                                                            + "\' Programme Area = \'" + progArea
                                                            + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
    CrystalViewer.ParameterFieldInfo = paramFields;
    private void SetupLogonInfo(CrystalReportSource CrystalRepSource)
            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            logOnInfo = CrystalRepSource.ReportDocument.Database.Tables[0].LogOnInfo;
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo = logOnInfo.ConnectionInfo;
            connectionInfo.DatabaseName = Application["db"].ToString();
            connectionInfo.ServerName = Application["server"].ToString();
            connectionInfo.Password = Application["pass"].ToString();
            connectionInfo.UserID = Application["user"].ToString();
            CrystalRepSource.ReportDocument.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
        private void AddParam(ParameterFields paramFields, ParameterField pfItem, ParameterDiscreteValue dcItem, string fieldName, string value)
            pfItem.ParameterFieldName = fieldName;
            dcItem.Value = value;
            pfItem.CurrentValues.Add(dcItem);
            paramFields.Add(pfItem);

    ok so I have tried changing the code to:
    CrystalRepSource.ReportDocument.SetParameterValue("@year", year);
                    CrystalRepSource.ReportDocument.SetParameterValue("@school", school);
                    CrystalRepSource.ReportDocument.SetParameterValue("@division", division);
                    CrystalRepSource.ReportDocument.SetParameterValue("@progArea", progArea);
                    CrystalRepSource.ReportDocument.SetParameterValue("@type", SessionHandler.record_type);
                    CrystalRepSource.ReportDocument.SetParameterValue("@filterText", "School = \'" + school +
                                                            "\' Division = \'" + division
                                                            + "\' Programme Area = \'" + progArea
                                                            + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
    private void Page_Unload(object sender, EventArgs e)
            try
                    CrystalRepSource.Report.DataSources.Clear();
                    CrystalRepSource.Report.Parameters.Clear();
                    //CrystalRepSource.ReportDocument.Close();
                    //CrystalRepSource.ReportDocument.Dispose();
                    CrystalRepSource.Dispose();
                    CrystalViewer.Dispose();
                    GC.Collect();
            catch { }
    I experimented with various bits in the page unload as you can see I have commented a bit out at present as it was throwing an exception. The SetParametersValue while handy (will clean the code up a bit) didn't make any difference I am still getting the same issue.

  • Error while saving view for a report

    Hi All,
             I have transported queries to production and executing them from web, when I am saving the view for a report I get an error
    " The Object cannot not be processed due to a transport problem -  Notification Number RSWWW 240 "
    What could be the problem...please help
    Thanks
    Indraneel

    Check the OSS note 550760 regarding the issue.

  • Customizing ActiveX Viewer for Crystal Reports 2008

    Here's the scenario.
       We have reports designed in Crystal Reports 2008, that are deployed on Business Objects 3.1 Infoview. All reports have Parameters for users to choose. All reports are expected to refresh on open.Some are dynamic some are standard static ones. There is an application developed in JAVA that is rendering these reports using the ActiveX viewer.
    The users are not comfortable with the way reports look in JAVA viewer. Hence the choices are either HTML viewer or ActiveX viewer.
    The application achieves this by making OpenDoc call to the report and using
    sViewer=actx
    as one of the parameters. Here's the issue that we run into. When users land on the parameter screen, the parameter screen alone Pops Up in a new window. Once all the parameter values are entered and the users clicks OK, the window vanishes and actual report is rendered in the original window.
    If we use HTML viewer by setting
    sViewer=html
    The report Parameter screen is rendered in the main window without popping up. However we do not wish to use HTML viewer because, some of the reports are linked to other reports with OpenDoc calls. i. e. Parent report calls child report with a OpenDoc call. In the HTML viewer, when you click on the link to child report, it opens in same window despite setting
    sWindow=new
    in that opendoc call. Thereby losing parent report and no way to navigate back to it. This problem does not happen in ActivX viewer.There it seems to obey the command to open in new window.
    Lastly you can recreate all this behavior by setting your viewer preferences in Info View settings. 
    So, here's my questions.
    1. Should I use the .Net viewer instead of ActiveX Viewer ? If so, where can I find Syntax for the same ?
    2. Can someone point me to documentation on the ActiveX Viewer ? Specifically making it not to Pop Up the Parameter Screen ?
    3. Should the Java application use a different method other than Open Doc to cal the reports ? If so where can I get the details ?
    Apologies for the long post. I tried to anticipate most of the questions that may arise in your mind. Thanks in advance for the time invested.

    Thank you Adam for the help.
    I already have the Open Document document you mentioned. Can't seem to search for the KB article in Marketplace. No results found.
    Just to clarify, I do not want to avoid the Parameter screen. Its the fact that it Pops Up in ActiveX viewer is the issue. The only thing I want in ActiveX viewer is to make that screen appear in main window just like HTML viewer.
    I understand that there is no difference as far as opendoc is concerned between .Net or JAVA. I am looking for the SDK behind the viewers themselves.
    To my third question, your answer is what I was looking for. But need a bit clarification.
    >
    Adam Stone wrote:
    > If you do not like the functionality that OpenDocument provides, you could use the SDK to view the reports, but you will likely run into the same issue as you are running into when using the html viewer.  The only workaround for that is to set a property on the viewer object in the SDK but it will affect all hyperlinks in the report not just a single one.
    By setting Property in SDK for the viewer Object, are you referring to Meta Tag encapsulation such as
    <a href= http://infoview.server.com/Infoview/opendoc/openDocument.jsp?iDocID=ABZR3Z&sIDType=CUID&&sType=wid&sRefresh=Y&sWindow=new>Report Title</a>
    May be I didn't get your point with setting property. I know there is documentation on Viewer SDK. I just can't seem to find it. I hope it would answer the questions.
    Edited by: SAMEER UPADHYE on Oct 6, 2010 5:46 PM

  • :: NWA does not show table view for monitoring reports ::

    Hi,
    We are facing an issue in one of our portal system.
    I click on Portal index page, then I go to Net weaver Administrator --> Monitoring --> Java system reports.
    Here I get the resource utilization graphs.
    The graphs show proper values however when I click on table view it does not show any value or table at all.
    Then I click on Settings button, and click on Persistent radio button.
    It asks to enter the number of days for which the the data should be stored.
    I gave it as 2 days and click on Apply button.
    It shows a message saying "changes would be effective after restarting monitoring service".
    However when I go there i.e. NWA --> Administration --> Applications
    I get below services
    cafruntimemonitoring~ear                 
    com.sap.ip.bi.sdk.monitoring                 
    tclmwebadminmonitoravail~wd            
    tclmwebadminmonitorcomplib~wd            
    tclmwebadminmonitorprovider_ear            
    tclmwebadminmonitorstate~wd            
    tclmwebadminoverviewmonitoring~wd           
    tcmonitoringsysteminfo
    Would you kindly suggest which service from above list should be restarted ?
    Thank you, Regards,
    Girish Garje.

    I think what is being asked is "How do I expose a database view as a schema table in Configuration Manager?"
    This is accomplished by creating a database view within the WCC database schema (and with the WCC schema user as the view owner). The view then will appear as a table in the "table" tab in Configuration Manager.
    One caveat in 11g is that the user created by RCU does not have any privileges to read/create views in its own schema. You may need to grant privileges to views for the WCC schema user before this will work.

  • Utilizing SQ01 SQ02 for user report generation of production data

    I am interested in utilizing sap query transactions SQ01, SQ02, and SQ03 to create and customize end user reports that will be used  by our audit team to analyze SAP data in our production environment. My objective would be to have one person with authorization to run SQ01,02,03 and have that user create all the reports that would be required for the team to use. This way there isn't a bunch of users out there using SQ01 indiscriminately or perhaps not using it at all. I currently have authorization to run SQVI but it is limited. From what I understand there is more flexibility with SQ01 because they allow you to create calculated fields and offer more formatting options. Most of these reports would be related to finance, sales, vendor, customer, etc.
    My question is this. How do I create these custom queries and allow multiple users to access and run them? Are the queries created directly in production? Are they created in DEV and then tested in QA before being transported to Prod? I understand you can map an sap query program to a transaction and then add that to a role but isn't the program name generated by SQ01 different in every instance? I would like this code to be reproducible as I have 5 different SAP instances in which these reports would be used. Same reports, different data.
    I am looking to leverage the power of SAP query to produce meaningful reports for our team without having to use programmers to develop them from scratch. What is the optimal approach to doing this without creating a lot of hassles and without creating additional security risks?
    If I create a query based on SAP tables I have access to does the general user also have to have authorization to those tables in order for the query to run for them? In theory the entire team should have authorization to the same standard SAP tables because we all have the same roles assigned but I may have some additional tables assigned to me because I am the IT auditor. Just confirming.
    I appreciate any and all suggestions. I would like to proceed with the best solution as soon as possible.
    Thank you very much.
    Mark

    Hi Mark,
    It is best to create queries in dev rather than doing it in prd directly.
    Query user group can be used to control the access in production.
    You can have one query administrator with access to sq01,2,3 and sqvi who will assign query user group to respective users in prd so they can run these.
    BR,
    Mangesh

  • How to control actions printing,export in discoverer viewer for user

    Hi
    we use discoverer viewer .I want to control Printing,export,send email options
    for user for a worksheet.Hoe to do this. thru Enterprise Manager apps server control , i tried to change the settings , but i guess thats for all the users and all the workbooks.
    how do i set this for user??
    rgds

    Hi
    Yes, the settings you can apply are global and will affect all users. You cannot restrict these by user. Sorry.
    Best wishes
    Michael

  • Hide the design view for the report

    Dear All,
    I would like to block or hide the design view for the Crystal report.
    Please let me know.
    Thanks,
    Raja

    Hi Raja,
    It is not possible to hide the design tab in Crystal Reports.  However,  in Crystal Reports 2008,  there is the ability to password protect a file.
    Regards,
    Wallie

  • Different Directory views for users

    How can I achieve different directory views on user's phones for different types of users using DCD?
    This is for a Centrex type of service.

    OK. I see this posting which mentions installing the IP Services SDK for such applications.
    http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Unified%20Communications%20and%20Video&topic=IP%20Phone%20Services%20for%20Developers&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40%5E1%40%40.1ddc61e0/0#selected_message
    I find it hard to believe that there is not an easier way.
    Why can't there be a directory-profile setting or a setting in the device profile to group users?

  • Is there a razor view for the report control?

    Is there a razor view for the reportviewer control or at least is there planned by SSRS team.
    We are working on MVC application and try to avoid include webform just for the reportview control

    Hi John,
    Based on my research, we cannot directly add ReportViewer Control in a razor view. While we can create an aspx page or web form from where we can show our report using report viewer control in the MVC application. For more details, please refer to the following
    thread:
    http://stackoverflow.com/questions/6144513/how-can-i-use-a-reportviewer-control-in-an-asp-net-mvc-3-razor-view
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Creating views for users by entering a field

    Hi I want to create a veiw for a new user.
    I want the user to view details for a member after he has entered a Membership No
    create view member_details
    (&memberno, name, address)as
    select memberno, name, address
    from member
    where memberno = &memberno;
    when i use this command it asks me for a memberno, I enter one so when the user logs in and
    select * from reilly.member_details;
    all he gets is the info for the memberno I have entered
    how do I fix this so the user is the one entering the memberno

    If your admin staff need to access details for any member, can't they just query a view of all members and specify a memberno then?
    View (presumably more complex than this in reality) would be
    create view member_details
    (memberno, name, address) as
    select memberno, name, address
    from members;Admin user query would be:
    select * from member_details
    where memberno = &memberno;Is SQL*Plus really the interface you provide your admin users with?

  • How to View User Report

    I had created a query and created the report by clicking create report button. But i am not aware how to view the report. I am unable to find appropriate menu item to view the user report.
    Kindly Help me.
    Farhan

    Hi Wadood,
    To view a already set-up report in the defined query layout, you need to open up query manager, select the report (do not double click - just highlight!) and then click on the print preview button.
    Hope this helps.
    Regards,
    Hamsa

  • How can the info block be assigned with the view and assign view to users.

    Dear Friends,
    Anyone could plz tell me how can the info block be assigned with the view and assign view to users.  Also how can the info block in sale summary be assigned with a view and how to assign this view for user.
    Regards,
    Ashima

    Hi,
    To define view and to make it default
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Define Reporting Views (Tcode:OVCD).
    To assign default user to the view.
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Default View To User (Tcode:OVCC).
    To assign Elements of SAPScript "SD-SALES-SUMMARY" to information Blocks To A View use
    Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Information Blocks To A View (Tcode:OVCB).

  • Cannot view a Crystal Report in InfoView

    Hi,
    I created a report in Crystal Reports 2008, using connection to SAP tables and Function Modules. The reports contains some parameters and In Crystal Designer it works fine.
    Then I put it into the InfoView. If I try to view it, I get the error:
    "An error has occurred: Servlet execution threw an exception " before promting the database log on information.
    If I remove the parameters from this report, I can start the viewer without errors. Reports with parameters and other connection type work in this InfoView.
    The same report with parameters and SAP connection works fine in another InfoView.
    We upgraded the SAP Integration Kit on the server, but it did not help.
    I really need to find a solution for this problem, because cannot present the reports to the customer.
    Could somebody propose a solution? Probably someone has a similar problem?
    Kind regards,
    Oleksandr

    Hi,
    Thanks for your replies. Sorry for delay with my answer. Yesterday our admin upgraded the server (incl. JCO), the problem with the reports with parameters is resolved. But, now I have another problem with the database connection.
    Locally I use BO XI 3.1, Crystal Reports SP2, BO XI Integration for SAP solutions. On the server :
    BO Enterprise XI 3.1 SP2
    BO XI 3.1 Integration for SAP Solutions FP 2.1 Update
    BO XI 3.1 Integration for SAP Solutions Russian Language Pack
    BO XI 3.1 Integration for SAP Solutions SP2
    SAP BO XI 3.1 Integration, version for SAP solutions applications SP3 Update
    SAP BO XI 3.1 Integration, version for SAP solutions applications Russian Language Pack
    Now I create locally an empty report in Crystal Reports, just select in the database-assistent one SAP table and save without using these fields at all.
    Then, I go to the customer InfoView, there add this report using "Add->Crystal Reports..." from my local folder. If I click "View", I get the error:
    "Error in File Test: Failed to load database information. "
    If I click "View" for a report with parameters, a screen appears for the parameter selection, but after "Execute" I get the same error.
    Yesterday before server upgrade I could start the viewer for the same reports without parameters. All reports can be viewed now in another InfoView.
    I tried to change some options for the report Database Configuration in CMC, but it did not help. Possibly was I wrong with the settings?
    I would appreciate if you give me any idea how this problem can be solved.
    Thanks in advance!
    Oleksandr

  • Restrict the view for report MCSG on user ID level or Sales office level

    Hi,
    I need solution to restrict the view of MCSG report on user ID level or sales office level. he can able to view his own sales office data in report. Currently user able to view the all sales office data he is not restricted for same.
    Can u Pl provide solution.
    Regards
    Tarunkumar

    hi
    check with your basis team they can restrict the usage of the t-code on the basis of activity (create, change, display), parameters like sales office, division, distribution channel etc.
    saurabh

Maybe you are looking for

  • If I open a PDF doc in a new tab and then try and close the tab with ctrl-w it will try and close all tabs unless I switch to another tab and back again.

    Running Firefox beta and Adobe Acrobat 10. If I open a PDF document in a new tab, say http://support.avaya.com/css/P8/documents/100146419, and then try and close the tab using ctrl-w, I get the message warning me about closing all tabs. If I switch t

  • SQLDeveloper 3.2 - I can't see trigger code

    Hi people In some cases, I can't see trigger code. I didn't find a pattern to determine what kind of trigger has an invisible code. For example, in my instance I can't see code of SCOTT.AFTER_INS_UPD_ON_EMP trigger, but I see it in SQL tab for SCOTT.

  • Calculating maximum font size

    Okay, I have a JTextField with wrap on. It's setEditable(false). The string in it is going to be changing constantly and the field has a fixed size. I'm trying to come up with a method that will determine the maximum sized font that will be able to f

  • FCP uncompressed on Vista 64

    I have FCP Express 4. Works great. I would like to play uncompressed video on Windows Vista 64 thru Quicktime pro. I can play compressed video without a problem. I presume I need some type of purchased add-on to Quicktime pro but don't know what to p

  • Yet another colour management question

    Hi folks, I've read several of the very detailed colour management posts/threads here already but haven't found the answer(s) I'm looking for. So I'm hoping that some of the experts might be able to spare me some time and input... I am running a Wind