2 Patterns for single Crystal Report (rpt) file

Hi everybody,

Is it possible to display two different pattern of reports and must be on separate pages
First Page displays a summary, second page displays details and other info. Having problem
doing this placing except for company details on page header and the rest on the Details
part of the report.

Pattern:

First Page:
Company Logo
Company Name
Company Address

Statement of Account

Statement Date: (system date)
Period Covered: (date from filter page) Control Number (data from db1)

Company: (company name from db2)
Address: (address from db2) Total Balance (data from db1)

======================================================================================

Statement Summary

Total Deposits (data from db1)
Total Advances (data from db1)
Total Repayments (data from db1)

Transactions for the preiod per Client
(client 1)
(Client 2)
(Client 3)

--------------------------------------------------------------------------------------
Total Balance (data from db1)
====================================================================================


Second Page:

Company Logo
Company Name
Company Address

Company: (data from db2) Control Number (data from db1)
Period Covered (data from filter page) Account Number (data from db1)

======================================================================================
Statement Details
--------------------------------------------------------------------------------------
Prepayment Details

Deposits
Date OR No Description Amount
(record 1)
(record 2)
(and so on . . .)

--------------------------------------------------------------------------------------
Total Deposits (sum)
--------------------------------------------------------------------------------------

Advances

Date OR No Description Amount
(record 1)
(record 2)
(and so on . . .)

--------------------------------------------------------------------------------------
Total Advances (sum)
--------------------------------------------------------------------------------------
Total Prepayments (grand total)
-------------------------------------------------------------------------------------

Transaction Details

(Client 1 from db3):
Date Trans No Status Detail1 No Detail2 No Remarks Amount
(record 1)
(record 2)
(record 3)
(and so on ...)
--------------------------------------------------------------------------------------
Sub-Total (sum)
--------------------------------------------------------------------------------------

(Client 1 from db3):
Date Trans No Status Detail1 No Detail2 No Remarks Amount
(record 1)
(record 2)
(record 3)
(and so on ...)
--------------------------------------------------------------------------------------
Sub-Total (sum)
--------------------------------------------------------------------------------------

(Client 3 from db3):
Date Trans No Status Detail1 No Detail2 No Remarks Amount
(record 1)
(record 2)
(record 3)
(and so on ...)
--------------------------------------------------------------------------------------
Sub-Total (sum)
--------------------------------------------------------------------------------------

Total Transaction For the period (sum of all transaction) (grand total)
--------------------------------------------------------------------------------------


Thanks...


den2005


Answer this question

2 Patterns for single Crystal Report (rpt) file

  • Vuong

    All this query u right in Stored Procedure & return it to DataSet

    So for sub report u can return multiple tables from Stored Procedure & attacth it with Sub Report SetDataSource

    Dim ReportSample As New CrystalReport1

    Dim DsData As New DataSet

    Dim SDA As New SqlClient.SqlDataAdapter("EXEC Usp_SampleReport", "Server=PROJSRVR\SQL2K;Database=GKKSql_2005;user id=sa;pwd=")

    SDA.Fill(DsData)

    Dim objSubReportObject As SubreportObject

    Dim objSubReport As ReportDocument

    objSubReportObject = ReportSample.ReportDefinition.ReportObjects.Item("Subreport1")

    objSubReport = ReportSample.OpenSubreport(objSubReportObject.SubreportName)

    objSubReport.SetDataSource(DsData.Tables(1))

    ReportSample.SetDataSource(DsData.Tables(0))

    CrystalReportViewer1.ReportSource = ReportSample

    I u have anything let me know



  • Anthony Giambalvo

    Hi,

    put both summary as well details in different section. Supress the summary section if pagenumber<>1 similary supress the details section if pagenumber<>2. Hope this will work. Let u try



  • J.Mouzakis

    Hi Manish Joisar,
    I am using VS 2002, and Subreport is not available only with VS 2005. Right Is there other way to do this

    Thanks for the reply.

    Dennis

  • cberman

    Thanks for the reply, Manish Joisar.

    Subreport Not familiar with this, how exactly this done Please provide samples how to do this.

    den2005


  • solution dll

    We are working on VS 2003 & sub Report is there

    I don't know it is there in VS 2002



  • Greg Lewis

    have u set SetdataSource to Sub Report

    I have given sample in my Prev. replies

    I have not displaying data field values yet.

    means



  • Peter Z

    Hi,

    I put text to be displayed on first page on Report Header Section and sub report on Details Section and the sub report contents are not displayed. I have not displaying data field values yet. How to fixed this

    den2005


  • wz

    Hi Manish,
    How would supply a sql statement like "Select a.CompanyName, b.DateCreated, c.*, b.Amount From Table1 a inner join Table2 b on a.DocID = b.DocID inner join table3 c on a.DocID = c.DocID Where a.COGUid = " for the sub report

    Dennis

  • Rekha

    Thanks for reply Vasanths R.

    How exactly can I do this Please give actual codes or samples on how to apply them.

    den2005


  • Anthony Zoko

    After creating Normal Report

    Right Click on Report & there is option of Insert -> Sub report

    Sub report is just like normal report but this can / cannot be related to main report

    By following way u can pass Datasource to Sub Report

    Dim pReport As new CrystalReport1 (Main Report)

    Dim pStrSubReportName As String = "<Sub Report Name>"

    i.e. Name u gave in Properties of Sub Report

    Dim objSubReportObject As SubreportObject

    Dim objSubReport As ReportDocument

    objSubReportObject = pReport.ReportDefinition.ReportObjects.Item(pStrSubReportName)

    objSubReport = pReport.OpenSubreport(objSubReportObject.SubreportName)

    objSubReport.SetDataSource(pDSReport)

    Always give setDatasource to main Report after u give to All Subreport withing that report

    If u requires more details let me know



  • Will Stott

    Hi Manish,
    Right now, I am not using subreport yet, that is second page, in the first page I have problem display the start date and end date selected on a web page to be displayed on the first page of crystal report and seems the unable to display the selected company name and its address.
    Company name and company address came from different tables and different databases, their refrences is between companyid and coguid. How I do this

    The data to be displayed in second page is not complete, what is known right now is the second part of the second page.

    Thanks for the patience.

    dennis

  • Zeldon

    u can use Subreport to create different Format in Same RPT file



  • Cas10

    Thanks Manish Joisar. How do you change the sql statement to filter the data of subreport to be displayed in the code

    den2005


  • Ramu Devarasetty

    Right Click on SubReport

    Click on Change SubReport Links

    Drag & Drop your SubReport Field which is linked with Main Report Field on Right Side & select Field From Main Report to link it

    If anything else let me know

    Regards



  • 2 Patterns for single Crystal Report (rpt) file