in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

subreports with parameters

Last post 11-14-2007 7:32 PM by mendezbytwo. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-13-2006 5:16 PM

    subreports with parameters

    I have a report with two subreports. One – use Two parameters = Beginning Date and Ending Date and other is Summary report, so he used only Ending Date.
    Summary report seems to work properly as a stay along report but returns wrong data as subreport. And lay out for Summary report doesn’t work properly as well.

    And other question – may I use SQL statement, table .. for parameters (non date), not hard coded ones using Report Designer?

  • 07-18-2006 8:35 AM In reply to

    Re: subreports with parameters

    It would be great if you could provide your sample report on the babis of Nwind.mdb. Your requirement is not very clear.
     
    -Andrew
    <pvictoria> wrote in message news:183740@test.componentone.com...

    I have a report with two subreports. One – use Two parameters = Beginning Date and Ending Date and other is Summary report, so he used only Ending Date.
    Summary report seems to work properly as a stay along report but returns wrong data as subreport. And lay out for Summary report doesn’t work properly as well.

    And other question – may I use SQL statement, table .. for parameters (non date), not hard coded ones using Report Designer?



    http://home.componentone.com/cs/forums/183740/ShowPost.aspx

  • 11-14-2007 1:47 AM In reply to

    Re: subreports with parameters

    Hi i'm also having the same problem.

    I have a report which contains several subreports, some of them summary graphics, some others details. I need all the reports in their datasource have the same values for the specified parameters in the master report (starttime, endtime). At DB level, the reports execute different stored procedures but all with the same two input parameters.

    The problem is... i'm assigning via code the parameters for the master report and works fine, but for the subreports, they take the hard coded values used in their own built datasource and not the ones for the master report. Is there any way to pass the subreports the same parameters as the main report?? this has to be done by code or script in the designer?? Also, how do i set the same connection string for all the subreports to be the same as the master report?? I'm using C1WebReport and C#

     Examples:

     Datasource MasterReport:

     PARAMETERS starttime date '10/31/2007',  endtime date '11/05/2007';
    sp_desca_agent_log_activity_graphic(starttime, endtime)

    Datasource Subreport1:

    PARAMETERS starttime date '10/31/2007',  endtime date '11/05/2007';
    sp_desca_agent_log_activity(starttime, endtime) 

     Any help would be appreciated ASAP. I Included some of the reports i'm developing.

  • 11-14-2007 3:11 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 483

    Re: subreports with parameters

    Filed under: ,
  • 11-14-2007 7:32 PM In reply to

    Re: subreports with parameters

    Hi, thanks so much for yor help... it works ok if i pass it through .net code, but not as an embedded script on the report... i tried putting this in the OnFormat value in the footer section (which has the subreport field)

    SubReport1.subreport.datasource.recordsource = "sp_desca_agent_log_activity(#" & starttime & "#,#" & endtime & "#)"

     When i run the report using the report designer runs ok as i could see in the sql profiler. But when i run it in my app i have the same problem i had before. I didn't want to assing this recordset through code because of supporting issues, it's better if i could assign it directly in the report. Am i doing something wrong? because is the same sentence i used in code with no problem or is someking of a bug?

    This is the C# code put in the page

    cwr.Report.Sections.Footer.Fields["SubReport1"].Subreport.DataSource.RecordSource = "sp_desca_agent_log_activity(#" + starttime + "#,#" + endtime + "#)";

Page 1 of 1 (5 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.