ActiveReports for .NET Support

Started by cptacek at 02-11-2010 2:29 PM. Topic has 3 replies.

Print Search Rate
Sort Posts:    
   02-11-2010, 2:29 PM
cptacek is not online. Last active: 2/12/2010 4:05:04 AM cptacek

Not Ranked
Joined on 02-12-2010
Posts 2
pass parameters to subreport for no data event
I have a report and a subreport. I am able to pass three parameters from the report to the subreport for use in the SQL statement. I use them to get the correct values out of the SQL statement, and I also output them so I can use them on the subreport itself.



Report code:
public void ActiveReport_DataInitialize()
{
rpt.Fields.Add("I15_NAME_ID_NUM_S");
rpt.Fields.Add("I15_LOC_CODE_S");
rpt.Fields.Add("I15_ORDER_NUM_S");
}

public bool ActiveReport_FetchData(bool eof)
{
prepay_reference = ((DataDynamics.ActiveReports.DataSources.XMLDataSource)rpt.DataSource).Field("@prepay_reference",false).ToString();

rpt.Fields["I15_NAME_ID_NUM_S"].Value = ((DataDynamics.ActiveReports.DataSources.XMLDataSource)rpt.DataSource).Field("../../header/@bill_to_name_id",false).ToString();
rpt.Fields["I15_LOC_CODE_S"].Value = prepay_reference.Substring(0,3);
rpt.Fields["I15_ORDER_NUM_S"].Value = prepay_reference.Substring(prepay_reference.LastIndexOf("-")+1,prepay_reference.Length - 4);

return eof;
}

Subreport SQL statement:
SELECT
I15_INV_ITEM_S,
'' NAME_ID,
'' LOCATION_CODE,
'' ORDER_NUMBER
FROM
I15_ORDERS,
I02_INVENTO_MASTER
WHERE I15_ORDER_STATUS_S = 'A'
AND I15_INV_ITEM_S = I02_INV_ITM_NUM_S
AND I15_LOC_CODE_S = I02_LOC_CD_S

AND I15_NAME_ID_NUM_S = ''
AND I15_LOC_CODE_S = ''
AND I15_ORDER_NUM_S = ''
;

Doing it this way, I can pass three parameters to the subreport, and when there is data returned, read those three values and use them on the subreport.

I now want to pass two more variables for use when there is no data returned from the subreport. How can I do this? These two variable won't be returned with the sql statement, so how do I gather those values?

Thanks,
cptacek
   Report 
   02-12-2010, 3:33 AM
AnkitN is not online. Last active: 6/8/2010 6:43:55 AM AnkitN

Top 25 Posts
Joined on 03-03-2009
Posts 844

DDStaff
Re: pass parameters to subreport for no data event
Hello,

Actually I am not able to understand your requirements correctly. Do you want to pass parameters to the subreport or want to return parameters from the subreport to the main report when there is not data in the subreport?

Regards,
Ankit Nigam


   Report 
   02-12-2010, 7:58 AM
cptacek is not online. Last active: 2/12/2010 4:05:04 AM cptacek

Not Ranked
Joined on 02-12-2010
Posts 2
Re: pass parameters to subreport for no data event
Either would work...I can't figure out how to do either of those options. For now, let's concentrate on passing the parameters to the subreport for use when the subreport sql statement returns no data.
   Report 
   02-16-2010, 10:49 AM
AnkitN is not online. Last active: 6/8/2010 6:43:55 AM AnkitN

Top 25 Posts
Joined on 03-03-2009
Posts 844

DDStaff
Re: pass parameters to subreport for no data event
Hello,

You can use the NoData event in the subreport to pass the data from the subreport to the main report when a subreport becomes empty. To know more about NoData event you may click here.

However your requirements are still not clear like why you want to pass the parameters to the subreport when subreport has no data? Could you please provide more information about your requirements so that I may try to provide you better solution?

Regards,
Ankit Nigam


   Report 
GrapeCity » Product Support » ActiveReports f... » Re: pass parameters to subreport for no data event

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.