Solved

Seagate : Multiple Recordsets in a single report.

Posted on 2001-08-06
5
503 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 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

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. …
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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