none
Sub Report Displaying problem RRS feed

  • Question

  • hi all,
    i have problem regarding displaying Sub reports


    Well i have main report ("MAINREPORT.RDLC" and it is bind to following DATATABLE

    LED_HEAD
    ------------------
    LHD_CODE
    LHD_NAME

    i have inserted Table object in it.
    in main report i have created one group on LHD_CODE.

    then i have created one new report ("SUBREPORT1.RDLC") and it is bound to following DATATABLE

    LED_MAST
    ----------------
    LED_CODE
    LED_NAME
    LHD_CODE

    BOTH DATATABLE IN SAME DATASET.

    SUBREPORT1.RDLC HAS ONE REPORT PARAMETER : "MYLHD" ->STRING TYPE AND "HIDDEN"

    THEN I HAVE INCLUDE "SUBREPORT1.RDLC" IN TO MAINREPORT'S DETAILS section of Table objects.

    then i right click and select parameter "mylhd" and value is : =Fields!LHD_CODE.Value, press OK

    now i have implement the subreport processing method also which is looking below:

    Public Sub DemoSubreportProcessingEventHandler(ByVal sender As Object, _  
     
    ByVal e As SubreportProcessingEventArgs)  
     
    'MsgBox("subreport processing called")  
     
    e.DataSources.Add(New ReportDataSource("LedgerDataSet_LED_MAST", FillDataset()))  
     
    End Sub  
     
     
     
    Private Function FillDataset() As DataTable  
     
    Dim da As SqlClient.SqlDataAdapter  
     
    Dim tmpds As New DataSet  
     
    da = SaiSunSolutions.DbLibrary.GenerateAdaptor("SELECT * FROM LED_MAST", con)  
     
    da.Fill(tmpds)  
     
    ' MsgBox(tmpds.Tables(0).Rows.Count)  
     
    Return tmpds.Tables(0)  
     
    End Function  
     
     
     
     
     
    after that when i run the report ...

    Error: subreport could not be shown


    Please,  provide some hint regarding same.

    Tejas kishanwala

    Tuesday, August 19, 2008 2:41 PM

Answers

  • You can get more detailed information on why the subreport didn't display from the output window while debugging.  One common mistake is in not specifying the name of the data set correctly in the subreport processing handler.  You may want to double check that the name you are specifying to the ReportDataSource object matches the name in e.DataSourceNames.
    Wednesday, August 20, 2008 8:52 PM
    Moderator

All replies

  • You can get more detailed information on why the subreport didn't display from the output window while debugging.  One common mistake is in not specifying the name of the data set correctly in the subreport processing handler.  You may want to double check that the name you are specifying to the ReportDataSource object matches the name in e.DataSourceNames.
    Wednesday, August 20, 2008 8:52 PM
    Moderator
  •  thanks dear,

    well, i have just yesterday solved my problem, as you said, i have passed the datasource name but there is a little bit mistake while giving a name of datasource, that was Character CASE problem for only one character and that i changed...

    After that my report is coming very fine...



    Saturday, August 23, 2008 5:22 AM