SQL for a report in Reports Builder

I have a long query that is for all the variables for a report I am building in Reports Builder. So far everything is correct except one column in behaving pretty strangely. For some reason the value in each row is showing up as the same as the value at the bottom of the column which is the column's total. All the values above that should equal the lower value when you add them together.
What I've got is SUM statements. I figured out what I want the statement to do that's causing the problem I just can't make it do that. I want it to give me a count of how many times one value shows up when another value is equal to a certain value. Here is one line of the code that I've tried to change but SQL keeps giving me errors.
SUM(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_1,
I did change it to COUNT but then it gave me a different incorrect value.

SELECT component_name||' ( '||component_code||' )' component_code,agency_name||' ( '||agency_num||' )' agency_num,
COUNT(contract_num_ng) total_cnt,
SUM(dollars_obligated) total_amt,
COUNT(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 end) TOTAL_CNT_1,
SUM(case when contract_type = '1' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_1,
SUM(case when contract_type = '2' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_2,
SUM(case when contract_type = '2' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_2,
SUM(case when contract_type = '3' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_3,
SUM(case when contract_type = '3' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_3,
SUM(case when contract_type = 'A' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_A,
SUM(case when contract_type = 'A' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_A,
SUM(case when contract_type = 'B' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_B,
SUM(case when contract_type = 'B' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_B,
SUM(case when contract_type = 'J' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_J,
SUM(case when contract_type = 'J' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_J,
SUM(case when contract_type = 'K' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_K,
SUM(case when contract_type = 'K' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_K,
SUM(case when contract_type = 'L' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_L,
SUM(case when contract_type = 'L' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_L,
SUM(case when contract_type = 'M' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_M,
SUM(case when contract_type = 'M' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_M,
SUM(case when contract_type = 'R' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_R,
SUM(case when contract_type = 'R' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_R,
SUM(case when contract_type = 'S' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_S,
SUM(case when contract_type = 'S' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_S,
SUM(case when contract_type = 'T' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_T,
SUM(case when contract_type = 'T' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_T,
SUM(case when contract_type = 'U' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_U,
SUM(case when contract_type = 'U' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_U,
SUM(case when contract_type = 'V' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_V,
SUM(case when contract_type = 'V' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_V,
SUM(case when contract_type = 'Y' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_Y,
SUM(case when contract_type = 'Y' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_Y,
SUM(case when contract_type = 'Z' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then 1 else 0 end) TOTAL_CNT_Z,
SUM(case when contract_type = 'Z' and RPAD(TRIM(' ' from mod_num_ng), 6, '0') = '000000' then dollars_obligated else 0 end) TOTAL_AMT_Z
FROM contract_actions_dw
WHERE date_signed BETWEEN :P_DATE_SIGNED_START AND :P_DATE_SIGNED_END
&P_CRITERIA
GROUP BY component_name||' ( '||component_code||' )',agency_name||' ( '||agency_num||' )'

Similar Messages

  • Error while running awrrpt.sql for Automatic Workload Repository Report

    Hi
    I am trying to run awrrpt.sql.While running the query in sql*plus it ask me for file format then no of days
    & then begin & end snapshot Id & then eventually the sql*plus session get closed . I am unable find
    why sql*plus session getting closed automatically.Please tell me How to run awrrpt.sql to generate AWR reports. Please guide.

    1008032 wrote:
    Dear
    This is happen due to you are given the begin snap id and end snap id not between the shut down time .EX begin snap it at 12 am 1521 and you shut down at 12:30 am and you you give the 1:00 am snap id 1522 .That time system can not collect the statistics betwwn 1521 and 1522.
    Or you should enable statistics_level parameter if it 11gr2 you should enable controlfile_management_pack _access='DIAGNOSTIC+TUNING'
    issue not resolved please post your error..........
    Thanks&regards
    SS.vijaibabuI checked my statistics_level it shows value TYPICAL which I think is right.
    SQL> sho parameter statistics_level
    NAME TYPE VALUE
    statistics_level string TYPICALAlso I given snap id which between single startup & shutdown still the problem is same sqlplus session get closed after asking for snal ids.
    If error gets generated where it gets generated?

  • Reporting with Report Builder 3.0 and SQL Server 2008 R2

    Hi everyone
    I'm trying really hard to find books about Report Builder 3.0 or SQL Server 2008 R2
    I found the following books on the "learn" site, sadly they do not cover Report Builder 3.0 or SQL Server 2008 R2 since there all too old.
    Microsoft® SQL Server® 2008 Analysis Services Step by Step
    Microsoft® SQL Server® 2008 MDX Step by Step
    Microsoft® SQL Server® 2008 Reporting Services Step by Step
    What are good books (like the ones above) for the newest system?

    Hello wishmasterIN,
    Thank you to post your question on TechNet forum.
    Based on my experience, the books are always delayed to the new technology, since the author need time to summarize and analyze the new features in the new product or technology, write it down and publish it. If you want to have a quick learning about the
    new technology, MSDN library is a good place. It can be a cookbook for you. It contains some detail steps for tools, such as Report Builder or BIDS. It also contains many new features introduction. It is always very useful for you to understand the new features.
    In addition, it is based on web and many links make you can jump to the other technical point freely. The most important is all of these is free and all the information will be updated if the new feature is released.
    In short, if you want to learn the latest technology about Microsoft product, MSDN is a good choice. I hope my introduction is helpful to you.
    Regards,
    Edward
    Edward Zhu
    TechNet Community Support

  • Help with Sql for Annual Report per month

    Hi, I have been given the task to create an annual report by month that would show company's profits per month and totals in the last column to show which branch had the hightest income.
    Branch||January||February||March||April||May||June....||Total||     
    ABC ||$0.00 ||$0.00 ||$0.00||$0.00||$0.00||$0.00||Total Amt||
    DEF ||$18.01 ||$3.88 ||$18.01||$4.12||$18.01||$3.97||Total Amt||
    Can anyone please help me in giving an idea of how to write sql for this report..? I am building sub-queries for everymonth by giving the dates for Jan/Feb/March..but I think this is not the right way to do this....
    SELECT
    sum(a.commission) December,
    sum(b.commission) November
    FROM
    Select
    c.account_id,
    c.officer,
    c.account_product_class_id,
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.account_id=109 and
    c.status='APPROVED' and
    c.protection_effective between '01-DEC-2009' and '31-DEC-2009'
    Group by
    c.account_id,
    c.officer,
    c.account_product_class_id
    ) a,
    Select
    c.account_id,
    c.officer,
    c.account_product_class_id,
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.account_id=109 and
    c.status='APPROVED' and
    c.protection_effective between '01-NOV-2009' and '30-NOV-2009'
    Group by
    c.account_id,
    c.officer,
    c.account_product_class_id
    ) b
    I always have hight hope from this forum. So please help. Thanks in advance.
    Edited by: Aditi_Seth on Jan 26, 2010 2:29 PM

    You may try a group report on one simple query like:
    Select
    c.account_id, c.officer, to_char(c.protection_effective, 'MM') month
    sum(c.dp_monthly_premium) Commission
    From
    contract c
    Where
    c.status='APPROVED' and .....
    Group by
    c.account_id
    c.officer,
    to_char(c.protection_effective, 'MM')
    break/gropu on account_id, c.officer, to_char(c.protection_effective, 'MM') and total will be automatically calculated by Reports.

  • ORA-01489 Received Generating SQL for Report Region

    I am new to Apex and I am running into an issue with an report region I am puzzled by. Just a foreword, I'm sure this hack solution will get a good share of facepalms and chuckles from those with far more experience. I welcome suggestions and criticism that are helpful and edifying!
    I am on Apex 4.0.2.00.07 running on 10g, I believe R2.
    A little background, my customer has asked an Excel spreadsheet be converted into a database application. As part of the transition they would like an export from the database that is in the same format as the current spreadsheet. Because the column count in this export is dynmic based on the number of records in a specific table, I decided to create a temporary table for the export. The column names in this temp table are based on a "name" column from the same data table so I end up with columns named 'REC_NAME A', 'REC_NAME B', etc. (e.g. Alpha Record, Papa Record, Echo Record, X-Ray Record). The column count is currently ~350 for the spreadsheet version.
    Because the column count is so large and the column names are dynamic I've run into a host of challenges and errors creating this export. I am a contractor in a corporate environmentm, so making changes to the apex environment or installation is beyond my influence and really beyond what could be justified by this single requirement for this project. I have tried procedures and apex plug-ins for generating the file however the UTL_FILE package is not available to me. I am currently generating the SQL for the query in a function and returning it to the report region in a single column (the user will be doing a text-to-column conversion later). The data is successfully being generated, however, the sql for the headers is where I am stumped.
    At first I thought it was because I returned both queries as one and they were joined with a 'union all'. However, after looking closer, the SQL being returned for the headers is about +10K+ characters long. The SQL being returned for the data is about +14k+. As mentioned above, the data is being generated and exported, however when I generate the SQL for the headers I am receiving a report error with "ORA-01489: result of string concatenation is too long" in the file. I am puzzled why a shorter string is generating this message. I took the function from both pages and ran them in a SQL command prompt and both return their string values without errors.
    I'm hopeful that it's something obvious and noobish that I'm overlooking.
    here is the code:
    data SQL function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      l_ret := 'select ';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '|| to_char("'||rec.column_name||'")';
        else
            l_c := 1;
            l_ret := l_ret || ' to_char("' || rec.column_name || '")';
        end if;
      end loop;
        l_ret := l_ret || ' from ' || l_tbl;
      dbms_output.put_line(l_ret);
    end;header sql function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '||'''||rec.column_name||'''';
        else
            l_c := 1;
            l_ret := l_ret || '''' || rec.column_name || '''';
        end if;
      end loop;
        l_ret := l_ret || ' from dual';
      dbms_output.put_line(l_ret);
    end;-------
    EDIT: just a comment on the complexity of this export, each record in the back-end table adds 12 columns to my export table. Those 12 columns are coming from 5 different tables and are the product of a set of functions calculating or looking up their values. This is export is really a pivot table based on the records in another table.
    Edited by: nimda xinu on Mar 8, 2013 1:28 PM

    Thank you, Denes, for looking into my issue. I appreciate your time!
    It is unfortunately a business requirement. My customer has required that the data we are migrating to this app from a spreadsheet be exported in the same format, albeit temporarily. I still must meet the requirement. I'm working around the 350 columns by dumping everything into a single column, which is working for the data, however, the headers export is throwing the 01489 error. I did run into the error you posted in your reply. I attempted to work around it with the clob type but eneded up running into my string concatentation error again.
    I'm open to any suggestions at this point given that I have the data. I'm so close because the data is exporting, but because the columns are dynamic, the export does me little good without the headers to go along with it.

  • Query for recurring reports using Query Builder in Business objects

    1. How to count webi Recurring reports using query builder in business objects? (Need Query for this)
    2. How to count Crystal Recurring reports using query builder in business objects? (Need Query for this)
    I am able to get summerized recurring reports using Query Builder.
    For Example we have 343 reports which are under recurring (This includes both Webi Reports and Crystal Reports).
    we need to get individually how many webi reports are under Recurring and Crystal reports are under Recurring.

    1. How to count webi Recurring reports using query builder in business objects? (Need Query for this)
    2. How to count Crystal Recurring reports using query builder in business objects? (Need Query for this)
    I am able to get summerized recurring reports using Query Builder.
    For Example we have 343 reports which are under recurring (This includes both Webi Reports and Crystal Reports).
    we need to get individually how many webi reports are under Recurring and Crystal reports are under Recurring.

  • Edit SQL for Infoprovider report

    Hi,
    i have a small question, since i never interfaced the BO XI 3.1 with SAP BW. Can we edit the SQL for the webi report created on the SAP Infoprovider (say for example : InfoCube - cube1).
    Regards,
    Siva

    Hi Siva,
    No you can not!
    When you create a webi report based on a SAP BW cube there is no SQL generated, but an MDX statement. Currently it is not even possible to view the MDX statement on the BO side. You need to put a trace on it on the SAP BW side.
    Regards,
    Harry

  • How to see pure SQL for a Bex Report

    Hi All,
    I need to do troubleshooting on a report and I need to have the pure SQL code of the Bex report. Is there any easy way to get the SQL code for a bex report?
    I appreciate any help with points,
    Regards,

    Hi Mike.
    Try TA RSRT -> Execute and debug -> Display SQL/BIA query.
    Hope it helps.
    BR
    Stefan

  • SharePoint - Web Part - SQL Server Reporting Services Report Viewer Error.

    Hi,
    I was just having a bit of a fiddle with the differen't web-parts available to add on our local SharePoint site, and as one of my tasks is to have a report automatically open when the page is opened i thought i would try to add the web-part 'SQL Server Reporting
    Services Report Viewer' just to see the outcome.
    Now, I don't much care about viewing the report at this time, but imediately after trying to add the web part i am being displayed with an error and no matter how much i navigate away from the page or close the browser the particular link to the page i was
    trying to insert the web-part into now displays an error.
    The error simply says 'An unexpsected error has occured' with various 'Correlation ID:' each time.
    Now i have a link to other parts or subsites of that SharePoint site and they work just fine, it's just when i try to click on the page where i wanted to put the web-part in it
    still comes up with an error. This page just so happens to be the home page so it really does need to be fixed.
    Please help!?
    Many Thanks,
    Plain_Clueless

    Hi again,
    Sorry for the bother, We have now fixed the issue for the time being.. all that was needed was a simple '?contents=1' at the end of the url which takes you to a menu where you can delete the
    necessary web-part that was causing the trouble.
    As for actually implementing the report onto SharePoint.. in future i will make Dev pages instead.. and it seems i may need to contact the admin side of building so they configure 'SQL Reporting 
    Services Report Viewer' properly.
    Thanks a lot though!
    - A little less Plain_Clueless
    Plain_Clueless

  • Error 403 when editing report in report builder

    Hey Guys,
    I have a weird issue with the SSRS (Sharepoint Server Reporting Services), which I find very undocumented hence not so easy to implement in a multi-server farm.
    Anyway, I have a very small 2 servers SP farm running SP2013 Enterprise and Project Server 2013. In the backend I have a SQL2012 and all SP DBs are in an alwayson availibility group. Both SP servers are exactly identical in terms of roles and setup. The
    SQL SP reporting add-in has been installed on both servers.
    I created my SSRS service app and all is running fine to view reports; but when I try to edit a report in report builder it works on server1 and fails with a 403 on server2 (I'm of course logged in with the same account on both servers). I have no idea why
    one server givs me this 403 and since all this is new to me I'm a bit lost and not sure how to start troublshooting the issue.
    Would you have an idea what could cause this behavior ?

    Hi,
    Based on my research, there are many factors can cause this issue. For more details, we can refer to the following possible causes:
    Some configuration did not configure well. Open the Reporting Services Configuration Manager to check all the configuration, see
    http://msdn.microsoft.com/en-us/library/aa337424(v=sql.110).aspx on Reporting Services Tools.
    In the reporting services configuration manager tool, rebuild the virtual directory of report manager/report server.
    If the report server enables SSL, recreate a certificate and then rebind it to report server.
    It may resulted in config file of the report server / service.
    changing the AuthyenticatonTypes to RSWindowsNTLM in the report server config file.
    Besides, the issue can also be caused by the web.config for the SharePoint site was not correctly modified by the Reporting Services Add-in for SharePoint. For more details, please see the following posts:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a8a66827-0995-4f87-bcae-f7750fa5d3fa/error-client-rendering-the-remote-server-returned-an-error-403-forbidden?forum=sqlreportingservices
    http://www.sqlservercentral.com/Forums/Topic780464-150-1.aspx#top
    Hope this helps.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • SQL report shoring report total - how to disable it

    Hi,
    I am using a report of type "SQL report" to show monthly revenues by year... Report is showing total for individual years... my issue is that Report is also showing a grand total for all years (report total)... may I know how to get rid of report total

    You could build your query to produce the subtotals using a rollup and then NOT have to have the report do totaling..
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Error while opening a report in report Builder

    Hello experts,
    My oracle apps version is R12.1.3
    I am getting an error message when opening a report in report builder.
    Warning : Opening a report saved with a newer version of Reports Builder.
    Functionality may be lost. Continue??
    What should i do now?? Please suggest.
    Thanks,
    Atul

    Hello,
    Sorry for late reply.
    Report Builder 9.0.4.0.3
    Oracle application Relese 12
    and database versin: is Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    plesae update the thread as soon as possible.
    After opening a report in Oracle Apps its open is different language. what could be the workaround for this..
    Do i need to change any langauge setting?
    Thanks
    Atul

  • Unable to insert sql server reporting services report viewer webpart

    Hello,
    We are trying to add a SQL Server Reporting Services Report Viewer and when we click add we get the following error message
    The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML.
    Does anyone know what the fix to this is?

    Hi,
    The Report Viewer Web Part is a custom Web Part that is installed by the Reporting Services Add-in for SharePoint Products and associated with report definition (.rdl) files that are processed by a Microsoft SQL Server Reporting Services report
    server.
    To install the Web Part, you must run Setup for the Reporting Services Add-in. You should not install or uninstall the Web Part independently. It is part of the add-in and can only be installed through the add-in setup package. The Report Viewer Web Part
    file name is ReportViewer.dwp. It is located in the Program Files\Common Files\Microsoft Shared\web server extensions\15\template\features\reportserver folder and should not be moved to other folders.
    To use the Web Part, you must have installed and configured the Reporting Services Add-in and configured the report server for SharePoint integration.
    For more information,you can have a look at the blog:
    http://msdn.microsoft.com/en-us/library/jj219068.aspx
    http://msdn.microsoft.com/en-us/library/aa905871.aspx
    http://msdn.microsoft.com/en-us/library/bb522800.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Whts the corresponding BW report for AP Liability Reconciliation report?

    HI All,
    Whts the corresponding BW report for AP Liability Reconciliation report?
    R/3 report is: S_ALR_87012082 u2013 provides vendor balances that make this up.
    Whts the BW report for validating the R/3 data.
    Please Reply.
    Thansk in Advance.

    Hi,
         Yes, I was getting partial results. I got rid of it by unchecking the the options in the 'SQL' tab in the Universe parameters.
         Thanks for the help.
    Regards,
    Alok.

  • First time an SQL expression is placed on report a DB SELECT executes

    The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue). I'm using CR XI.
    Symptom:
    We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
    Some Detective Work/More Info:
    After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
    Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
    Steps to re-create:
    1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
    2. Add a new "SQL Expression" to your report.
    3. Drag and Drop your new "SQL Expression onto your report
    4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
    The Problem:
    I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
    Questions:
    Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
    Anybody else notice this and have a "work around"?

    This is a cross post of:
    1st time an SQL expression is placed on report a DB SELECT executes
    Please do not cross post. See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
    The above post has been moved to the Crystal Reports Design forum, thus locking this thread.
    Ludek

Maybe you are looking for