SubReports

Hello,
I am trying to run two subreports on one report page. Each one subreport on one side of the paper such that data is printed on both the left and right sides of the paper.
Hence for one subreport I have
SELECT * FROM DBO.OHEM WHERE  (dbo.OHEM.empID % 2 = 0)
and for the other I have
SELECT * FROM DBO.OHEM WHERE  (dbo.OHEM.empID % 2 = 1)
Hence I should have employees with even numbers on one side and odd numbers olan another. However I get the problem where the first page is completely blank, and I have 66 pages. There are 66 employee in the OHEM master data. How do I resolve this error. I pass the two parameters month and year to filter information.
Kind Regards,

Hi Marco,
Try this, sample
SELECT *
FROM
(SELECT * FROM OHEM T0 WHERE T0.empID % 2 = '0'
UNION ALL
(SELECT * FROM OHEM T0 WHERE T0.empID % 2 = '1')a
Check the thread(UNION ALL - Sample Query)
Re: Detailed , POs after GRPO -Balance Qty Query
Regards,
Madhan.

Similar Messages

  • Not having to refresh the data in the main report but only in the subreport

    Hi SAP,
    I have a report that uses a stored procedure in the main report and uses regular database tables in the subreport.  The data returned from the stored procedure reports information from the month-end database (a cutoff point from the previous month's numbers) while the subreport reports information from the live database.  This report gets run everyday to show the changes in numbers from the live database.  Obviously the numbers from the month-end database remainds static until the next month's cutoff database is created. 
    My problem is that everyday when I run the report, the data needs to refresh from both the stored procedure in the main report and the live database tables in the subreport.  How can I leave the data returned from the stored procedure static or as is without refreshing the stored procedure returned data and just have the subreport data refresh itself?  The stored procedure really puts a strain on the database and I would like to cut-out the time to process the report as well.  Does anyone have any ideas?
    Zack

    Hi Zack,
    Try the following under Report options.
    1. Clear the check box of "Verify Stored Procedures on First Refresh" in the Main report.
    2. Select the check box of "Verify on First Refresh" in  the sub report.
    Hope this helps.

  • Refreshing subreport data on change of group in the main report

    I have created three comma delimited strings in a subreports and then introduced them to the main report. The subreports are simple with no groups. I have one subreport for Authors, one for Departments and one for Schools. This is ok if I filter the data down to one publication. If I remove the filter then I get every instance of each of the subreports. ie all authors in a comma delimited string, all departments and all schools.
    I have two groups in the main report, Publication Year (Group #1) and Publication Title (Group #2). This is where I have the problem. The data coming from the subreports show all instances as mentioned above. I want the subreports data to refresh each time the group changes. I need it to only show the necessary comma delimited string for each publication, not every instance.

    Hi Abhilash,
    The logic has worked correctly but the performance is really poor. Is this because I have there subreports doing similar funcitons? Is this a topic for another discussion?
    Also, when I try to export the report to xls data only it starts the export but then a msg comes up on the screen relating to the second formula you gave me for comma delimited strings for schools:
    SAP Crystal Reports
    String length is less than 0 or not an integer.
    This relates to the third line in the code:
    Left(schools, len(schools)-2);
    It then aborts the export. Is this a topic for another discussion also?
    Thanks

  • Can you view Subreports in Crystal Viewer 2008

    I've created a report in Crystal Reports XI that also included two subreports.
    When I open it up in Crystal Viewer 2008 I'm not sure how to view the subreports.
    Any ideas?
    Thanks.

    In Crystal Viewer you cannot refresh the report. You can refresh only when you are opening the report from server. So if your report consist of any on demand subreports it refreshes only when you click on the link. So I thikn on-demand subreport do not work in crystal viewer.
    Regards,
    Raghavendra

  • How to develp a subreport in the same page of the main report and processed when is called

    SSRS 2012
    Hi guys,
    I am developing a report that includes a subreport.
    therefore The report is made up by 2 sections:
    1) Show a grid (several rows - may be 100 or more - and some columns). It represent high level info  (Each row represent a specific item)
    2) The user click on a Row/column (eg: Item1, to see details that must be shown as graph.
    Here the problem: Searching info about SSRS reporting for subreports, drilldown, nested report and so on, no ones accomplish the requirements for the following reasons:
    1) Subreports: NOT open in the same page. The user must <go back> to see detail for other items, such as Item 2....
    2) Nested and DrillDown: Process data as the Main report (they are hidden and displayed after user action). In my case this leads to performance problem, because: if the main report has 200 objects (it means 200 graphs processed and hidden at the same time
    for the main reports).
    3) DrillThrough and Subreport: The detail data are processed only when the user select the interested item in the main report. Here the problem: the report is shown externally.
    Please, it there any possibility to have a subreport (or anything else) to be executed in the same report as the main report and processed only when the user make action?
    Thanks for your help.

    Hi Fasttrack2,
    According to your description, there is a main report with more than 100 rows of summary information, when users click the item of the row, the report need to jump to detail information shows as graph. The problem you are facing is that you are not sure
    subreport, drilldown or drillthrough report should be used? You hope to set display detail information in the main report and keep high performance of report.
    In Reporting Services, each subreport instance is a separate query execution and a separate report processing task. Subreports are recommended when there are just a few subreport instances. We should not use subreports inside a group when there are many
    group instances, instead, consider using drillthrough reports. Drilldown reports process all data even when the data is first hidden. In order to improve the performance of the report, we can split drilldown reports into parameterized drillthrough reports,
    because Drillthrough reports do not run until a user clicks the drillthrough link in the main report.
    In this case, we can consider using drilldown or drillthrough report. In drilldown report, when we click a plus or minus button to expand or collapse a section of a report, the detail data will be displayed in place. By using drillthrough report, when we
    click the link in the main report, the detail data will be displayed, we can come back to the main report by click return button in the drillthrough report.
    Reference:
    Troubleshooting Reports: Report Performance
    Drillthrough, Drilldown, Subreports, and Nested Data Regions
    If you have any more questions, please feel free to ask.
    Best Regards,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Urgent help required - linked subreport keeps asking for parameter value

    Greetings,
    I have developed a report in the Crystal Reports bundled with Visual Studio 2005. The data is obtained from a stored procedure. One of the fields in the result set is named "Id".
    I have embedded a subreport in the details row of the main report. The subreport also gets its information from a stored procedure. This stored procedure has one parameter named "OpportunityId". This field is linked to the field named "Id" above. the subreport has been set to supress blank subreports.
    In the development environment and running the executable of the application on the development machine the report works perfectly. The subreport displays as it should and all is well.
    When I deploy the report onto user machines where they have the crystal runtime installed, the report keeps asking for a parameter value for the subreport.
    I cannot get this to stop happening.
    This report is urgently required. PLEASE could someone help me out here.
    I am at my wits end.
    I have attached a zipe file containing the following:
    - the two stored procedure
    - the rpt file
    - a sample report
    - a screen showing the report having just been generated
    Thanks in advance,
    Robert Lancaster

    <p>Hi Robert,</p><p>I see your report template and stored procedures. All seems to be ok. <br /></p><p>The most important is to assign the report parameters for all linked subreports (only one in your case).</p><p> </p><p>Try this (in C#, in VB.NET the code are very similary): </p><p>ReportDocument report = new ReportDocument(@"TopFortyReport.rpt");</p><p>AssignParameters(report, paramCollection);</p><p>// and now assign parameters to all linked subreports </p><p>foreach( CrystalDecisions.CrystalReports.Engine.Section section in report.ReportDefinition.Sections)</p><p>{</p><p>    foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)<br />    {</p><p>        if (reportObject.Kind == ReportObjectKind.SubreportObject) </p><p>        {</p><p>            SubreportObject subReport = (SubreportObject)reportObject;</p><p>            ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);                                               AssignParameters(subDocument, paramsCollection);</p><p>        }</p><p>} </p><p> </p><p>void AssignParameters(ReportDocument report, object[] paramsCollection)</p><p>{</p><p>    int nParams = paramsCollection.Length;</p><p>    for (int iParamIndex = 0; iParamIndex < nParams; iParamIndex++)</p><p>    {</p><p>        if (report.DataDefinition.ParameterFields[iParamIndex].IsLinked())</p><p>            continue;</p><p>        report.SetParameterValue(iParamIndex, paramsCollection[iParamIndex]);</p><p>    }</p><p>}</p><p> </p><p> </p>

  • Shared DateVar in Subreport and datediff calculation in Main Report?

    Hello experts,
    I am using CRXI sp2.  I have a report that contains two subreports for different dates in the same date field that are identified by a Service Code.  The subreports have been placed in the same group footer 1a to be displayed and the calculation resides in the main report group footer 1b.  The shared variables are as follows:
    whileprintingrecords;
    shared datevar Codedate5473;
    Codedate5473:={@Codedate5473};
    and
    whileprintingrecords;
    shared Datevar Codedate5623;
    Codedate5623:={@Codedate5623}
    The main report has the following calculation is in group footer 1a.
    Whileprintingrecords;
    Shared numbervar daysbetween;
    if (isnull({@Shared 5623})or isnull({@Shared 5473})) then 0
    else daysbetween:= datediff("d",{@Shared 5623},{@Shared 5473})
    This returns negative numbers as well as calculations where one of the shared variables is null.
    I reset the calculation in the report header as well.
    Thanks for your help in advance.
    Kevin

    Hi Kevin,
    I can reproduce your issue, As per my knowledge the crystal will make some issues in null value computation as well as  shared variable  computation
    In your report i can see , you tried to access values from subreport to main report through shared variable. that will make problem. we can access values from main report to subreport without any issue using shared..dont ask me the reason..i am not the right person to say that... lol.
    The another wrong thing  i was found in your formula is , you are not resetting the shared variable any where.. so once the date field is null, the shared variable returning the previous value.
    So this is the solution for you..
    1,You have to add one more subreport for displaying your result., Lets say 'Sub report3'
    and create a formula, like.(Same which you have write before for the result)
    shared datevar Codedate5473;
    shared Datevar Codedate5623;
    numbervar daysbetween;
    WhilePrintingRecords;
    daysbetween:= datediff("d",Codedate5473,Codedate5623);
    daysbetween;
    2, Re- write your first two formulas like this
    For Subreport1,
    WhilePrintingRecords;
    shared dateVar Codedate5473;
    if isnull({Codedate5473}) then
    Codedate5473:=date(0,0,0)
    else
    Codedate5473:=date({Codedate5473});
    For subreport2
    WhilePrintingRecords;
    shared dateVar Codedate5623;
    if isnull({Codedate5623}) then
    Codedate5623:=date(0,0,0)
    else
    Codedate5623:=date({Codedate5623});
    Hope this will works for you,
    Cheers,
    Salah.
    Edited by: salahudheen muhammed on Aug 7, 2009 1:05 PM

  • JRC (upg. to CR4E) - Report w Subreport - Oracle DB -  Null Pointer Excepti

    Hi
    We have a Crystal Designer/Developer Version 11.5.10.1263. We develop reports using this.
    Most of the reports have SQL Command mode design with JNDI/JDBC connection. It gets deployed with our Web application. And during runtime, when users access these reports from our web application, we typically use Java Reporting Component with Crystal Report Viewer SDK to open and display the report to the user.
    Besides other issues, current problem I am having is:
    I have a sub-report in my report. I am connecting to Oracle database. If this sub-report does not return any rows, I was getting a Null Pointer Exception. This seems to be a known bug. This happened to us when we had just the above mentioned components.
    We recently upgraded just the JAR libraries to the ones packaged in CR4E (Crystal Reports For Eclipse) - initially to get more exporting capability.This upgrade gets us past the Null Pointer Exception issue.
    Now, I am getting an error like "Unexpected database connector error". Please see the exception stack trace below if needed. Since we are a product and this display is specific to one out of about 100 different clients; with all the time we spent on making this report stuff work against this oracle DB client, we had finally ended up creating the display in JSP into our general product just for one of about 100 clients. Client must be the Lucky one...As a developer, I felt really frustrated.
    One note:- SQL Server DB works perfect.
    Other thing - Do we need to change any API calls after upgrading the JARS from standard JRC/Viewer to CR4E package?
    11:46:57,540 INFO  [STDOUT] 11:46:57,540 ERROR [JRCCommunicationAdapter]  detected an exception: Unexpected database connector error
         at com.crystaldecisions.reports.datafoundation.DFQuery.for(SourceFile:632)
         at com.crystaldecisions.reports.datalayer.a.do(SourceFile:1621)
         at com.crystaldecisions.reports.datalayer.a.a(SourceFile:1404)
         at com.crystaldecisions.reports.dataengine.m.b(SourceFile:334)
         at com.crystaldecisions.reports.dataengine.j.b(SourceFile:515)
         at com.crystaldecisions.reports.dataengine.m.o(SourceFile:408)
         at com.crystaldecisions.reports.dataengine.m.a(SourceFile:173)
         at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:114)
         at com.crystaldecisions.reports.dataengine.ContextNode.a(SourceFile:95)
         at com.crystaldecisions.reports.dataengine.j.case(SourceFile:1080)
         at com.crystaldecisions.reports.dataengine.h.<init>(SourceFile:108)
         at com.crystaldecisions.reports.dataengine.DataContext.a(SourceFile:254)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4660)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:4574)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.new(SourceFile:2652)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.byte(SourceFile:2610)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.try(SourceFile:2282)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.int(SourceFile:2442)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.I(SourceFile:1013)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.if(SourceFile:4816)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:2020)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:309)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:250)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.a(SourceFile:922)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.e(SourceFile:784)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.for(SourceFile:242)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:243)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:210)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.v.a(SourceFile:185)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.v.a(SourceFile:230)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:359)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:133)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ColumnFormatter.for(SourceFile:120)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:511)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:452)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.a(SourceFile:369)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ah.a(SourceFile:72)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ReportColumnFormatter.a(SourceFile:86)
         at com.crystaldecisions.reports.formatter.formatter.paginator.SinglePageFormatter.a(SourceFile:332)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:359)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ai.for(SourceFile:133)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.ColumnFormatter.for(SourceFile:120)
         at com.crystaldecisions.reports.formatter.formatter.paginator.SinglePageFormatter.for(SourceFile:177)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
         at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.do(SourceFile:737)
         at com.crystaldecisions.reports.formatter.formatter.paginator.PageFormatter.formatPage(SourceFile:236)
         at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.byte(SourceFile:219)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1909)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)
         at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
         at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(SourceFile:767)
         at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(SourceFile:324)
         at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.getPage(SourceFile:149)
         at com.businessobjects.report.web.event.s.a(SourceFile:158)
         at com.businessobjects.report.web.event.s.a(SourceFile:127)
         at com.businessobjects.report.web.event.bt.a(SourceFile:47)
         at com.businessobjects.report.web.event.bw.broadcast(SourceFile:93)
         at com.businessobjects.report.web.event.am.a(SourceFile:53)
         at com.businessobjects.report.web.a.t.if(SourceFile:2104)
         at com.businessobjects.report.web.e.a(SourceFile:300)
         at com.businessobjects.report.web.e.a(SourceFile:202)
         at com.businessobjects.report.web.e.a(SourceFile:135)
         at com.crystaldecisions.report.web.ServerControl.a(SourceFile:607)
         at com.crystaldecisions.report.web.ServerControl.processHttpRequest(SourceFile:342)
         at org.apache.jsp.ipalHistoryReportViewer_jsp._jspService(org.apache.jsp.ipalHistoryReportViewer_jsp:201)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.Standar
    11:46:57,540 INFO  [STDOUT] dEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    11:46:57,634 INFO  [STDOUT]  CustomReports - finally Calling CrystalReportViewer dispose ...

    I have exactly the same problem. Had posted it on the forum last week, but haven't received any response yet. I just file a single support case ($195) with SAP.  If I hear anything useful back, will keep you posted. Please let me know if you are able to resolve the problem.
    In my case, I can get my report to work with a single subreport.  When I put multiple subreports, I get the same error as you are currently getting.
    Check if your report has any special section formatting (conditional suppression etc).  Try to remove those to see if it helps at all.

  • How to pass database logon info to a Crystal Report in a subreport with different server name using VS C #

    Post Author: fabu1971
    CA Forum: .NET
    I could pass the database logon in Reports with subreports but the reports with subreports with different  server name I can not pass the logon information . Do you have any idea how I can do that to pass the database logon with different database or server name ?

    Post Author: quafto
    CA Forum: .NET
    You can use the Subreports collection of the ReportDocument object to access all the subreports in your main report. These are returned as ReportDocument objects. Once you have your subreport as a ReportDocument you can loop through your Tables collection and set the ConnectionProperties to your appropriate Server/Database. For example here is some pseudo code: ConnectionInfo boConnectionInfo = new ConnectionInfo();boConnectionInfo.ServerName = "serverName";boConnectionInfo.DatabaseName = "databaseName";boConnectionInfo.UserID = "username";boConnectionInfo.Password = "yourpassword"; foreach(ReportDocument boSubreport in mainReport.Subreports){    foreach(Table boTable in boSubreport.Database.Tables)    {        TableLogOnInfo boTableLogOnInfo = boTable.LogOnInfo;          boTableLogOnInfo.ConnectionInfo = boConnectionInfo;          boTable.ApplyLogOnInfo(boTableLogOnInfo);          boTable.Location = "newtablelocation";     }}

  • Slow performance refreshing report with multiple subreports in main report

    I am using multiple subreports in my main report that appear to be slowing down the performance of the report considerably. Is there something I can do to increase performance with subreports.

    Hi Brian,
    Subreports are a known performance hog.
    I would suggest going back to the drawing board and rethinking on the layout of the report. The best thing, of course, would be to completely get rid of the subreports by creating a single SQL statement that takes care of all the report's requirements.
    Sometimes it is imperative to have subreports, in which case, you should try to make sure any selection filters from both the Main Report and the Subreport are passed back to the database.
    Also, avoid using Page N of M for better performance - with or without Subreports.
    -Abhilash

  • Controlling execution of subreport on main Report in ssrs 2008 R2

    Controlling execution of subreport on main Report in ssrs
    Hi,
    Am using more than 100 subreports in my main report using ssrs 2008 R2.
    And given conditional Visibility in sub reports based on the Parameter selection in main Report . But the performance is very very slow in main report.
    While selecting single sub report executes in seconds. The same report in main report executes in hours.
    According to my view,
    All the Sub reports executes and finally conditional visibility is working. Can we Control executing sub reports?
    Regards, Gayathri devi P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

    Hi,
    I think the time to render 100 report sure will be long time and the main report want to render those reports.
    So first why you do not separate those report on many reports for different purpose.
    second if this is a dashboard report you may use many matrix in the same report and the parameters passed by default or based on expression.
    I really hope if you make your report as dashboard report, many matrix many parameters render it once. As I remember I think SSRS will try to execute your
    DataSets in parallel which will reduce your waiting time.
    I hope this is helpful.
    Elmozamil Elamir
    MyBlog
    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    http://elmozamil.blogspot.com

  • Set value for subreport on load or current-to prevent dispalying "#Error"

    I've got a Work Orders Report which I use to Print Production Copies for Operators.  This report uses a subreport to pass information about Purchase Orders to the Report and then I use "=[Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![SIZE]"
    to display the information in text boxes on my main report.  The problem is that sometimes customers supply their own raw material and there is no Purchase Order record, this causes "#Error" to be displayed in my text boxes, which can be confusing.
     I've got a "Customer Supplied Checkbox" to denote that the customer is supplying their own material.  So I'm trying to use an OnLoad event to set these values to an empty string, but I can't quite get it correct.  This is what I've
    been trying so far, where am I going wrong?  
    js
    Private Sub Report_Load()
    If Me.CustSupplied Is true Then
    [Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![Size] = ""
    End If
    End Sub

    I've got a Work Orders Report which I use to Print Production Copies for Operators.  This report uses a subreport to pass information about Purchase Orders to the Report and then I use "=[Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![SIZE]"
    to display the information in text boxes on my main report.  The problem is that sometimes customers supply their own raw material and there is no Purchase Order record, this causes "#Error" to be displayed in my text boxes, which can be confusing.
     I've got a "Customer Supplied Checkbox" to denote that the customer is supplying their own material.  So I'm trying to use an OnLoad event to set these values to an empty string, but I can't quite get it correct.  This is what I've
    been trying so far, where am I going wrong?  
    js
    Private Sub Report_Load()
    If Me.CustSupplied Is true Then
    [Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![Size] = ""
    End If
    End Sub
    Hi jswan,
    If you say:   "=[Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![SIZE]" to display the information in text boxes on my main report
    then the text box GETS the information form the control SIZE.
    In your case you can better use:
    Private Sub Report_Load()
    If Me.CustSupplied Is true Then
    <text box> = ""
    Else
    <text box> = [Reports]![WORK ORDERS REPORT]![AssociaterQuery subreport]![Size]
    End If
    End Sub
    Substitute for <text box> the real name of the text box.
    Imb.

  • Dynamically Set Subreport Background Color to the Same Value as Main Report Background Color

    I have a report that contains a subreport.  The main report has groupings in it.  I am dynamically setting the background color of the group rows based on an expression.  That part is working fine.  The problem that I am having is that
    I don't know how to get the subreport to "inherit" the background color of the grouping that holds it.
    Basically, I have different row shadings on my report differentiating the groupings except for the rows where the subreport shows.
    How do I go about setting the subreport background color to equal it's contaiing grouping's background color?  Thanks in advance for any and all assistance provided.

    The parameter method given by gpshukla will send the info to the subreport, but you don't need the color parameter in the main report, only the subreport. The trick is in setting the value of that parameter.
    Right-click the cell with the embedded subreport, you can select subreport properties.
    Select Parameters and add a parameter.
    The name column is the name of the parameter in the subreport (color) and value is the value to set it to.
    Set name to "color" (no quotes).
    Set Value to the same expression used to set the background color for the row.
    In the subreport, click the design surface to select the report (not header or footer).
    In the properties pane, select background color and choose expression from the dropdown.
    Type =Parameters!color.Value into the expression builder.
    This will work assuming that background color in the main report row will not change without also refreshing the subreport.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Report with Subreport - Summary Table On First or Last Page

    Post Author: andbort
    CA Forum: General
    All-
    My apologies in advance for the long post. I would like to know if something can be done in a single report instead of having to spread it across two reports. I will use generic (Xtreme sample database) field names to explain my dilemma. I currently have the following report:
    Main Report
    Customer ID, Customer Name
    Subreport
    Order ID, Order Amount, Customer ID
    Each Customer and its associated subreport are displayed on a separate page. So it looks like this:
    (first page)
    1 City Cyclists
    100    $200    1
    101    $5000  1
    102    $350    1
    (second page)
    2 Pathfinders
    103    $760    2
    104    $20      2
    (third page)
    3 Bike-A-Holics Anonymous
    105    $120    3
    106    $270    3
    107    $400    3
    And so on. This report often has numerous customers (i.e. ~10 or more customers, thus ~10 or more pages). The business users would like to have a "summary" page at the beginning of the report. This summary page would be in basic tabular format, with one row per customer, but each row would contain values from the subreport. So the updated report would look like this:
    (first page)
    Customer ID       Customer Name                        Most Recent Order Amount
    1                       City Cyclists                             $350
    2                        Pathfinders                              $20
    3                        Bike-A-Holics Anonymous        $400
    (second page)
    1 City Cyclists
    100    $200    1
    101    $5000  1
    102    $350    1
    (third page)
    2 Pathfinders
    103    $760    2
    104    $20      2
    (fourth page)
    3 Bike-A-Holics Anonymous
    105    $120    3
    106    $270    3
    107    $400    3
    Is this possible in Crystal Reports 10?
    Additional Background: The application in question is ASP.Net 1.1 (Visual Studio 2003) which displays reports designed in Crystal Reports 10. The actual report displays customer records in the detail section Da. There are 5 subreports, one in each section Da, Db, Dc, Dd, and De. The summary page could be rendered either at the beginning of the report (e.g. report header) or at the end (e.g. report footer), but will ultimately need to contain Customer table field values, as well as field values from two of the five subreports. I am hoping that this requirement can be addressed in a single report, instead of having to spread it across two reports (each displayed in its own CrystaReportViewer control on the web page). I am assuming that a solution to the generic example above will be applicable to my specific report.
    Thanks,
    Andrew Bort
    National Grid
    [email protected]

    Post Author: Guy
    CA Forum: General
    Hi,
    If I understand you correctly, you could simply use a crosstab at the begginning of your report to summarize all customers.  If you put it alone in its section you'll be able to specify that you want a page break after.
    The remaining of the report should be a simple report where you group on your customer and the detail line showing a sale.
    finally, if I was wrong above and you still need subreports, you can use a shared variable (or a parameter) to allow the main report to receive the total from the subreport.
    Good luck!

  • Need to call subreport by passing proper value

    Hi
    from my SQL query i am geeting below result.
    Cust_Num   SalesOrder_num
    1                  S001,S002,S003
    2                  S004,S005,S006   
    Report Output
    Customer             Sales Order
    1                            S001
    S002
                                  S003
    when i click S001 subreport should open with related sale order S001 details.
    please let me know how to do this
    Regards
    vitthal

    Hi vitthal,
    According to your description, you want to execute a click event on the Sales Order, then it will open up another report which show the detail information correspond to the Sales Order. In Reporting Service, as Visakh suggested, we can add an action to jump
    into another report with detail information to achieve your requirement. For more details, we can refer to the following steps (supposing there is field called Sales in the second report):
    Create a parameter named Sales in the second report.
    Add a filter as follows to the dataset:
    Expression: [Sales]             Operator: =              Value:[@Sales]
    Drag the related field to the design surface in the second report.
    In the main report, right-click the cell contains [Sales_Order] field to open the Text Box Properties dialog box, select Action in the left pane.
    Enable the Go to report action, and select the second report name in the drop-down list of Specify a report.
    Add a parameter as follows to run the report.
    Name: Sales                         Value: [Sales_Order]
    The following screenshot is for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Crystal Report performance - subreports or sql command?

    Hello,
    bit of quandary, I've an existing report that contains six subreports all sharing the same parameter to the main report, a 'projectID' field.
    The main report approximately returns 300 records/projects and each of the 6 subreports are passed the corresponding 'projectID' field 300 times.
    Now, I've succesfully incorporated the main report query and corresponding subreports into a TSQL command containing a number of subqueries in the Select clause:
    SELECT   PROJECT.PROJECTID, PROJECT.TITLE, PROJECT.REFERENCE, PROJECTSTATUS.PROJECTSTATUS, PROJECT.INPUT_DATE
    ,(SELECT max(INPUT_DATE) FROM V_PROJECT_NOTE AS VPN
    WHERE PROJECT.PROJECTID = VPN.PROJECTID) AS LastHeadline
    ,(SELECT
    MAX(CASE
         WHEN MODIFIED_DATE IS NULL THEN INPUT_DATE
         WHEN INPUT_DATE > MODIFIED_DATE THEN INPUT_DATE
              ELSE MODIFIED_DATE
    END) FROM ISSUE WHERE PROJECT.PROJECTID = ISSUE.PROJECTID) AS LastNewIssue
    ,(SELECT max(ISSUENOTE.INPUT_DATE) FROM ISSUE
    INNER JOIN ISSUENOTE ON ISSUE.ISSUEID = ISSUENOTE.ISSUEID
    WHERE PROJECT.PROJECTID = ISSUE.PROJECTID ) AS LastIssueNote 
    ,(SELECT max(modified_date) FROM V_PROJECT_RISK_LAST_AMMENDED AS VPR
    WHERE PROJECT.PROJECTID = VPR.PROJECTID) AS LastRiskLogUpdate
    ,(SELECT max(INPUT_DATE) FROM PROJECT_CHECKLIST AS PC
    WHERE PROJECT.PROJECTID = PC.PROJECTID) AS LastChecklistUpdate
    ,(SELECT max(input_date) FROM V_PROJECT_ACTIVITY_LAST_AMMENDED AS VPA
    WHERE PROJECT.PROJECTID = VPA.PROJECTID) AS LastGANTTUpdate 
    ,V_PROJECT_KEYCONTACT.USERNAME AS KeyContact
    ,(SELECT     USERPROFILE.USERNAME AS Supervisor
    FROM         USERPROFILE INNER JOIN
                          PROJECT_MEMBER AS SUPERVISOR ON USERPROFILE.USERID = SUPERVISOR.USERID RIGHT OUTER JOIN
                          PROJECT_MEMBER AS KEYCONTACT ON SUPERVISOR.PROJECT_MEMBERID = KEYCONTACT.PARENTID
    WHERE PROJECT.PROJECTID = KEYCONTACT.PROJECTID
    AND KEYCONTACT.KEY_CONTACT =1) AS Supervisor
    FROM         PROJECT INNER JOIN
                          PROJECTSTATUS ON PROJECT.PROJECTSTATUSID = PROJECTSTATUS.PROJECTSTATUSID LEFT OUTER JOIN
                          V_PROJECT_KEYCONTACT ON PROJECT.PROJECTID = V_PROJECT_KEYCONTACT.PROJECTID
    WHERE V_PROJECT_KEYCONTACT.USERNAME IN ('aaa','bbb','ccc')
    AND (PROJECTSTATUS.PROJECTSTATUS IN ('111', '222', '333'))
    AND ((PROJECT.TITLE NOT LIKE 'xxx%') AND (PROJECT.TITLE NOT LIKE 'yyy%') AND (PROJECT.TITLE NOT LIKE 'zzz%'))
    ORDER BY V_PROJECT_KEYCONTACT.USERNAME, PROJECT.INPUT_DATE
    Now, I've run both SQL Server Profiler and looked at the Performance Information in Crystal and the SQL command method is an order of magnitude less efficient!!
    I may have to post my query on a TSQL forum but was wondering if anyone on here can possible shed any light on it?
    Thanks in advance,
    Dom

    Dom,
    I assume that the last edit was to remove a few curse words...
    The reality is that we can give a good explanation as to why the sub-report version would execute faster that the command version w/o seeing the report (with the sub-reports included).
    Looking at the SQL, I can tell that it's a fairly expensive query, firing several sub-queries for every row returned by the outer query. That said, I sounds like the same thing is taking place with the sub-report version too... So I would think that the performance would be similar.
    The only thing that I can think of, and this is just a guess... With the sub-report version, each all queries are being run independently and then combined locally by CR, whereas the command version, everything is combined. The more complex the query, the harder the optimizer has to work to come up with the best execution plan... and the greater the likelihood that that the resulting plan isn't as optimized as it could be.
    That said, I'd still think the command version would be faster over all. Are you seeing real differences between the two reports, in the amount of time that it takes from refresh to final render?
    Either way, I think moving all of those sub-queries from the select list (where they are executing once for every row) down to the FROM area (where they only have to execute once) should increase the speed dramatically and surpass the sub-report version by a decent margin.
    Give this version of your SQL a test drive and see if it yields an improvement.
    SELECT  
    PROJECT.PROJECTID,
    PROJECT.TITLE,
    PROJECT.REFERENCE,
    PROJECTSTATUS.PROJECTSTATUS,
    PROJECT.INPUT_DATE,
    VPN.LastHeadline,
    ISSUE.LastNewIssue,
    ISSUE_NOTE.LastIssueNote,
    VPR.LastRiskLogUpdate,
    PC.LastChecklistUpdate,
    VPA.LastGANTTUpdate,
    V_PROJECT_KEYCONTACT.USERNAME AS KeyContact,
    Supervisor.Supervisor
    FROM PROJECT
    INNER JOIN PROJECTSTATUS ON PROJECT.PROJECTSTATUSID = PROJECTSTATUS.PROJECTSTATUSID
    LEFT OUTER JOIN V_PROJECT_KEYCONTACT ON PROJECT.PROJECTID = V_PROJECT_KEYCONTACT.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         max(INPUT_DATE) AS LastHeadline
         FROM V_PROJECT_NOTE
         GROUP BYPROJECTID) AS VPN ON PROJECT.PROJECTID = VPN.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         MAX(CASE
              WHEN MODIFIED_DATE IS NULL THEN INPUT_DATE
              WHEN INPUT_DATE > MODIFIED_DATE THEN INPUT_DATE
              ELSE MODIFIED_DATE END) AS LastNewIssue
         FROM ISSUE
         GROUP BY PROJECTID) AS ISSUE ON PROJECT.PROJECTID = ISSUE.PROJECTID
    LEFT OUTER JOIN (
         SELECT ISSUE.PROJECTID,
         max(ISSUENOTE.INPUT_DATE) AS LastIssueNote
         FROM ISSUE
         INNER JOIN ISSUENOTE ON ISSUE.ISSUEID = ISSUENOTE.ISSUEID
         GROUP BY ISSUE.PROJECTID) AS ISSUE_NOTE ON PROJECT.PROJECTID = ISSUE_NOTE.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         max(modified_date) AS LastRiskLogUpdate
         FROM V_PROJECT_RISK_LAST_AMMENDED
         GROUP BY PROJECTID) AS VPR ON PROJECT.PROJECTID = VPR.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         max(INPUT_DATE) AS LastChecklistUpdate
         FROM PROJECT_CHECKLIST
         GROUP BY PROJECTID) AS PC ON PROJECT.PROJECTID = PC.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         max(input_date) AS LastGANTTUpdate
         FROM V_PROJECT_ACTIVITY_LAST_AMMENDED
         GROUP BY PROJECTID) AS VPA ON PROJECT.PROJECTID = VPA.PROJECTID
    LEFT OUTER JOIN (
         SELECT PROJECTID,
         USERPROFILE.USERNAME AS Supervisor
         FROM USERPROFILE
         INNER JOIN PROJECT_MEMBER AS SUPERVISOR ON USERPROFILE.USERID = SUPERVISOR.USERID RIGHT
         OUTER JOIN PROJECT_MEMBER AS KEYCONTACT ON SUPERVISOR.PROJECT_MEMBERID = KEYCONTACT.PARENTID
         WHERE KEYCONTACT.KEY_CONTACT =1) AS Supervisor ON PROJECT.PROJECTID = Supervisor.PROJECTID
    WHERE V_PROJECT_KEYCONTACT.USERNAME IN ('aaa','bbb','ccc')
    AND (PROJECTSTATUS.PROJECTSTATUS IN ('111', '222', '333'))
    AND ((PROJECT.TITLE NOT LIKE 'xxx%')
    AND (PROJECT.TITLE NOT LIKE 'yyy%')
    AND (PROJECT.TITLE NOT LIKE 'zzz%'))
    ORDER BY V_PROJECT_KEYCONTACT.USERNAME, PROJECT.INPUT_DATE
    HTH,
    Jason

Maybe you are looking for

  • Advice for real performanc​e of LV8.5 operate in the XP and Vista

    Hi all My company had purchased new computers for LabVIEW programming purpose. We may install the LV8.5 in these computers but OS are not decided yet. Also, we have the current PC is only XP licensed Therefore, can anyone give the advice for the real

  • Change File Name in iPhoto

    I am pretty new the Mac world- decided to get one of the new intel iMacs out for managing all my digital media. I hope I am just missing something obvious: how can I change the file name of am image in the iPhoto library browser? I have used a number

  • How can I track emailed pictures?

    I send out copies of iPhoto pictures to a group of kids from age 8 through 17.  It is a tedious task, and generally takes about 2-weeks to complete.  Is there a mechanism in iPhoto '11 that allows information that tracks which pictures have been sent

  • How to display user-editable title in control template (search web part)

    Hi all, SharePoint 2013. I've created a custom control template for a search box.  In the settings there is an option to display the chrome, which will display the Title above the web part as entered by the user in the settings for that web part.   H

  • Flex Box container issue

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.controls.Image; import mx.controls.Alert; public var img:Image = new Image(); public function GetSize