subreport

  • Thread starter Charles Crawford
  • Start date
C

Charles Crawford

Hello,

I've created a data-driven application and would like to provide users with
printed reports.

The primary report consists of a parent table and a details table, related
by a Primary Key ('ID') and Foreign Key ('MANHOLE_ID'). Both are INTEGER
data types.

I've configured my parent report and included a subreport control, which
uses another report document (.rdlc) to display the related table.

In the subreport's report document, I've defined the report parameter to be
'MANHOLE_ID' and set the filter on the report table to:
'Fields!MANHOLE_ID.Value = Parameters!MANHOLE_ID.Value'.

In the parent report's document, I've set the subreport parameter for the
subreport control to: MANHOLE_ID = 'Fields!MANHOLE_ID.Value'.

In the form containing the report viewer control, I've added the
eventhandler 'SubreportProcessingEventHandler() code as described in the
following KB article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;919157

No matter what I do, I still get 'Error: Subreport could not be shown' when
viewing the report. I've tested the subreport's datasource by viewing the
subreport as a parent report without a subreport and it gets the data
correctly.

Does anyone have any idea what might be preventing the subreport from
displaying?

Thanks,

Charlie
 
C

Charles Crawford

Sorry, but I mistyped:
In the parent report's document, I've set the subreport parameter for the
subreport control to: MANHOLE_ID = 'Fields!MANHOLE_ID.Value'.

Should read:
In the parent report's document, I've set the subreport parameter for the
subreport control to: MANHOLE_ID = 'Fields!ID.Value'.

-didn't wan't to get that as a solution... if it were how I had typed it
the first time, I would be getting other errors besides the one I'm getting.

Thanks again to anyone who can provide me with some help on this one.

Thanks,

Charlie
 
L

Linda Liu [MSFT]

Hi Charles,

No matter what kind of error is raised when loading a subreport, we always
get the messge 'Error:Subreport could not shown'.

The cause of the error may be as follows.

1. No setting the data source of the subreport in the program.

2. No setting the values of report parameters which don't allow null value,
if the subreport has.

3. The data type of the report parameter doesn't match that of the field
with which the report parameter compare in an expression, such as a filter
expression. In your scenario, please ensure that the data type of the
report parameter 'MANHOLE_ID' is Integer.

4. No setting the data source of the subreport in the report's
reportProcessing event handler.

Please have a check according to the above four points and tell me the
result.

I look forward to your reply.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Charles Crawford

Thanks Linda,

Actually, I found the error... it seems that some residual code was left in
the .rdlc file pertaining to DataSets that had been added and then removed.

The actual problem was the name of the table adapter. The table adapter
added to the form with the report viewer control was automatically spelled:
'iNVERTSTableAdapter' and in the .rdlc file, it was shown as
'INVERTSTableAdapter'. I had to search the XML source of the file, however,
to find this.

Thanks again,

Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top