Report Builder SQL Queries - Convert CN to clear text

I am trying to customize a query in Report Builder to message values as they are delivered, and running into value expression errors.
My query returns data from the AD Computer Object "managedBy" field. The problem is that this field returns data in the format of:
CN=Security Group Name,OU=blah,OU=blah,DC=stuff,DC=com etc
I am trying to get it to return just the "Security Group" value which is much more useful. I found this great article which almost works for me: https://social.technet.microsoft.com/forums/systemcenter/en-US/6610d238-72f2-4e75-a0cc-e1383dd8e94b/ad-system-discovery-convert-cn-to-clear-text
However, once I try to save the report in Report Builder I get:
System.Web.Services.Protocols.SoapException: The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified
dataset scope. Letters in the names of fields must use the correct case.
This is the original SQL query:
select  all SMS_R_System.Name0,SMS_R_System.managedBy0,SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System
INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
My edited query:
select  all SMS_R_System.Name0,REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',','),SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0
from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID
= SMS_R_System.ItemKey
Thoughts?

Hey,
Since you manipulate the original value of
ManagedBy0 in your SELECT, the column name will change to
(No column name). I did a test on my side and look what I get.
Error : "The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’."
He search for a variable
ManagedBy0 in your query but don't find any because there's no name assigned.
Try to run this query. Add
AS ManagedBy0 after your REPLACE. 
select all
SMS_R_System.Name0,
REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',',') AS ManagedBy0,
SMS_R_System.description0,
SMS_G_System_OPERATING_SYSTEM.Caption00,
SMS_R_System.Resource_Domain_OR_Workgr0,
SMS_R_System.whenCreated0,
SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
Let me know.
Nick Pilon | Blog : System Center Dudes

