Displaying logged in user when printing a query generated report.

Hi all
I need to know how can i show the user code of the person who printed a certain report.
Scenario:
When a despatch clerk reconciles driver cash they print a query genereted report , so i need his user code to show on the report... please check the query below... and make suggestions ...
SELECT T0.DocNum, T0.CardName, T1.PymntGroup, T0.DocTotal, T0.U_ROUTEMARKTN, T0.U_RTNAME
FROM OINV T0 INNER JOIN OCTG T1 ON T0.GroupNum = T1.GroupNum
WHERE T0.docDate =[%0] and  T0.U_ROUTEMARKTN = [%1] GROUP BY T0.DocNum, T0.CardName, T1.PymntGroup, T0.DocTotal, T0.U_ROUTEMARKTN, T0.U_RTNAME
ORDER BY t0.u_rtname
i need the user be copied from the logged in user and be displayed in the header level of the report.
Thanks

Hi
To display the username you need not modify your query.
Rather, Add a Database Field in the PLD and click in Properties and select Content Tab and set following values:
Table: Users
Column: Username
Preview the report and you'll get the logged in UserName

Similar Messages

  • What is the best way to display errors to users when using JSPs?

              Hello,
              Could someone suggest me the best way to display errors to users when using JSPs?
              Many thanks in advance.
              Rino
              

              Thanks for the code snippet!
              Rino
              "Deepak Vohra" <[email protected]> wrote:
              >
              >
              >The 'errorPage' attribute of the 'page' directive forwards uncaught run-time
              >exceptions
              >to an error processing page. For example:
              >
              ><%@ page errorPage="error.jsp" %>
              >
              >redirects the browser to the JSP page error.jsp if an uncaught exception
              >is encountered.
              >
              >
              >Within error.jsp, indicate that it is an error-processing page, via the
              >directive:
              >
              >
              >
              ><%@ page isErrorPage="true" %>
              >
              >The Throwable object describing the exception may be accessed within
              >the error
              >page via the 'exception' implicit object.
              >
              >
              ><% if (exception != null) { %>
              ><p> An exception was thrown: <b> <%= exception %>
              >
              ><p> With the following stack trace:
              ><pre>
              >
              ><%
              > ByteArrayOutputStream ostr = new ByteArrayOutputStream();
              > exception.printStackTrace(new PrintStream(ostr));
              > out.print(ostr);
              >%>
              ></pre>
              >
              >
              >
              >"Rino Srivastava" <[email protected]> wrote:
              >>
              >>Hello,
              >>
              >>Could someone suggest me the best way to display errors to users when
              >>using JSPs?
              >>
              >>Many thanks in advance.
              >>
              >>Rino
              >
              

  • [Forum FAQ] How do I send an email to users when the data in the report have been changed in Reporting Services?

    Introduction
    There is a scenario that the data in the report changes infrequently, so the users want to be informed and get the most updated data once the data changes. By default, report server always run the report with the most recent data. Is there a way that we
    can subscribe the report, so that we can send an email to users when the data in the report has been changed?
    Solution
    To achieve this requirement, we can create a subscription for the report, then create a trigger in the table which including the report data. When this table has data insert, update or delete, it will be triggered and execute the subscription to send email
    to users.
    In the Report Manager, create a subscription for the report and make it only execute one time.
    When we create a subscription, a corresponding SQL Agent job will be created. Then we can use the query below to find out the job based on ScheduleId:
    -- List all SSRS subscriptions
    USE [ReportServer];  -- You may change the database name.
    GO 
    SELECT USR.UserName AS SubscriptionOwner
          ,SUB.ModifiedDate
          ,SUB.[Description]
          ,SUB.EventType
          ,SUB.DeliveryExtension
          ,SUB.LastStatus
          ,SUB.LastRunTime
          ,SCH.NextRunTime
          ,SCH.Name AS ScheduleName   
              ,RS.ScheduleId
          ,CAT.[Path] AS ReportPath
          ,CAT.[Description] AS ReportDescription
    FROM dbo.Subscriptions AS SUB
         INNER JOIN dbo.Users AS USR
             ON SUB.OwnerID = USR.UserID
         INNER JOIN dbo.[Catalog] AS CAT
             ON SUB.Report_OID = CAT.ItemID
         INNER JOIN dbo.ReportSchedule AS RS
             ON SUB.Report_OID = RS.ReportID
                AND SUB.SubscriptionID = RS.SubscriptionID
         INNER JOIN dbo.Schedule AS SCH
             ON RS.ScheduleID = SCH.ScheduleID
    ORDER BY USR.UserName
             ,SUB.ModifiedDate ;
    Create a trigger in the table which including the report data.
    CREATE TRIGGER reminder
    ON test.dbo.users
    AFTER INSERT, UPDATE, DELETE
    AS
    exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    Please note that the command ‘exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'’ is coming from the job properties. We can go to SQL Server Agent Jobs, right-click the corresponding job to open
    the Steps, copy the step command, and then paste it to the query.
    Then when the user table has data insert, update or delete, the trigger will be triggered and execute the subscription to send email to users.
    References:
    Subscriptions and Delivery (Reporting Services)
    Internal Working of SSRS Subscriptions
    SQL Server Agent
    Applies to:
    Reporting Services 2005
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Unable to run user defined table in Query Generator...

    hi experts,
                         iam unable to run the user defined table in query generator..this is the query iam using...
    Select T0.U_Date from dbo.@ENQHEAD T0 where T0.U_EnqNo='[%0]'
    When i run this query it popups a window & asking EnqNo,when i select any enquiry no it's saying an error like----- Incorrect syntax near '@ENQHEAD'. iam unable to solve the above problem can anybody suggest me sme ideas....
    thanking you,
    shangai.

    Hi Shangai,
    I've just tried to reproduce the issue and found the following query worked correctly for me:
    SELECT T0.[Name] FROM [dbo].[@D01]  T0 WHERE T0.[U_SO]  = '[%0]''
    The only difference I can see is the square brackets [] in my query?
    Regards,
    Niall

  • How to define the PLD of a Query generator report

    Hi All,
    I want to define the PLD of a Query Report. Currently I am Convertning it to Excel format. But my client wants it in PLD format.  so please tell me the process of defining the PLD for a Query generator Report.
    Thanks & Regards
    Pankaj Sharma.

    Hi,
    When u wrote yr query at that time save yr query
    Now yr query is save in "Query Manager"
    Open Query Manager > select yr query
    There is a button "Create Report"
    Create USer Report Window is display "define yr name" and select "Base Temple"
    once u save it double click and edit yr PLD....
    Hope it a best way to create uer PLD
    Thanks
    Kevin

  • GRAPH in Query Generator Reports

    Hi Experts,
    I would like know what is the logic to generate graph in Query Generator report.
    you can see there is graph button in Query Generator window, if you click on this button, shows popup window with graph. i am not sure what is the logic they used to generate this graph.
    Please let me know if any one have an idea.
    Thanks in advnace.
    Regs
    kv

    Hi Gordon,
    Thanks for the quick reply,  let me check.
    Do SAP B1 have any DIAPI or UIAPI object for create graph.
    Please advise.
    Thanks
    kv

  • Display logged in user record from MySql DB

    I am currently building my business website. I have already set up my MySQL database, added a table for clients with ID, Username, Password, SessionID, and File. I have connected the db in dreamweaver. I have built the log in page for users to log in. After they log in, I want them to be able to see their record data on the next page. Logging in works just fine, but when the next page comes up, it is blank, as if there is no record data. I do no know much about PHP so I am sure it has something to do with the way I have it set up. The only server behaviors I have added is to log in user. I chose not to add any other validation behaviors until I get this problem fixed. Anyone who could steer me in the right direction?

    > but if I do not use them, then someones going to have
    >to show me a basic code to get me started
    My suggestion would not be to just learn basic code just to get started. You'll end up creating a site that was build-as-you-learn, which are always a mess. A better approach, if you really want to be a developer, is to take time to learn the concepts first. If you really don't want to learn this stuff and just want your site built, then hire an expert. If this is your business then focus on your business and let an experienced developer build the site.
    And if you just need to fix this one problem, then do as osgood suggested - post the code and someone here can help sort it out. But I suspect this is the first of many roadblocks you will hit and you may end up spending more in your own lost time than it would take to bid this out. Hard to say without knowing more about the features you plan to implement.

  • Error when print out SAP Crystal Report in SAP B1

    Dear all,
    I have encountered the following message when I tried to print out SAP Crystal Report at client pc:
    Could not load file or assembly 'CrystalDecision.Windows.Forms, Version = 12.0.2000.0, Culture=neutral, Publickey Token=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
    On the other hand, there's no error when I print out the SAP Crystal Report on server.
    Can anyone advice on the error message as above?
    Thanks alot.

    Hi All,
    I have SAP 2007 B,Visual Studio 2008 and Crystal report 2008 Add-on.  I am facing the same problem,
    "Could not load file or assembly 'CrystalDecision.Windows.form,Version=12.0.2000.0, Culture=neutral,Publickey Token =692fbea5521e1304' or one of its dependencies. The system can not find the file specified."
    I have uninstalled SAP B1 and Crystal report 2008. Still I am getting the same Error message. Kindly give me your suggestions.
    Regards,
    Tom.

  • Query Generator Report

    Hi,
        Using query generator I am able to retrive the records form system table and also from user defined table. But when i click on create report button in Query manager,it gives me create user report. & one print layout window is opening. After doing some modification there i saved it. The question is how to open this user report. Is there any option in query generator to synchronize with SAP B1?

    Yes I got the ultimate answer to my query.
    GoTo Tools->Queries->Queries PrintLayout->Select the user defined query->Click Print preview......

  • Display logged in user name in omniportlet

    I am getting error when I use portal.wwctx_api.get_user() in sql query in omniportlet. I saw a solution in the forum that I needed to create page parameter and get the user name in th epage parameter and use that parameter in omniportlet
    My question is that how do I set up the value for page parameter. I know only place I can set it up is default value for the page parameter. It doesn't work for me. Could anyone help me please?
    Thanks

    It is not possible use api in omniportlet, like wwctx_api....
    You will get to show username using parameters in VIEW tab from configuration of OmniPortlet.
    In Header Text fielder, put ##Param1##.....
    After you will need to setup parameter in properties of page.... In parameters tab, use SYSTEM VARIABLE for omniportlet.

  • HRPrinting.exe hangs when printing book with 100 reports

    We are currently running a Hyperion Report book with about 100 reports. We have not being able to succesfully print this book because HRPrinting.exe hangs. It does not even display data
    Any ideas on how to resolve this?

    It might be worth looking at "Financial Reporting Books Hang When Run In Complete Book Format [ID 1312802.1]" in Oracle Support, also check logs, check if it is a certain report causing the issue, check patches, threads can be increased though this would only be done if it is proven that it is not a different issue causing the print server to hang, log a call with Oracle.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • To display subreport page header when included in the main report

    Hi, 
    I am designing  a  report  using SSRS 2005.The main report has a few subreports.Each subreport has header which serve as page and table header for the report content.When the subreport is run individually there is no problem where header is
    getting displayed for each page  but when main report is executed only subreport body content is displayed.Can someone please suggest if there is any workaround for displaying sub report header
    My subreport looks as shown in the image below.

    Place your Header contents at top of the body and footer contents at bottom of the body. Remove Header and footer from your subreport.
    Aftab Ansari

  • Is it not possible to print the Excel generated reports from EBS!!

    Is is true that the Excel generated by XML Publisher is not printable from Oracle Applications. Does the printers do not have drivers to understand EXCEL format (which from XML Publisher is XHTML not binary .xls.) So for printed output we should only use PDF ??
    Please advice!!
    Thanks.

    Hi,
    Actually the Excel format generated by XML Publisher is XHTML ... so the print process would need to convert XHTML to Postscript (similar to PDF being converted to Postscript by pdf2ps).
    But you question is still valid... unfortunately I haven't tried it ... anyone else?
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Setting up footer to display only when printing

    Hello,
    I am trying to figure out if you can display a footer only
    when printing and not to be displayed when viewing the help
    information.
    Let me know if this is possible and if so how to do it.
    Thanks!

    Sorry we didn't get to you as quickly as you'd like, but we
    all have regular jobs...
    The content in footers can be conditionalized the same as
    regular context. RH provides the default Online and Print condition
    tags, but you can add others as you like.
    In addition, you can use templates to apply headers and
    footers to multiple topics more easily.
    See the "Conditional text" section of the RH Help.
    Good luck,
    Leon

  • VAT REPORT BASED ON CURRENT LOGGED IN USER

    Hi Guys,
    I am Working for a client and it they are having 9 branches and for each branch there will be  divided by different Series and different Tax Codes and  they want a  TAX Report based on the User Logged in.Each User Will be Assigned a branch and in the tax code an UDF(Location) has been created and for each tax code location has been entered there.
    So when User 1 of Branch 1 is running the report then the report should show only the record of that particular Branch 1 and
         When User 2 of Branch 2 is running the Report then it should show only branch 2 records .
    I Tired using an FMS to record the Current User Logged in but i am unable to include this in the below query.
    SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
    In the Below query , the Report needs to be filtered automatically based on the Current user Logged in(User who is running the report).
    There will be different Branches and Each Branch has One O Two Licenses and whenever the User1 Of Branch 1  runs the report then the report should display only the record related to that particular branch within the given date range.
    So ,to differentiate the Tax codes for each Branches we have created an UDF(Location) in tax codes and enter the branch name in the UDF and also each branch will have 3 different document series and each series.
    Instead of Giving the Location as a Parameter to choose we need to filter the report by the User logged in .
    SELECT distinct  M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
    l.targettype AS 'TARGET TYPE',
    t4.series,T4.SeriesName,
    case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
           when T4.SeriesName='LOC/CHN' then 'CHENNAI'
            when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
           end Location,L.TAXCODE,T6.RATE,
    case when t.statype ='1' then  'VAT'
           WHEN T.STATYPE ='4' THEN 'CST'
           END TAXTYPE,T.STATYPE,
    M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1  ) as 'VAT  SALES',
    (SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1  ) as '  VAT COLLECTED ',
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4  ) as 'CST  SALES',
    (SELECT SUM(TaxSum) FROM INV4 where statype=4 and  DocEntry=M.DocEntry   ) as ' CST COLLECTED ',
    (Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
    LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
    LEFT JOIN OUBR T7 ON  T7.NAME = T6.U_LOC
    LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND  TARGETTYPE !='14' and taxrate !='0'  A
    ND T6.RATE != '0'
    and t6.u_loc ='[%2]'
    GROUP BY
    M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
    M.DiscSum,M.WTSum,
    M.DocTotal,M.Series,T4.SeriesName,
    T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
    l.targettype,t.docentry,L.TAXCODE,T6.RATE
    Pls Gimme Some Ideas guys for designing this report .
    Thanks And Regards,
    P.V

    Hai Gordon,
    Thanks for the suggestion but i am sorry to say that after adding the said  Condition  to the below query it is showing the Below error.
    QUERY :
    SELECT distinct  M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
    l.targettype AS 'TARGET TYPE',
    t4.series,T4.SeriesName,
    case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
           when T4.SeriesName='LOC/CHN' then 'CHENNAI'
            when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
            WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
           end Location,L.TAXCODE,T6.RATE,
    case when t.statype ='1' then  'VAT'
           WHEN T.STATYPE ='4' THEN 'CST'
           END TAXTYPE,T.STATYPE,
    M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1  ) as 'VAT  SALES',
    (SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1  ) as '  VAT COLLECTED ',
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4  ) as 'CST  SALES',
    (SELECT SUM(TaxSum) FROM INV4 where statype=4 and  DocEntry=M.DocEntry   ) as ' CST COLLECTED ',
    (Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
    LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
    LEFT JOIN OUBR T7 ON  T7.NAME = T6.U_LOC
    LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND  TARGETTYPE !='14' and taxrate !='0'  AND T6.RATE != '0'
    AND $[USER] in (SELECT USERID FROM OUSR WHERE BRANCH = T7.CODE)
    GROUP BY
    M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
    M.DiscSum,M.WTSum,
    M.DocTotal,M.Series,T4.SeriesName,
    T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
    l.targettype,t.docentry,L.TAXCODE,T6.RATE
    ERROR
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'USER'.
    2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'GROUP'.
    3). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'User-Defined Values' (CSHS) (s) could not be prepared.
    Regards,
    P.V

Maybe you are looking for