Solved

Seagate : Multiple Recordsets in a single report.

Posted on 2001-08-06
5
490 Views
Last Modified: 2008-03-10

 Hi,

   I am working with Seagate Crystal Report 8.0.1
   I am using the Crystal report on the Web.
   I have a ttx file called "ReportHeader" and
   another ttx file called "ReportContent".
   My COM object returns 2 recordsets one for
   each ttx file. Everything works fine if i make
   the "ReportContent" as a subreport. But if i tried
   to use both the ttx file in a single report
   the "ReportContent" doesnot show any value.
   I added thest two ttx file as 2 tables in my
   report. There is no link between them.  Here is my asp code.

   First recordset has only one record in it.
   Second one has 277 records in it. But it's not
   getting displayed. Cant i use more than one
   recordset in a report ???

-------------------------------------------------------------------

session("oRpt").DiscardSavedData

' Creates RtDbBus object
Set session("oRtDbBus") = Server.CreateObject(rtDbBus)
' Calls Generate Method
Call session("oRtDbBus").Generate(arrParams,resultSets)

' Creates session object for each resultset returned by the Generate method
For index = 0 to UBound(resultSets)
     Response.Write(" ResultsetRowCount : " & resultSets(index).RecordCount & "<BR>")
     Set session("oRs" & (index+1)) = resultSets(index)
Next

Set Database = session("oRpt").Database
If index > 0 then
     Dim intTablesCount
     Dim intTableIndex
     
     ' Get the Main tables count
     intTablesCount = Database.Tables.Count

     ' Sets Resultsets for the main tables
     For intTableIndex = 1 To intTablesCount
          Database.Tables.Item(intTableIndex).SetPrivateData 3,  session("oRs" & intTableIndex)
     Next

     ' Set the resultset for subreports.
     Set crpSections = session("oRpt").Sections
     For Each crpSection In session("oRpt").Sections
          For Each rptObject In crpSection.ReportObjects
               If rptObject.Kind = 5 Then
                    Set crpSubreportObject = rptObject
                    Set crpSubreport = session("oRpt").OpenSubreport(crpSubreportObject.SubreportName)
                    Set crpDatabase = crpSubreport.Database
                    Set crpDatabaseTable = crpDatabase.Tables.Item(1)
                    crpDatabaseTable.SetPrivateData 3, session("oRs" & intTableIndex)
                    intTableIndex = intTableIndex + 1
               End if
          Next
     Next
End if
 
-------------------------------------------

 Thanks,

 Sankar S.
0
Comment
Question by:sankars98
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6357104
The official line from CrystalDecisions is that multiple TTX files in one report is not recommended because of the inability to link the tables together and the lack of indexes.  See link for more info:

http://support.crystaldecisions.com/kbase/c2007228.asp

A few other thoughts:

If you have only one record in your header can't you incorporate those fields into your detail recordset for reporting purposes?

I have always tried to get a single recordset or table created on which to report.  It sometimes takes a little more processing, but the reports are much easier to design, even if you have to resort to sub-reports for detail data.
0
 
LVL 1

Author Comment

by:sankars98
ID: 6357314

 Thanks for the response, DRRYAN3.

> I have always tried to get a single recordset or table
created on which to report.  It sometimes takes
> a little more processing, but the reports are much easier to design, even if you have to resort to sub-reports for detail data.

 That's how initially i designed my reports. The problem
 with that approach is Subreports headers are displayed
 only on the first page. It's not getting displayed on the
 second page onwards. Is there anyway to say the crystal report to display the subreport headers in all the pages ?

Thanks,

Sankar S.
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6357498
You could insert a dummy group in your subreport and on the Change Group dialog, check the box indicating that the group header is to be repeated on each page.

DRRYAN3
0
 
LVL 1

Author Comment

by:sankars98
ID: 6359940

 DRRYAN3, Thanks for the reponse. I am really new to
 this crystal report area. So, can you please tell me
 how to insert a dummy group to a report ? I looked
 at the help file and tried to insert a group. It seems
 the value for the group comes from the recordset
 itself. I dont know how to insert a static header group
 field.

Thanks,

Sankar S.
 
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 150 total points
ID: 6360193
In your query which creates the recordset, add a static value

select "AA" as DummyField, field1, field2 from table

then setup the first group as normal, basing it on the DummyField from your query.  Since this value never changes it will not impact the groupings performed by subsequent groups and will let you put a page header on each page as described above.

DRRYAN3
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now