Similar Messages

  • CF Report Builder - multiple queries

    I am a CF developer who has worked a fair bit with coding
    reports manually. Have taken the plunge with report builder and
    generally like what I see, BUT am quite disappointed with an
    apparent lack of documentation or tutorials on complex reporting
    techniques.
    I need to do a report which ideally requires two queries, the
    results of which the report's purpose is to compare.
    The problem is, from what I can tell, a .CFR can only have
    ONE query (which I find odd). Can anyone suggest a way of being
    able to have more than one query result set passed into a .CFR.
    I am starting to wonder that CF Report Builder might be great
    for fairly basic, single data set reports, but no good for large
    complex reports. I would be interested in hearing others opinions
    on this.
    Many Thanks in Advance.

    Thanks tmschmitt. You are right in that I am (was) stuck on
    passing in multiple queries. What I have managed to do is use the
    Advanced option of the query builder to write my two seperate
    queries, then combine them into one recordset by doing a Query on
    the Queries. Not sure if this is the best way around it, but it
    seems to be working fine. Problem now is that I need to manually
    craete 500+ "Query Fields" (yuk).
    I haven't really delved into the sub-reports yet, but have a
    feeling they won't meet my current needs. Basically i have 253
    columns of demographic data. I need one recordset (A) with this
    data from one geographic location with a recordset from a different
    location (B). I then need to lay out the data with each field from
    B beside it's corresponding field from A. In short, it is a
    comparitive report whereby the reader can compare a given value
    (e.g. avg income) from one area with that from another. This would
    be fairly straightforward in a scripted report, but with Report
    Builder appears to be quite cumbersome and potentially unmanagable
    as I need to handle each field explicitly (rather than looping over
    recordsets and structures to generate the different sections of the
    report).

  • Oracle10g - Report Builder REFCURSOR queries

    Hello,
    The below link has all the steps to create a report with Ref Cusror queries http://download-east.oracle.com/docs/cd/A97335_02/busint.102/a73172/bawor_re.htm
    My question is in "Program Unit Editor" instead of creating a FUNCTION which returns a single REFCURSOR, is it possible to use a PROCEDURE which has 3 OUT REFCURSORS?
    Thanks

    Hey,
    Since you manipulate the original value of
    ManagedBy0 in your SELECT, the column name will change to
    (No column name). I did a test on my side and look what I get.
    Error : "The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’."
    He search for a variable
    ManagedBy0 in your query but don't find any because there's no name assigned.
    Try to run this query. Add
    AS ManagedBy0 after your REPLACE. 
    select all
    SMS_R_System.Name0,
    REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',',') AS ManagedBy0,
    SMS_R_System.description0,
    SMS_G_System_OPERATING_SYSTEM.Caption00,
    SMS_R_System.Resource_Domain_OR_Workgr0,
    SMS_R_System.whenCreated0,
    SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
    Let me know.
    Nick Pilon | Blog : System Center Dudes

  • OEM reports using SQL queries

    Hi
    I'm working in oracle 9i
    Aix 5.3
    I dont have oem access. How ever, I would like to generate reports using queries for the following.
    1. Response time overview - per statement execution response times and response time break down.
    2. wait analysis overview
    3. CPU Overview - stats that can pin point cpu usage areas.
    4. TOP i/o's - at session level/ statement level.
    I would appriciate queries/URLs
    /Raj

    Again what limitation? Afraid to ask the password? Do not know how to override the password?
    Other than that: if some people don't want to tell you the perfstat password (maybe for valid reasons), do you think they will be happy when you start running your own queries against the v$ views (often quite expensive)
    or do you think you will gain more by cooperate with them. Other than that: if you want to run your own v$ queries why do you outsource writing them to this forum?
    Sybrand Bakker
    Senior Oracle DBA

  • Want to execute SQL Queries from Textfile

    I have a text file full of a bunch of sql queries, of the format:
    select something1, something2
    from someplace
    select something3, something4
    from someplace2
    select something5, something6
    from someplace3
    I want to execute these queries one at a time and then after each one executes, I will do something with the resultset. Question is, how do I pull each query from the text file one at a time and execute? I was doing this by using java.util.Scanner and java.lang.StringBuilder where I would scan one line at a time and then check to see if the line is empty, otherwise I append the line to the StringBuilder. If the line is empty, I process whatever is stored in the StringBuilder. The problem with doing this is that it does not preserve the newline from the text file, so I get queries that look like:
    "select something5, something6from someplace3"
    which of course are invalid. Does anyone know a better way to build SQL queries / statements from a text file? How do I get the newline or carriage return character?

    Just replace newline by space?

  • Report Builder Fonts

    Hi Guys
    I've just built a new report in CF Report Builder and changed
    the font of my text. However, when the report is out put to a PDF,
    the font has not changed.
    Any suggestions please.
    Many thanks in advance, All the best
    Wes

    You can try modifying the style and checking "Embed Font" to
    make sure the font is part of the PDF file.

  • Converting cursor to ref cursor in Report builder pl/sql

    Hi,
    I am trying to use dynamic sql in My report 's pl/sql code.
    I can not use execute Immediate statement since this feature is not suppoerted at client side and i am doing the coding In my local mchine and running the report loaclly.......???
    Another way to use dynamic sql is by using dbms_sql package.
    Using dbms_sql to run a sql will give me a normal cursor as an output.
    Since in report builder pl/sql only ref cursor is allowed as a return type from a function........the problem i m facing is conversion of the cursor to ref cursor......
    in oracle 11g we have a built in function in dbms_sql package that can be used for the conversion....
    i m using oracle 10 g where the above mentioned feature is not available............
    Please give some way to resolve this issue............!!!!!!!!!!!!
    Thanks in Advance.....!!!!!!!
    Abhishant

    You may use some stored procedures that will take full advantage of dynamic SQL. Make a stored proc that inserts rows in a global temporary table. You will call that stored proc in the afterpform trigger. And you will have the report querry select from the temporary table populated by the stored proc.
    I did some things like that.
    HTH

  • Linking two PL/SQL queries in 10G reports builder

    Hi,
    I have two complex SQL queries and I want to link one to the other.
    ie. I have a class of applicants and I want to retrieve their information, I do this with query one. Then for each applicant I have a number of checks all of which must be held in a cursor, so I have query two. But for each entry in query one I want to link it to the entry in query two.
    Data links dont seem to work for PL SQL queries, so any suggestions on how I would do it?
    Thanks G.

    What is a PL SQL query?

  • SQL Server 2008 R2 - Report Builder 3.0 - timeout using shared data source and stored procedure

    I select the shared datasource from the data source propeties dialog, test the connection and everything is good.
    I add a dataset by selecting "use a dataset embedded in my report" option within the Dataset properties dialog.
    I select the newly added data source, click the "Stored procedure" query type and drop down the list box and select my intended stored procedure.
    the timeout for the dataset is "0" seconds.
    I click the "OK" button and I'm presented with the parameters to the stored procedure.
    I enter valid data for the parameters and click the "OK" button.
    I then get the following error message after 30 seconds:
    The problem is, all of the timeouts, that I'm aware of, have values of zero (no timeout) or high enough values that 30 seconds isn't even close to the timeout.
    I think the smallest timeout we have is 120 seconds.
    I have searched this site and many others and the solutions all involve altering the stored procedure to get the fields into report builder and then revert the stored procedure back to its original form.
    To me, this is NOT a solution.  
    I have too many stored procedures that need to be brought into Report Builder.
    I need a real solution.
    Thank you for you time, Tim Caldwell.
    Timothy E Caldwell

    I don't mean to be rude, but really, check to see if the stored procedure can return data rows???
    Maybe I'm not being clear enough.
    The stored procedure runs perfectly fine.
    it runs perfectly fine in the production environment and the test environment.
    I can access the stored procedure in several ways and have it return correct data.
    I can even trick report builder into creating a dataset with parameters and run the stored procedure that way.
    What I cannot do, is to get report builder to not timeout after 30 seconds on the initial creation of a dataset with a Query type of stored procedure.
    I have seen this issues posted again and again and again on may different sites and the "solution" is to simplifiy the stored procedure by creating a stored procedure that has a create table and a select in the stored procedure and that's it.  After
    report builder creates the dataset the developer then has to replace the simplified stored procedure with the actual stored procedure and everything works fine after that.
    HOWEVER, having to go through this process for 70 or more stored procedures is ridiculous.
    It would appear that there is something within report builder itself that is causing this issue.
    The SQL Script included is an example of a stored procedure that will not create fields create a dataset with fields and parameters in Report Builder 3.0:
    USE [CRUM_IT]
    GO
    /****** Object: StoredProcedure [dbo].[COGNOS_Level5ScriptSP] Script Date: 11/17/2014 08:02:26 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER procedure [dbo].[COGNOS_Level5ScriptSP]
    @CompanyCode varchar(8) = null,
    @GetSiblings varchar(1) = 'N'
    as
    Begin
    -- get emergency contact info
    select *
    into #tmp_Contacts
    from
    (select
    ConEEID,
    con.connamelast as [Emer Contact Last Name],
    con.connamefirst as [Emer Contact First Name],
    con.connamemiddle as [Emer Contact Middle Initial/Name]--,
    ,ROW_NUMBER() over (Partition by ConEEID order by ConNameLast)as rn
    ,ISNULL(
    case when con.conphonepreferred = 'H'
    then '(' + substring(con.conphonehomenumber, 1, 3) + ')' + substring(con.conphonehomenumber, 4, 3) + '-' + substring(con.conphonehomenumber, 7, 4)
    else '(' + substring(con.conphoneothernumber , 1, 3) + ')' + substring(con.conphoneothernumber , 4, 3) + '-' + substring(con.conphoneothernumber , 7, 4)
    end,
    ) as [Emergency Phone]
    from [ultiprosqlprod1].[ultipro_crum].dbo.Contacts con
    where con.ConIsEmergencyContact='y'
    and con.ConIsActive='y'
    ) A
    where A.rn = 1
    CREATE TABLE #tmp_CompanyCodes (CompanyCode varchar(8))
    If @GetSiblings = 'Y'
    Begin
    INSERT INTO #tmp_CompanyCodes (CompanyCode)
    EXEC [z_GetClientNumbers_For_ParentOrg_By_ClientNumber] @CompanyCode
    End
    INSERT INTO #tmp_CompanyCodes
    values (@CompanyCode)
    select *
    into #tmp_Company
    from [ultiprosqlprod1].[ultipro_crum].dbo.Company
    where cmpcompanycode in (select CompanyCode from #tmp_CompanyCodes)
    select distinct
    cmpcompanycode as [Client ID],
    CmpCompanyDBAName as [Client Name],
    eec.eecEmplStatus AS [Employment Status],
    eec.eecEmpNo AS [Employee Num],
    rtrim(eep.eepNameLast) AS [Last Name],
    rtrim(eep.eepNameFirst) AS [First Name],
    isnull(rtrim(ltrim(eep.eepNameMiddle)), '') AS [Middle Initial/Name],
    rtrim(eep.eepAddressLine1) AS [Address Line 1],
    isnull(rtrim(eep.eepAddressLine2), '') AS [Address Line 2],
    eep.eepAddressCity AS [City],
    eep.eepAddressState AS [State],
    CASE
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) = 0
    THEN substring(eep.eepAddressZipCode, 1, 5)
    ELSE rtrim(eep.eepAddressZipCode)
    END AS [Zip code],
    CASE
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) = 0
    THEN substring(eep.eepAddressZipCode, 6, 4)
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) > 0
    THEN substring(eep.eepAddressZipCode, charindex(eep.eepAddressZipCode, '-', 1) + 1, 4)
    WHEN len(eep.eepAddressZipCode) <= 5
    THEN ''
    END AS [ZIP + 4],
    substring(eep.eepSSN, 1, 3) + '-' + substring(eep.eepSSN, 4, 2) + '-' + substring(eep.eepSSN, 6, 4) AS [SSN],
    isnull(convert(VARCHAR(10), eep.eepDateOfBirth, 101), '') AS [Date Of Birth],
    eetFED.TAXCODE AS [FED Tax Code],
    eetFED.FILINGSTATUS AS [Fed Filing Status],
    eetFED.EXEMPTIONS AS [Fed Exemption Allowance],
    eetFED.ADDITIONAL AS [Additional Fed Withholding],
    eetSIT.TAXCODE AS [SIT Tax Code],
    eetSIT.FILINGSTATUS AS [State Filing Status],
    eetSIT.EXEMPTIONS AS [State Exemption Allowance],
    eetSIT.ADDITIONAL AS [Additional State Withholding],
    isnull('(' + substring(eep.eepPhoneHomeNumber, 1, 3) + ')' + substring(eep.eepPhoneHomeNumber, 4, 3) + '-' + substring(eep.eepPhoneHomeNumber, 7, 4), '') AS [Home Phone],
    isnull((SELECT cod.codDesc
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.Codes cod WITH (NOLOCK)
    WHERE cod.codCode = eep.eepEthnicID
    AND cod.codDosTable = 'ETHNICCODE'), '') AS [Race-Origin], --eep.eepEthnicID AS [Race-Origin],
    eep.eepGender AS [Gender],
    isnull(convert(VARCHAR(10), eec.eecDateOfOriginalHire, 101), '') AS [Original Hire Date],
    isnull(convert(VARCHAR(10), eec.eecDateOfSeniority, 101), '') AS [Seniority Date],
    isnull(convert(VARCHAR(10), eec.eecDateOfTermination, 101), '') AS [Termination Date],
    isnull(eecTermType,'') as [Termination Type],
    isnull(TchDesc, '') as [Termination Reason],
    rtrim(eec.eecJobCode) AS [WC Code],
    isnull(eec.eecJobTitle, '') AS [Job Title],
    pgr.pgrPayFrequency AS [Pay Frequency],
    eec.eecFullTimeOrPartTime AS [Full/Part Time],
    eec.eecSalaryOrHourly AS [Pay Type],
    isnull(convert(MONEY, eec.eecHourlyPayRate), 0.00) AS [Hourly Rate],
    isnull(eec.eecAnnSalary, 0.00) AS [Annual Salary],
    [YTD Hours],
    isnull(eep.eepNameFormer, '') AS [Maiden Name],
    eec.eecLocation AS [Location ID],
    rtrim(eec.eecOrgLvl1) AS [Department ID],
    eec.eecorglvl2 AS [Cost Item],
    eec.eecorglvl3 as [Client Project],
    eec.eecPayGroup as [Pay Group],
    isnull(eepAddressEMail,' ') as [Email Address],
    isNull(BankName1,' ') as PrimaryBank,
    isNull(BankRoute1,' ') as PrimaryRouteNum,
    isNull(Account1,' ') as PrimaryAccount,
    isNull(AcctType1,' ') as PrimaryAcctType,
    isNull(DepositRule1,' ') as PrimaryDepositRule,
    isNull(BankName2,' ') as SecondaryBank,
    isNull(BankRoute2,' ') as SecondaryRouteNum,
    isNull(Account2,' ') as SecondaryAccount,
    isNull(AcctType2,' ') as SecondaryAcctType,
    isNull(DepositRule2,' ') as SecondaryDepositRule,
    isNull(
    CASE
    WHEN DepositRule2 = 'D'
    THEN '$' + convert(varchar, cast(EddAmtOrPct2 AS decimal(10,2)))
    WHEN DepositRule2 = 'P'
    THEN convert(varchar, cast((EddAmtOrPct2*100) AS decimal(10,0))) + '%'
    ELSE null
    END,' ') as SecondaryDepositAmount,
    isNull(BankName3,' ') as ThirdBank,
    isNull(BankRoute3,' ') as ThirdRouteNum,
    isNull(Account3,' ') as ThirdAccount,
    isNull(AcctType3,' ') as ThirdAcctType,
    isNull(DepositRule3,' ') as ThirdDepositRule,
    isNull(
    CASE
    WHEN DepositRule3 = 'D'
    THEN '$' + convert(varchar, cast(EddAmtOrPct3 AS decimal(10,2)))
    WHEN DepositRule3 = 'P'
    THEN convert(varchar, cast((EddAmtOrPct3*100) AS decimal(10,0))) + '%'
    ELSE null
    END,' ') as ThirdDepositAmount,
    Supervisor,
    eec.eecEEID AS [Employee EEID],
    eec.EecJobCode As [Job Code],
    isnull(eec.EecTimeclockID,' ') As [Time Clock ID],
    con.[Emer Contact Last Name],
    con.[Emer Contact First Name],
    con.[Emer Contact Middle Initial/Name],
    con.[Emergency Phone]
    from [ultiprosqlprod1].[ultipro_crum].dbo.empPers eep WITH (NOLOCK)
    inner join [ultiprosqlprod1].[ultipro_crum].dbo.empComp eec WITH (NOLOCK)
    ON eep.eepEEID = eec.eecEEID
    inner join #tmp_Company cmp WITH (NOLOCK)
    ON eec.eecCOID = cmp.cmpCOID
    inner join [ultiprosqlprod1].[ultipro_crum].dbo.PayGroup pgr WITH (NOLOCK)
    ON eec.eecPayGroup = pgr.pgrPayGroup
    left outer join [ultiprosqlprod1].[ultipro_crum].dbo.TrmReasn
    on tchCode = eecTermReason
    left join (select CAST(sum(isnull(eee.eeeYTDHrs,0.00))AS DECIMAL(18,2)) as [YTD Hours],
    eeeEEID,
    eeeCOID
    from [ultiprosqlprod1].[ultipro_crum].dbo.EmpEarn eee with (NOLOCK)
    group by eeeCOID,eeeEEID)eee
    on eec.eecEEID = eee.eeeEEID
    and eec.eecCOID = eee.eeeCOID
    left join (SELECT eetCOID AS COID,
    eetEEID AS EEID,
    eetTaxCode AS TAXCODE,
    eetFilingStatus AS FILINGSTATUS,
    eetExemptions AS EXEMPTIONS,
    eetExtraTaxDollars AS ADDITIONAL
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.empTax WITH (NOLOCK)
    WHERE eetTaxCode = 'USFIT'
    )eetFED
    ON eec.eecCOID = eetFED.COID
    and eec.eecEEID = eetFED.EEID
    left join (SELECT eetCOID AS COID,
    eetEEID AS EEID,
    eetTaxCode AS TAXCODE,
    eetFilingStatus AS FILINGSTATUS,
    eetExemptions AS EXEMPTIONS,
    eetExtraTaxDollars AS ADDITIONAL
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.empTax WITH (NOLOCK)
    WHERE eetTaxCode like '%SIT'
    AND eetIsWorkInTaxCode = 'Y'
    )eetSIT
    ON eec.eecCOID = eetSIT.COID
    and eec.eecEEID = eetSIT.EEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName1,
    eddEEBankRoute BankRoute1,
    eddAcct Account1,
    EddAcctType AcctType1,
    EddDepositRule DepositRule1,
    EddAmtOrPct EddAmtOrPct1
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '99')edd
    ON eec.eecCOID = edd.eddCOID
    and eec.eecEEID = edd.eddEEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName2,
    eddEEBankRoute BankRoute2,
    eddAcct Account2,
    EddAcctType AcctType2,
    EddDepositRule DepositRule2,
    EddAmtOrPct EddAmtOrPct2
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '01')edd2
    ON eec.eecCOID = edd2.eddCOID
    and eec.eecEEID = edd2.eddEEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName3,
    eddEEBankRoute BankRoute3,
    eddAcct Account3,
    EddAcctType AcctType3,
    EddDepositRule DepositRule3,
    EddAmtOrPct EddAmtOrPct3
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '02')edd3
    ON eec.eecCOID = edd3.eddCOID
    and eec.eecEEID = edd3.eddEEID
    left outer join (SELECT eecCOID,
    eecEEID,
    rtrim(eepNameLast) + ', ' +
    rtrim(eepNameFirst) + ' ' +
    isnull(rtrim(ltrim(eepNameMiddle)), '') AS [Supervisor]
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpComp WITH (NOLOCK)
    join [ultiprosqlprod1].[ultipro_crum].dbo.EmpPers with (NoLock)
    on eeceeid = eepeeid)eec2
    ON eec.eecSupervisorID = eec2.eecEEID
    left outer join #tmp_Contacts con
    on eep.eepEEID = con.ConEEID
    order by [Client ID],
    [Last Name],
    [First Name]
    drop table #tmp_Contacts
    END
    Timothy E Caldwell

  • SQL Report Builder 3.0 Automatic Scheduling feature ?

    Hello All,
    We have installed and commissioned a HMI SCADA solution for Shell Petroleum South Africa, We are using Copa Data Zenon for our HMI solution, Zenon's historian are writing variable values into a SQL database from where we are reading these variables with
    I-net Clear Reports. 
    However, I net  Clear Reports uses a "PLUS" license which is used for the scheduling function. The license is priced based on the amount of CPU Cores the server has and ours has 16 cores so the license is extremely expensive.
    What we need :
    To create a report with values from a SQL Database.
    Report must be able to be scheduled, to run at specific time.
    I have done some testing and used the same SQL queries we used in I-net clear reports.
    SQL Report Builder 3.0 does get the variable values when you hit "run" , but it does not look like there is an automatic report scheduling function ? We want to execute a daily , weekly & monthly report.
    Does a Scheduling feature exist ?? Please advise
    I would highly appreciate your assistance.
    Regards.
    Paul  
    Automation Engineer

    Hello,
    Report Builder 3.0 is just a report authoring tool.You can design and preview the report with Report Builder,or you can publish your report to a report server or a report server in SharePoint integrated mode, where others can run it. There is no schedule
    running function in Report Builder which can processing the report automatically.
    SQL Server Reporting Services Standard edition or high edition support email and file share subscriptions and scheduling. You can create subscriptions that can automatic running the report based on a schedule(daily , weekly or monthly ) and send reports
    to a shared folder or to an e-mail address.
    Reference:Subscriptions and Delivery (Reporting Services)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Looking for a SQL report guru to help me with SQL queries

    As an independent consultant, I sometimes need to build custom SSRS reports.  I need someone I can reach out to when SQL queries become complex.  There is such a query now.
    Thanks.
    Richgar
    612-207-8347

    Thanks, Visakh,
    I'm trying to determine which resources did not fill out a timesheet.  The result of this query is missing just a few names and I can't find the reason.  I'm thinking of a web meeting looking at real data is necessary and will be glad to pay
    for the help.
    SELECT       
    ResourceName, ResourceIsGeneric, ResourceType, RBS, ResourceIsActive
    FROM           
    MSP_EpmResource_UserView
    WHERE       
    (ResourceName NOT IN
    (SELECT DISTINCT MSP_EpmResource_UserView_1.ResourceName
    FROM           
    MSP_EpmResource_UserView AS MSP_EpmResource_UserView_1 INNER JOIN
    MSP_TimesheetLine_UserView ON MSP_EpmResource_UserView_1.ResourceUID = MSP_TimesheetLine_UserView.ResourceUID INNER JOIN
    MSP_Timesheet ON MSP_TimesheetLine_UserView.TimesheetUID = MSP_Timesheet.TimesheetUID
    WHERE        (MSP_EpmResource_UserView_1.ResourceType = 2) AND (MSP_EpmResource_UserView_1.ResourceIsActive = 1) AND (MSP_EpmResource_UserView_1.RBS IS NOT NULL) AND
    (CONVERT(varchar, MSP_TimesheetLine_UserView.PeriodStartDate, 101) IN (@Period_Start_Date)) AND (MSP_EpmResource_UserView_1.RBS IN (@RBS)))) AND (ResourceIsGeneric = 0) AND
    (ResourceType = 2) AND (RBS IN (@RBS)) AND (ResourceIsActive = 1)

  • Erratic Report Region Behavior with Dynamic SQL Queries

    I'm running HTMLDB v 1.5.1.00.12 and I've noticed some odd behavior with report regions using dynamic SQL queries. Every so often, our testers will run a page containing a dynamic sql report region and get the following error, (despite the fact the query was working only moments ago and no other developer has touched it):
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    or sometimes
    failed to parse SQL query:ORA-01403: no data found
    The only solution I've found so far is to:
    1) Make a copy of the failed report region.
    2) Disable or delete the original failed report region.
    The new copy of the report region runs without issue.
    My search of the forums turned up the following two threads, but neither provided me with a clear explanation of the cause, and how to avoid it:
    ORA-06502:PL/SQL: numeric or value error: character string buffer too small
    Re: Import Export Error (ORA-06502)
    The columns being returned are below the 4000 character limit, and the rows being returned are far less than 32k in size.
    Could this have anything to do with the way HTMLDB is internally storing the PL/SQL used to generate the dynamic SQL Query? Is there any known issue related to this with that version of HTMLDB?
    This problem occurs without any discernable pattern or consistency, making it hard to determine where I should focus my efforts in tracking down the cause.

    Hi all,
    My report seems to be behaving correctly once i set it to "Use Generic Column Names (parse query at runtime only)" :)
    Cheers,
    Joel

  • Error While Opening JSP in Report Builder converted from RDF

    Hi,
    I am using Oracle reports 9i to convert rdf into jsp and invoke this jsp using OC4J to get HTML report.
    The problem i am facing is that while converting RDF to JSP conversion went on successfull but when iam trying to open the JSP in Report builder it gives me error REP-2: Unable to retrieve string from message file.
    When i want to see the paper layout it is not present and datamodel is also corrupted. In the data model sources for some fileds become null and one addtional group is appearing with no column in it.
    Urgent help is needed.
    For any help Thanks in advance.
    Regards
    Sanjay Tripathi

    Hello Sanjay,
    There are some known issues in Reports 9i due to which XML/JSP reports do not open correctly in Builder, and throw the REP-0002 error. These bugs are currently being looked into, and will be addressed soon.
    1. If your report is using ref cursor queries, and you are hitting the above error, please ensure you connect to a database before you open the report.
    2. If your report has summary/formula columns, please try to create the JSP report without these columns and then try to open it in Builder.
    Thanks,
    The Oracle Reports Team.

  • Dynamic queries in report builder 6i ( ref cursor query )

    Hi everyone,
    My requirement is that I want to create a report where the query is dynamic. The dynamic part will be known at runtime as it is being passed via a parameter. My query looks like this :
    select * from emp where sal :p1 :p2
    Possible values for :p1 are - '>', '<', '>=', '<=', '=', '!='
    Possible values for :p2 are - any value entered by the user
    I tried creating a query in report builder based on a ref cursor. But it does not allow me to create the query for the ref cursor dynamically. That means I have to hardcode the query in the program.
    I tried using place holder columns without success.
    Can someone please help me ?
    Regards,
    Al

    Hi,
    You can use lexical paramters in the sql query
    x - char - parameter
    select * from emp &x
    you need to pass the value for x in the parameter as
    'where sal < 1234'.
    Note : Lexical variable should be of char datatype.
    This is an alternative to the ref cursors.
    This works. Hope this is clear.

  • Adding parameter to a MySQL query in MS SQL Server Report Builder

    So I have a MySQL DB connected to MS SQL Server Report Builder via ODBC connector. Everything is fine, I can execute queries and put the fields into report.
    But I can't add an parameter to the query.
    Example query:
    SELECT column1, column2 FROM table WHERE column3 = (@parameter1)
    The result set is just empty. I think the problem is that I'm using MySQL and not MS SQL. Any suggestion?

    Hello Alan,
    Named parameters like @param works with SQL Server / .NET data provider, but not for OleDB, here you have to use the question mark instead
    SELECT column1, column2
    FROM table
    WHERE column3 = ? and column9 = ?
    When you assign the report parameter to query parameter you have to take care about the order of used ? in query
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Issue with Taxes getting Posted to Customer Account in case o Free of Charg

    Hi All, We have a requirement in our project where we need to pay tax to government on   giving free of charge items to customers in a Sales order along with normal items. But the tax should be not be charged to customer but to be born by us ( Sellin

  • ODBC fails with error 126

    I am trying to connect to oracle 11g database via instant client 11.2 odbc driver on windows xp. When I test the connection in the odbc data source administrator, I get the "connection successful" message. When I try connect via Crystal Developer or

  • How do I change the "Open In" default from "Photoshop" to "Photoshop CC" in Bridge CC?

    When I double click on a photo in Bridge CC to open it in Photoshop CC for processing, I get an error message.  "Windows cannot find 'C:\program files\adobe\adobePhotoshop CS4 (64 bit)\Photoshop.exe."  Make sure you typed the name correctly, and then

  • How to trap the two function code in the bdc

    Dear All, I have a bdc program now i need to pick up function code based on some condition. means if some condition then goto one function code and else don't go. I tried it but not working. It is working in shdb but not in the program. eg.     if no

  • Link between XML table and a resource

    I have registered an XML Schema in Oracle and the tables were automatically generated. I can access the data in these tables via "SELECT extractValue(value(i),'/factureExterne/codeTypeFacturation') FROM <xml_table> i". I use WebDAV + ftp to upload my