?
Solved

Seagate : Multiple Recordsets in a single report.

Posted on 2001-08-06
5
Medium Priority
?
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 600 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

800 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